Re: [PATCH v8 03/15] futex: Add basic infrastructure for local task local hash.
From: Peter Zijlstra
Date: Tue Feb 04 2025 - 05:35:05 EST
On Mon, Feb 03, 2025 at 04:51:14PM +0100, Sebastian Andrzej Siewior wrote:
> All the things I mentioned are open for debate:
So how about we add sysctl_futex_private; when set to 0 it will disable
the private hash for every new task, unless task explicitly calls
PR_FUTEX_HASH_SET. When non-zero, it is the base for the auto-scaling.
(then BASE_SMALL would have this default to 0, otherwise 4 as per this
patch set)
I would let PR_FUTEX_HASH_SET override and disable auto-scaling. There
is nothing more annoying than a computer that thinks it knows better.
User asked for N, user gets N etc.
If user sets 0, fall back to global hash.
Anyway, none of this solves anything when a process has both an active
RT part and an active !RT part (which isn't uncommon AFAICT).
Then the RT bits will still get interference from the !RT bits. Do we
want to complicate things and consider that?