Re: [PATCH v12 17/21] futex: Implement FUTEX2_MPOL
From: Peter Zijlstra
Date: Fri May 02 2025 - 14:46:22 EST
On Wed, Apr 16, 2025 at 06:29:17PM +0200, Sebastian Andrzej Siewior wrote:
> @@ -342,18 +411,20 @@ struct futex_hash_bucket *futex_hash(union futex_key *key)
> static struct futex_hash_bucket *
> __futex_hash(union futex_key *key, struct futex_private_hash *fph)
> {
> - struct futex_hash_bucket *hb;
> + int node = key->both.node;
> u32 hash;
> - int node;
>
> - hb = __futex_hash_private(key, fph);
> - if (hb)
> - return hb;
> + if (node == FUTEX_NO_NODE) {
> + struct futex_hash_bucket *hb;
> +
> + hb = __futex_hash_private(key, fph);
> + if (hb)
> + return hb;
> + }
>
> hash = jhash2((u32 *)key,
> offsetof(typeof(*key), both.offset) / sizeof(u32),
> key->both.offset);
> - node = key->both.node;
>
> if (node == FUTEX_NO_NODE) {
> /*
I *think* this hunk should've been in the previous patch; because it
changes the behaviour of FUTEX2_NUMA (to the better).
Anyway, nevermind, just wanted to point it out.