linux/kernel/futex
Sebastian Andrzej Siewior 3f6b233018 futex: Acquire a hash reference in futex_wait_multiple_setup()
futex_wait_multiple_setup() changes task_struct::__state to
!TASK_RUNNING and then enqueues on multiple futexes. Every
futex_q_lock() acquires a reference on the global hash which is
dropped later.

If a rehash is in progress then the loop will block on
mm_struct::futex_hash_bucket for the rehash to complete and this will
lose the previously set task_struct::__state.

Acquire a reference on the local hash to avoiding blocking on
mm_struct::futex_hash_bucket.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20250416162921.513656-9-bigeasy@linutronix.de
2025-05-03 12:02:06 +02:00
..
core.c futex: Create private_hash() get/put class 2025-05-03 12:02:06 +02:00
futex.h futex: Create private_hash() get/put class 2025-05-03 12:02:06 +02:00
Makefile futex: Split out wait/wake 2021-10-07 13:51:11 +02:00
pi.c futex: Create futex_hash() get/put class 2025-05-03 12:02:06 +02:00
requeue.c futex: Create futex_hash() get/put class 2025-05-03 12:02:06 +02:00
syscalls.c futex: make futex_parse_waitv() available as a helper 2023-09-29 02:37:05 -06:00
waitwake.c futex: Acquire a hash reference in futex_wait_multiple_setup() 2025-05-03 12:02:06 +02:00