futex: Avoid redundant task lookup
authorThomas Gleixner <tglx@linutronix.de>
Thu, 2 Sep 2021 09:48:51 +0000 (11:48 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Thu, 2 Sep 2021 20:07:18 +0000 (22:07 +0200)
commit340576590dac4bb58d532a8ad5bfa806d8ab473c
treef48c73dadbf0cb325a58423fd41adb8f6a3157b5
parent249955e51c8136189b3c66f54e212981a1350a0f
futex: Avoid redundant task lookup

No need to do the full VPID based task lookup and validation of the top
waiter when the user space futex was acquired on it's behalf during the
requeue_pi operation. The task is known already and it cannot go away
before requeue_pi_wake_futex() has been invoked.

Split out the actual attach code from attach_pi_state_owner() and use that
instead of the full blown variant.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20210902094414.676104881@linutronix.de
kernel/futex.c