The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@kernel.org>
To: Kyle Zeng <kylebot@openai.com>, kernel test robot <yi1.lai@intel.com>
Cc: oe-lkp@lists.linux.dev, lkp@intel.com,
	Lukas Maar <lukas.maar@tugraz.at>,
	linux-kernel@vger.kernel.org, mingo@redhat.com,
	outbounddisclosures@openai.com
Subject: Re: [PATCH v2] futex: Use a keyed hash for global futex buckets
Date: Sat, 05 Dec 2026 21:35:22 +0100	[thread overview]
Message-ID: <87qzfvlb3p.ffs@fw13> (raw)
In-Reply-To: <au4aHJEyPVADFf7L@com-75606>

On Fri, Nov 06 2026 at 10:19, Kyle Zeng wrote:
> On Thu, Nov 05, 2026 at 09:04:47AM +0800, kernel test robot wrote:
>>   0fcb05b723 ("Merge tag 'libcrypto-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux")
>>   c44a057178 ("[PATCH v2] futex: Use a keyed hash for global futex buckets")
>> 
>> 0fcb05b72344f408 c44a057178cbedbc04c63404258
>> ---------------- --------------------------- 
>>          %stddev     %change         %stddev
>>              \          |                \  
>>  7.026e+08            -6.0%  6.607e+08        will-it-scale.224.threads
>>    3136755            -6.0%    2949754        will-it-scale.per_thread_ops
>>  7.026e+08            -6.0%  6.607e+08        will-it-scale.workload
>
> I wonder what is the best way to run this above regression test and what

The answer is in the quoted text to which you replied to:

>> The kernel config and materials to reproduce are available at:
>> https://download.01.org/0day-ci/archive/20261105/202611050816.9e42490c-lkp@intel.com

No?

> will be an acceptable threshold for the patch to be merged.
> I'd like to iterate on the patch, fixing the issue while avoiding the
> the performance regression.

You might try the following:

futex_init()
{
	...
	get_random_bytes(&futex_hash_key, sizeof(futex_hash_key));
        ...
}

struct futex_hash_bucket **futex_queues(void)
{
        ...
	u32 hash_key = (*(u32 *)key) ^ futex_hash_key);
        
	hash = jhash2(&hask_key, offsetof(typeof(*key), both.offset) / sizeof(u32),
		      key->both.offset);
        ...
)

or something like that, which would remove the compile time constant
from the hash function while at the same time preserving the
performance.

I know that's not the same in a cryptographic sense, but it might be
sufficient to remove the initial threat you are looking at.

Because your proposed solution is also prone to the collision checking
approach because it's just a matter of effort to decode the extra
inconveniance of the boot time established siphash seed value, no?

Thanks,

        tglx


      reply	other threads:[~2026-12-05 20:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-06 22:24 [PATCH] futex: Use a keyed hash for global futex buckets Kyle Zeng
2026-10-19 18:33 ` [PATCH v2] " Kyle Zeng
2026-10-22 21:37   ` Thomas Gleixner
2026-11-05  1:04   ` kernel test robot
2026-11-06 18:19     ` Kyle Zeng
2026-12-05 20:35       ` Thomas Gleixner [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87qzfvlb3p.ffs@fw13 \
    --to=tglx@kernel.org \
    --cc=kylebot@openai.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=lukas.maar@tugraz.at \
    --cc=mingo@redhat.com \
    --cc=oe-lkp@lists.linux.dev \
    --cc=outbounddisclosures@openai.com \
    --cc=yi1.lai@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox