diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-07-23 10:16:49 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-08-02 20:39:44 -0700 |
commit | 2a9127fcf2296674d58024f83981f40b128fffea (patch) | |
tree | 3ca484e7a7e6a15a9ada066baae11c4ef12ed898 /mm/page_poison.c | |
parent | bcf876870b95592b52519ed4aafcf9d95999bc9c (diff) | |
download | lwn-2a9127fcf2296674d58024f83981f40b128fffea.tar.gz lwn-2a9127fcf2296674d58024f83981f40b128fffea.zip |
mm: rewrite wait_on_page_bit_common() logic
It turns out that wait_on_page_bit_common() had several problems,
ranging from just unfair behavioe due to re-queueing at the end of the
wait queue when re-trying, and an outright bug that could result in
missed wakeups (but probably never happened in practice).
This rewrites the whole logic to avoid both issues, by simply moving the
logic to check (and possibly take) the bit lock into the wakeup path
instead.
That makes everything much more straightforward, and means that we never
need to re-queue the wait entry: if we get woken up, we'll be notified
through WQ_FLAG_WOKEN, and the wait queue entry will have been removed,
and everything will have been done for us.
Link: https://lore.kernel.org/lkml/CAHk-=wjJA2Z3kUFb-5s=6+n0qbTs8ELqKFt9B3pH85a8fGD73w@mail.gmail.com/
Link: https://lore.kernel.org/lkml/alpine.LSU.2.11.2007221359450.1017@eggly.anvils/
Reported-by: Oleg Nesterov <oleg@redhat.com>
Reported-by: Hugh Dickins <hughd@google.com>
Cc: Michal Hocko <mhocko@suse.com>
Reviewed-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_poison.c')
0 files changed, 0 insertions, 0 deletions