[RFC PATCH, -v2] sched/wait: Introduce new, more compact wait_event*() primitives

From: Ingo Molnar
Date: Wed Mar 08 2017 - 07:20:11 EST



* Ingo Molnar <mingo@xxxxxxxxxx> wrote:

> + if (___wait_is_interruptible(0) && wes->ret) {

So that line is dumb and bogus, it should be:

if (___wait_is_interruptible(TASK_UNINTERRUPTIBLE) && wes->ret) {

... which in the final version will be passed in parametrically within wait.c
itself (but probably not passed in from the macro space, to lower the call site
overhead), that is why I preserved the __wait_is_interruptible() check to begin
with.

(This bug could perhaps explain the boot hang Peter saw.)

I also removed the bool state variables Peter disliked and added (a tiny ...) bit
more documentation, the latest version is attached below.

Still not signed off, due to the _v1/_v2 devel hack - and it's of course still
very incomplete, as only wait_event() is converted.

But this should be a reviewable demo of the new wait-event state machine logic.

I'd hesitate to put much more work into this without first having consensus over
whether this is a good idea to begin with.

Thanks,

Ingo

======================>