]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
sched/headers: fix up header file dependency on <linux/sched/signal.h>
authorLinus Torvalds <torvalds@linux-foundation.org>
Tue, 7 Mar 2017 23:33:14 +0000 (15:33 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 8 Mar 2017 18:36:03 +0000 (10:36 -0800)
commitbd0f9b356d00aa241ced36fb075a07041c28d3b8
tree3184549164dad820211b93695cfc5f6cf7fecee5
parentec3b93ae0bf4742e9cbb40e1964129926c1464e0
sched/headers: fix up header file dependency on <linux/sched/signal.h>

The scheduler header file split and cleanups ended up exposing a few
nasty header file dependencies, and in particular it showed how we in
<linux/wait.h> ended up depending on "signal_pending()", which now comes
from <linux/sched/signal.h>.

That's a very subtle and annoying dependency, which already caused a
semantic merge conflict (see commit e58bc927835a "Pull overlayfs updates
from Miklos Szeredi", which added that fixup in the merge commit).

It turns out that we can avoid this dependency _and_ improve code
generation by moving the guts of the fairly nasty helper #define
__wait_event_interruptible_locked() to out-of-line code.  The code that
includes the signal_pending() check is all in the slow-path where we
actually go to sleep waiting for the event anyway, so using a helper
function is the right thing to do.

Using a helper function is also what we already did for the non-locked
versions, see the "__wait_event*()" macros and the "prepare_to_wait*()"
set of helper functions.

We might want to try to unify all these macro games, we have a _lot_ of
subtly different wait-event loops.  But this is the minimal patch to fix
the annoying header dependency.

Acked-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/wait.h
kernel/sched/wait.c