Re: [PATCH v9 00/11] futex: Add support task local hash maps.

From: Sebastian Andrzej Siewior
Date: Mon Mar 03 2025 - 09:20:28 EST


On 2025-03-03 11:54:16 [+0100], Peter Zijlstra wrote:
> Right, I've been going over this and been poking at the patches for the
> past few days, and I'm not quite sure where to start.
>
> There's a bunch of simple things, that can be trivially fixed, but
> there's also some more fundamental things.
>
> I've written a pile of patches on top of this while playing around with
> things. The latest pile sits in:
>
> queue/locking/futex
>
> I'm not sure I should post the patches as a reply to this email (I can,
> if people want), but let me try and summarize what I did and why.
>
>
> Primarily, the reason I started poking at it is that I think the prctl()
> as implemented is completely useless. Notably its effect is entirely
> ephemeral, one pthread_create() call can re-size the hash, destroying
> the user requested size. Also, I still feel one should be able to set
> the hash size to 0 and have it revert to global hash.
>
> Finally prctl() should not return until the rehash is complete.
>
> I think my implementation now does all that -- but I've not tested it
> yet -- I've to write a prctl() testcase and it was too nice outside :-)

I kept prctl() mostly around for testing with a few hacks to be able to
always resize it, even if the size is the same/ smaller. tglx to have it
only increasing. However, let me take this and do some testing.


> Anyway, the entire stack builds and boots, but is otherwise very much
> untested.
>
> WDYT?

well. Let take a look and do a bit of hammering.

Sebastian