From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from stravinsky.debian.org (stravinsky.debian.org [82.195.75.108]) (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 8BDA3411688 for ; Wed, 10 Jun 2026 13:56:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=82.195.75.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781099800; cv=none; b=IYNiaRQLdzpRW6GpHfsUmcvLXEffb9p/8n61081O72FPYDFesWmTHwDws+w8dAYaAloOTDSX0IPfG1jb97Xbi9XLP1HjGunKfoUTWpH9SO2P6KNOT91n3ZjN+nU9do/ERdQ5ehzywZKC4R6QRhKg8YO4DJrvov4t7IFYkakmsbQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781099800; c=relaxed/simple; bh=4UQFG7dkrzemwLf6qsmcaiTLMNYUAvt0dikwMIPZ/VA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WiTcl87gSP9sGqcxAmO+I2Fq/wCuNvrtOPlUN8jm/TYTx3buHyGkN6M2HRgjpiRb+YrHh1Cmwm7syA6KDiJ47lsh7DiAankLP5yH9ykP8f/Kua5u3eF8/mUHZaLnhVP1zq2pZhFAYeGR0vOb4l3ih/ZyN0hQajLZ8qsZb2vqPLI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=debian.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b=kziObxkZ; arc=none smtp.client-ip=82.195.75.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=debian.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=debian.org header.i=@debian.org header.b="kziObxkZ" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; s=smtpauto.stravinsky; h=X-Debian-User:In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=fJBkwjAl36ZFk5407cqh2Mc6FY9F91Q8qwnO20so2g0=; b=kziObxkZcg1aYhpdIDRkskfaGf 7rKTY4CR59HJZKeCgV/dD/nZ7wiJ11dK05kmO/XyjcmsBHvpCeAbVbDy5qVSNsgqaZIxrFYtg5cpK xuKD9H0jEhAZ4sk9zJuoeppA6+ctNFrAToWBcGNLpzwnmAQU2EQc8jJKnVwP+pV3Nldmwu3LG/mwI Z5sJzPz5u1dqt/c5lrRdInj9uxDYM/kV0oxS9xzyNCcQhnBjJh/u5XaYKcv/twVtNY/9PpyaJVL3e ddkjf1PwNHzNObN9Fl/IFzWI9trjxk3sPy+p6nIKtlAlb53TZ/nCakkCJfT9bycGA0YuXAUTLFFfp I5rCp8tw==; Received: from authenticated-user by stravinsky.debian.org with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1wXJPl-009EjR-1J; Wed, 10 Jun 2026 13:56:17 +0000 Date: Wed, 10 Jun 2026 06:56:12 -0700 From: Breno Leitao To: Peter Zijlstra Cc: Thomas Gleixner , Ingo Molnar , Darren Hart , Davidlohr Bueso , =?utf-8?B?QW5kcsOp?= 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: References: <20260605-futex-v1-1-4ad4a0d6f265@debian.org> <20260609104603.GA48970@noisy.programming.kicks-ass.net> <20260609201117.GA187714@noisy.programming.kicks-ass.net> <20260609201809.GA1430057@noisy.programming.kicks-ass.net> <87h5na3ait.ffs@fw13> <20260610112546.GE187714@noisy.programming.kicks-ass.net> 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: <20260610112546.GE187714@noisy.programming.kicks-ass.net> X-Debian-User: leitao On Wed, Jun 10, 2026 at 01:25:46PM +0200, Peter Zijlstra wrote: > On Wed, Jun 10, 2026 at 01:22:34PM +0200, Thomas Gleixner wrote: > > On Tue, Jun 09 2026 at 22:18, Peter Zijlstra wrote: > > > On Tue, Jun 09, 2026 at 10:11:17PM +0200, Peter Zijlstra wrote: > > >> Anyway, how does something like the below work for you? It's a total > > >> hack job, but it (sorta) builds and runs. > > >> > > > > > > Please use this one, I spotted a silly bug. > > > > So I ran this on two machines. > > > > SKL dual socket 112 threads: > > > > Baseline Patched > > > > shared (16k) 1571857 1641435 + 4.4% > > autosize (512) 646390 903371 +39.7% > > -b 256 464395 587014 +26.4% > > -b 512 715687 995943 +39.2% > > -b 1024 995085 1396328 +40.3% > > -b 2048 1293114 1668395 +29.0% > > -b 4096 2124438 2240228 + 5.5% > > > > Zen3 dual socket 256 threads: > > > > Baseline Patched > > > > shared (16k) 1275840 1381279 + 8.2% > > autosize (512) 1252745 1482179 +18.3% > > -b 256 856274 955455 +11.5% > > -b 512 1267490 1544010 +21.8% > > -b 1024 1424013 1625424 +14.1% > > -b 2048 1505181 1669342 +10.9% > > -b 4096 1465993 1688932 +15.2% > > I suppose that means I'd better go make it prettier and survive > randconfig :-) I've Peter it here on the same machine I used earlier 176-thread AMD EPYC host, 10s perf bench futex hash per run, baseline = parent commit (acb7500801e98): Baseline Patched Delta shared (16 buckets) 1,230,599 1,368,655 +11.2% autosize (1024) 1,285,440 1,556,946 +21.1% -b 256 1,341,471 1,520,303 +13.3% -b 512 1,438,330 1,599,319 +11.2% -b 1024 1,443,772 1,622,493 +12.4% -b 2048 1,472,108 1,643,975 +11.7% -b 4096 1,333,098 1,570,897 +17.8% Stderr was 0.06%-0.22% across the board, so the deltas are well outside noise. The trade Peter sketched holds up here: no extra futex memory cost, and we still recover most of what padding the bucket would have bought. Really good, thanks for your this patch, --breno