Re: [RFC PATCH 0/3] futex: Add support task local hash maps.

From: Thomas Gleixner
Date: Sun Oct 27 2024 - 06:01:57 EST


On Sun, Oct 27 2024 at 00:34, Sebastian Andrzej Siewior wrote:
> and adds support for task local futex_hash_bucket. It can be created via
> prctl() and each thread has to enable it via another prctl() interface.

That's a quick way to evaluate it.

> Individual threads may enable it but I guess this gets more complicated
> because the libc internal locks (or another lib) maybe be shared by
> multiple threads. So maybe it would be best to enable the local hash by
> the group leader and automatically enable for each thread on fork().

At the end we want to let the kernel automatically create the hash table
on first use of a private futex with a default size. That's a one off
latency. The prctl should only be there for preallocation and sizing.

And yes, you want to inherit when a new thread is created.

Thanks,

tglx