futex: Mark the begin of futex exit explicitly
authorThomas Gleixner <tglx@linutronix.de>
Wed, 6 Nov 2019 21:55:41 +0000 (22:55 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Nov 2019 09:10:11 +0000 (10:10 +0100)
commitb2f4e10676f7c1ae38a881afa265585365730c81
tree70f40e32a7d12550488c76b1b3de116e204dfd5a
parent350a30ce849da8736601ba28ae3d5f3f10804343
futex: Mark the begin of futex exit explicitly

commit 18f694385c4fd77a09851fd301236746ca83f3cb upstream.

Instead of relying on PF_EXITING use an explicit state for the futex exit
and set it in the futex exit function. This moves the smp barrier and the
lock/unlock serialization into the futex code.

As with the DEAD state this is restricted to the exit path as exec
continues to use the same task struct.

This allows to simplify that logic in a next step.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20191106224556.539409004@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/futex.h
kernel/exit.c
kernel/futex.c