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 7F7D063CB for ; Tue, 3 Mar 2026 14:46:12 +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=1772549174; cv=none; b=hPXF6DmzVEAuCnEHD6Y2C6NT6LV5/LKqHFDm6yhyxikOvkKbHqxPxxmdm4F2bTSQpXwHI2sYxrwDicHOuFRV83WJzRGiGmDeYfeL39dqnV1sl1ZVx923DslUVgppfu0JJXUTgCx6955xdBINgFtpqBtoLxWAISmJvcKaRBEOlr8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772549174; c=relaxed/simple; bh=eYvTykERYivwNcD5/ZAs0gU5FUqJxffIWg7kwyiVD4o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GFBIln8AsjlZTdkh0FnBmqsFZRZUtm/mqk9VByY4hIu3eJwf9vzB2G2U0SVlRkr2pvmkSIziDDN0QFjL9fiK7oSNgBAJjDcdJN9lRf4sAnEOrcpvitA8LSUui8mdIO7VKQadkJJOu7vefSO4i1cANkQ+qe8b7Y+fhCnA4T+f8xA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=XEXfIS2S; 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=none 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="XEXfIS2S" 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=izv997Un+D0HBc9alZBW0tmWFJI47ApqXalRLHiIZYs=; b=XEXfIS2Suv5oHIGpxTuwggWmKr PrljfdzAYCM2Zu9gwAoROrH8dl7wGFhA4Mn3Y52BYcjl5Z/lMeMP8nu7fi8igb61xBjdWaxMhDcrz et+iPIzYl9YS1VZ5FZej/WsLDEH0+wQ3NEz3bokRQ081pW6XJTUnIQ58OLyS7dKJmtvPhkT6GK4pI w5qP2cqbCrQ/qe2CsmpKuvRL5bYBYCYAyAC+/np2JJKk0iq/KumB9rHC3SSHSqVXYBqcWLXbwQORo /C9JjSX2Teh4oaPhp2uW3udTDkdyCtg8TlhA7LV4+jJcBb4EroLnfm4pl5RiA8mefOZzLeyofUnah RBixH5jQ==; 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.98.2 #2 (Red Hat Linux)) id 1vxR0Z-0000000BfI4-1BB3; Tue, 03 Mar 2026 14:45:59 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id A07A6300462; Tue, 03 Mar 2026 15:45:58 +0100 (CET) Date: Tue, 3 Mar 2026 15:45:58 +0100 From: Peter Zijlstra To: Ingo Molnar Cc: x86@kernel.org, tglx@kernel.org, linux-kernel@vger.kernel.org, tim.c.chen@linux.intel.com, yu.c.chen@intel.com, kyle.meyer@hpe.com, vinicius.gomes@intel.com, brgerst@gmail.com, hpa@zytor.com, kprateek.nayak@amd.com, patryk.wlazlyn@linux.intel.com, rafael.j.wysocki@intel.com, russ.anderson@hpe.com, zhao1.liu@intel.com, tony.luck@intel.com, Zhang Rui Subject: Re: [PATCH v2 4/5] x86/topo: Fix SNC topology mess Message-ID: <20260303144558.GC3698720@noisy.programming.kicks-ass.net> References: <20260303105539.428037056@infradead.org> <20260303110100.238361290@infradead.org> 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: On Tue, Mar 03, 2026 at 12:59:46PM +0100, Ingo Molnar wrote: > > * Peter Zijlstra wrote: > > > +static u32 slit_cluster_package(int N) > > +{ > > + int u = topology_num_nodes_per_package(); > > + u32 pkg_id = ~0; > > + > > + for (int n = 0; n < u; n++) { > > + const struct cpumask *cpus = cpumask_of_node(N + n); > > + int cpu; > > + > > + for_each_cpu(cpu, cpus) { > > + u32 id = topology_logical_package_id(cpu); > > + if (pkg_id == ~0) > > + pkg_id = id; > > Nit: newline after the 'id' local variable definition. > > > + /* > > + * Off-trace cluster. > > + * > > + * Notably average out the symmetric pair of off-trace clusters to > > + * ensure the resulting SLIT table is symmetric. > > + */ > > + x = i - (i % u); > > + y = j - (j % u); > > AFAICS that's an open-coded rounddown() from : > > x = rounddown(i, u); > y = rounddown(j, u); > > right? Yeah, but I can never remember those 'helpers'. That is, if I have to spend time looking for them, they're a net negative to me. Same reason I'm most likely to write: (x + d - 1) / d, rather than, uhmmm, /me goes find.. DIV_ROUND_UP(). And while I did actually use that in this series, that's only because it was already in use at the exact spot I made a change, so I didn't have to go looking. So sure, I can do the rounddown() thing, but really, its longer than the thing they replace and less clear, so where's the win?