From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 40A1E40D58D for ; Tue, 9 Jun 2026 20:25:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781036735; cv=none; b=M5hE7FImGCNb2OjxbKuTOtpXyeB6hKVMyz3V5JDs+VHT0IHAlq2kO5tjDLoKxjq70g8Gr+8VugYoAxgvR3kLgTqqSAkOtCmgplj/VaYvBzH4V2Xjmjhuv39pwLrCh5j35rCZDkEp+k0UGEuEvlAPSlrfN5KCcYkweu/xzI/YsHg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781036735; c=relaxed/simple; bh=mAlq1vtFlKQtQj7k7GBVMBxPssvJqVJhopzkegi3QTE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=D9fB47MqVyNzixO1Yq1cjdsIJ3S5D1uPCVqV5HoWCaTGqez82yyIF943ga4U0dkDQJWzXYB2FL1PtaqkoNp/RmDpnzr4c4lWGAxn+i4o9Ch7+4Aaf16deT8OR32EkYcBq5XevvL+IvGAqzRFMzWxKKvIu/o0QuN3iTHfEqRSryw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=pass smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=W/BnYZuc; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="W/BnYZuc" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ajcGWrXNusCqi5OF6PR2hj4brGJe42VX+Smkt1O+aME=; b=W/BnYZucztp+G9Yg7acvaORsId LeCFX3CmrWhbaxVgzQRuLU89zqYEy9IgEWH/2LmKQC5oeeb9XrLnHHJZRqZcOvu4zjH6Z0SQYAvrX kHgm6EUcxoHmhXLF4naWT/klpiNL0MVDn5OkFBSnUdPkgR1WHwwTgf9j6tj11CTqa6nlzJLRU6vzj qzSQdQT2uncfr0T7pm1qGVzGJCb77ZWRmKwJxkJwUPzHsM1Ow/9+ABAblgsHQVOHeCeiL4yTvfhva LiHUW7gyPlqvl33x0Whxx7XrcAkDnyjhLG4yBK6Jw5quZt99H0TwU78yf3iZ6bM9a3p7B0R/s0gO1 k3AAD+ug==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux)) id 1wX30q-0000000GL1K-0C4a; Tue, 09 Jun 2026 20:25:28 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 0048A302FEF; Tue, 09 Jun 2026 22:25:27 +0200 (CEST) Date: Tue, 9 Jun 2026 22:25:27 +0200 From: Peter Zijlstra To: Thomas Gleixner Cc: Breno Leitao , Ingo Molnar , Darren Hart , Davidlohr Bueso , =?iso-8859-1?Q?Andr=E9?= Almeida , linux-kernel@vger.kernel.org, puranjay@kernel.org, rmikey@meta.com, stuclar@meta.com, namhyung@kernel.org, kernel-team@meta.com Subject: Re: [PATCH RFC] futex: avoid false sharing between hb->chain and the bucket lock Message-ID: <20260609202527.GC187714@noisy.programming.kicks-ass.net> References: <20260605-futex-v1-1-4ad4a0d6f265@debian.org> <20260609104603.GA48970@noisy.programming.kicks-ass.net> <87mrx331wg.ffs@fw13> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87mrx331wg.ffs@fw13> On Tue, Jun 09, 2026 at 10:16:31PM +0200, Thomas Gleixner wrote: > @@ -301,13 +304,12 @@ struct futex_private_hash *futex_private > > struct futex_hash_bucket *futex_hash(union futex_key *key) > { > - struct futex_private_hash *fph; > + struct futex_private_hash *fph = NULL; > struct futex_hash_bucket *hb; > > again: > scoped_guard(rcu) { > - hb = __futex_hash(key, NULL); > - fph = hb->priv; > + hb = __futex_hash(key, &fph); > > if (!fph || futex_private_hash_get(fph)) > return hb; Also, same bug I had in my first patch, you need to re-set fph to NULL on the goto again :-)