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

Sebastian Andrzej Siewior posted 3 patches 1 year, 3 months ago
There is a newer version of this series
[RFC PATCH 0/3] futex: Add support task local hash maps.
Posted by Sebastian Andrzej Siewior 1 year, 3 months ago
Hi,

this is a follow up on
	https://lore.kernel.org/ZwVOMgBMxrw7BU9A@jlelli-thinkpadt14gen4.remote.csb

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.

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().

Sebastian
Re: [RFC PATCH 0/3] futex: Add support task local hash maps.
Posted by Thomas Gleixner 1 year, 3 months ago
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