From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 34704C43602 for ; Wed, 1 Jul 2026 07:57:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=B4/JCmC97e1htahanr2z/GlnrhUE+evGN2C+qmByL10=; b=oTTTLXntbY3J7X dd0BsGmttbi2rsJ656GnJRyYRG+/fbhMJ9+oOnsiZEYlA+StBFuzi7uXWrC2ZihFxNtAp9spKaUo2 ObyZNnxhNAi8A8n3MWqRwPGdQpYfqg4NphH7G5E3TBXhItx/q/7tVApeXf9+gsdTg24vFWqGrAtsL KRbTTNW6IWGC/lEb1YFyLeDIYJvwpBeMZiQlBKIkX5shcJ5CYlNkIccLdp+EnrADIR9xWLUSnnL3H JRIurU4VMxt3iJK4FMBqg1GInE1Q4aEpcbQ4ZTNK2WGKCU4jeORL76hOzrU9Bprlvy5j4BwcE4DYC 8I6XKr+pozO5dhtv+YKQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1wepov-00000000yGK-2vX1; Wed, 01 Jul 2026 07:57:21 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1wepou-00000000yG4-0kgx; Wed, 01 Jul 2026 07:57:20 +0000 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=Y3bOd8rRJgZw0SFI6BSvsmTa5xtyQqK8il7r7D4IeLc=; b=wMVEkvpblBw2MJ7Lj/oZ7R/r+l FWtnVgNCCuGrBzahJ/0gKwq7BEhfJyozTvLxb4UW6tPDfLUASGNHU3AalDnhaOYgoRZX5S+YYiCeW B0hTn6saaoF2pD0kgGf1UcFszA9sad3AHA9Qjw4czU61n5bAEasZ2XQxclhvuuqno1vsEbxWnDQXf enk2gV8UJ5toEBZaORClRcNZAdSJ95ZQdGOt0+V+Ct6zuVDWFJMt3gSQyELiV2dN+JYBKm6eI4vV2 p+xcCSTX5hywYVEcSZlc1deNHi7U62qwsclG4chEQ3XnrtiB/XwMKLQEnqrZlSz2mZss9LnUogWHx 8DBmDRMQ==; 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 1wepoo-00000006G7w-2a6v; Wed, 01 Jul 2026 07:57:14 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 1815530035C; Wed, 01 Jul 2026 09:57:14 +0200 (CEST) Date: Wed, 1 Jul 2026 09:57:14 +0200 From: Peter Zijlstra To: K Prateek Nayak Cc: Arnd Bergmann , Thomas Gleixner , Ingo Molnar , Sebastian Andrzej Siewior , Borislav Petkov , Dave Hansen , x86@kernel.org, Catalin Marinas , Will Deacon , Paul Walmsley , Palmer Dabbelt , Albert Ou , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Darren Hart , Davidlohr Bueso , =?iso-8859-1?Q?Andr=E9?= Almeida , linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, Samuel Holland , Charlie Jenkins , linux-arm-kernel@lists.infradead.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, "H. Peter Anvin" , Thomas Huth , Sean Christopherson , Jisheng Zhang , Alexandre Ghiti , Christian Borntraeger , Sven Schnelle Subject: Re: [PATCH v5 8/8] futex: Use runtime constants for __futex_hash() hot path Message-ID: <20260701075714.GP48970@noisy.programming.kicks-ass.net> References: <20260630045531.3939-1-kprateek.nayak@amd.com> <20260630045531.3939-9-kprateek.nayak@amd.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20260630045531.3939-9-kprateek.nayak@amd.com> X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Tue, Jun 30, 2026 at 04:55:31AM +0000, K Prateek Nayak wrote: > From: Peter Zijlstra > > Runtime constify the read-only after init data __futex_shift(shift_32), > __futex_mask(mask_32), and __futex_queues(ptr) used in __futex_hash() > hot path to avoid referencing global variable. > > This also allows __futex_queues to be allocated dynamically to > "nr_node_ids" slots instead of reserving config dependent MAX_NUMNODES > (1 << CONFIG_NODES_SHIFT) worth of slots upfront. > > Runtime constants are initialized before their first access and > runtime_const_init() provides necessary barrier to ensure subsequent > accesses are not reordered against their initialization. > > No functional changes intended. > > [ prateek: Dynamically allocate __futex_queues, mark the global data > __ro_after_init since they are constified after futex_init(). ] > > Link: https://patch.msgid.link/20260227161841.GH606826@noisy.programming.kicks-ass.net > Reported-by: Sebastian Andrzej Siewior # MAX_NUMNODES bloat > Not-yet-signed-off-by: Peter Zijlstra > Signed-off-by: K Prateek Nayak The big $1M question: does it actually make it go faster? The whole point here was performance, right? But I'm not seeing numbers showing how awesome these patches are. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv