[PATCH v9 00/11] futex: Add support task local hash maps.
From: Sebastian Andrzej Siewior
Date: Tue Feb 25 2025 - 12:20:40 EST
Hi,
this is a follow up on
https://lore.kernel.org/ZwVOMgBMxrw7BU9A@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
and adds support for task local futex_hash_bucket.
This is rebased of v8 ontop of PeterZ's futex_class. The complete tree
is at
https://git.kernel.org/pub/scm/linux/kernel/git/bigeasy/staging.git/log/?h=futex_local_v9
https://git.kernel.org/pub/scm/linux/kernel/git/bigeasy/staging.git futex_local_v9
v8…v9 https://lore.kernel.org/all/20250203135935.440018-1-bigeasy@xxxxxxxxxxxxx
- Rebase on top PeterZ futex_class
- A few patches vanished due to class rework.
- struct futex_hash_bucket has now pointer to futex_private_hash
instead of slot number
- CONFIG_BASE_SMALL now removes support for the "futex local hash"
instead of restricting it to to 2 slots.
- Number of threads, used to determine the number of slots, is capped
at num_online_cpus.
v7…v8 https://lore.kernel.org/all/20250123202446.610203-1-bigeasy@xxxxxxxxxxxxx/
- Rebase on v6.14-rc1
Sebastian Andrzej Siewior (11):
futex: fixup futex_wait_setup [fold futex: Move futex_queue() into
futex_wait_setup()]
futex: Create helper function to initialize a hash slot.
futex: Add basic infrastructure for local task local hash.
futex: Hash only the address for private futexes.
futex: Allow automatic allocation of process wide futex hash.
futex: Decrease the waiter count before the unlock operation.
futex: Introduce futex_q_lockptr_lock().
futex: Acquire a hash reference in futex_wait_multiple_setup().
futex: Allow to re-allocate the private local hash.
futex: Resize local futex hash table based on number of threads.
futex: Use a hashmask instead of hashsize.
include/linux/futex.h | 32 ++-
include/linux/mm_types.h | 7 +-
include/uapi/linux/prctl.h | 5 +
kernel/fork.c | 24 ++
kernel/futex/core.c | 450 +++++++++++++++++++++++++++++++++++--
kernel/futex/futex.h | 15 +-
kernel/futex/pi.c | 15 +-
kernel/futex/requeue.c | 29 ++-
kernel/futex/waitwake.c | 31 ++-
kernel/sys.c | 4 +
10 files changed, 574 insertions(+), 38 deletions(-)
--
2.47.2