On Thu, Oct 22, 2015 at 03:20:15PM +0200, Andrea Arcangeli wrote:
If schedule spontaneously wakes up a task in TASK_KILLABLE state that
would be a bug in the scheduler in my view. Luckily there doesn't seem
to be such a bug, or at least we never experienced it.
Well, there will be a wakeup, just not the one you were hoping for.
We have code that does:
@cond = true;
get_task_struct(p);
queue(p)
/* random wait somewhere */
for (;;) {
prepare_to_wait();
if (@cond)
break;
...
handle_userfault()
...
schedule();
...
dequeue(p)
wake_up_process(p) ---> wakeup without userfault wakeup
These races are (extremely) rare, but they do exist. Therefore one must
never assume schedule() will not spuriously wake because of these
things.
Also, see:
lkml.kernel.org/r/CA+55aFwHkOo+YGWKYROmce1-H_uG3KfEUmCkJUerTj=ojY2H6Q@mail.gmail.com
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>