Re: futex performance regression from "futex: Allow automatic allocation of process wide futex hash"
From: Peter Zijlstra
Date: Fri Jun 27 2025 - 07:07:54 EST
On Thu, Jun 26, 2025 at 03:50:34PM +0200, Sebastian Andrzej Siewior wrote:
> On 2025-06-26 15:17:15 [+0200], Peter Zijlstra wrote:
> > > I'd vote for defaulting to global for one more release.
> >
> > Probably best to do that; means we don't have to rush crazy code :-)
>
> If we do that, that means we need to ensure that the private hash is not
> deployed while a thread is created and the prctl() function can only
> work create the private hash if the application is single threaded.
I was thinking something like so..
---
diff --git a/init/Kconfig b/init/Kconfig
index af4c2f085455..666783eb50ab 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -1716,9 +1716,13 @@ config FUTEX_PI
depends on FUTEX && RT_MUTEXES
default y
+#
+# marked broken for performance reasons; gives us one more cycle to sort things out.
+#
config FUTEX_PRIVATE_HASH
bool
depends on FUTEX && !BASE_SMALL && MMU
+ depends on BROKEN
default y
config FUTEX_MPOL