Re: [PATCH 5/7] sched/wait: always queue new waiters at the tail
From: Oleg Nesterov
Date: Wed Nov 25 2026 - 07:24:52 EST
On 11/24, Linus Torvalds wrote:
>
> So just queue everyone in FIFO order. LIFO might be better for
> throughput, but every time we've ever tried that optimization in real
> life, it has caused fairness issues, so let's just do the obvious thing
> and add new waiters at the end of the list.
I am still worried about the "ret < 0" case in __wake_up_common().
wake_page_function() does
if (flags & WQ_FLAG_EXCLUSIVE) {
if (test_bit(key->bit_nr, &key->folio->flags.f))
return -1;
if (flags & WQ_FLAG_CUSTOM) {
if (test_and_set_bit(key->bit_nr, &key->folio->flags.f))
return -1;
flags |= WQ_FLAG_DONE;
}
}
Before this patch, all non-exclusive waiters are already woken when
wake_page_function() returns -1.
Perhaps this change in behaviour is fine... I'll try to carefully read
your series later.
Oleg.