public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
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 <rui.zhang@intel.com>
Subject: Re: [PATCH v2 4/5] x86/topo: Fix SNC topology mess
Date: Tue, 3 Mar 2026 12:59:46 +0100	[thread overview]
Message-ID: <aabNMle4iUDt-elY@gmail.com> (raw)
In-Reply-To: <20260303110100.238361290@infradead.org>


* Peter Zijlstra <peterz@infradead.org> 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 <linux/math.h>:

	x = rounddown(i, u);
	y = rounddown(j, u);

right?

With these addressed:

	Reviewed-by: Ingo Molnar <mingo@kernel.org>

Thanks,

	Ingo

  reply	other threads:[~2026-03-03 11:59 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-03 10:55 [PATCH v2 0/5] x86/topo: SNC Divination Peter Zijlstra
2026-03-03 10:55 ` [PATCH v2 1/5] x86/numa: Store extra copy of numa_nodes_parsed Peter Zijlstra
2026-03-04 15:46   ` [tip: x86/urgent] " tip-bot2 for Peter Zijlstra
2026-03-03 10:55 ` [PATCH v2 2/5] x86/topo: Add topology_num_nodes_per_package() Peter Zijlstra
2026-03-04 15:46   ` [tip: x86/urgent] " tip-bot2 for Peter Zijlstra
2026-03-03 10:55 ` [PATCH v2 3/5] x86/topo: Replace x86_has_numa_in_package Peter Zijlstra
2026-03-04 15:46   ` [tip: x86/urgent] " tip-bot2 for Peter Zijlstra
2026-03-03 10:55 ` [PATCH v2 4/5] x86/topo: Fix SNC topology mess Peter Zijlstra
2026-03-03 11:59   ` Ingo Molnar [this message]
2026-03-03 14:45     ` Peter Zijlstra
2026-03-04 15:46   ` [tip: x86/urgent] " tip-bot2 for Peter Zijlstra
2026-03-03 10:55 ` [PATCH v2 5/5] x86/resctrl: Fix SNC detection Peter Zijlstra
2026-03-04 15:46   ` [tip: x86/urgent] " tip-bot2 for Tony Luck
2026-03-03 12:01 ` [PATCH v2 0/5] x86/topo: SNC Divination Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aabNMle4iUDt-elY@gmail.com \
    --to=mingo@kernel.org \
    --cc=brgerst@gmail.com \
    --cc=hpa@zytor.com \
    --cc=kprateek.nayak@amd.com \
    --cc=kyle.meyer@hpe.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=patryk.wlazlyn@linux.intel.com \
    --cc=peterz@infradead.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rui.zhang@intel.com \
    --cc=russ.anderson@hpe.com \
    --cc=tglx@kernel.org \
    --cc=tim.c.chen@linux.intel.com \
    --cc=tony.luck@intel.com \
    --cc=vinicius.gomes@intel.com \
    --cc=x86@kernel.org \
    --cc=yu.c.chen@intel.com \
    --cc=zhao1.liu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox