From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Ehab Ababneh <ehab.ababneh@intel.com>
Cc: Hans de Goede <hansg@kernel.org>,
tony.luck@intel.com, Peter Zijlstra <peterz@infradead.org>,
Thomas Gleixner <tglx@kernel.org>,
Ingo Molnar <mingo@redhat.com>,
ashok.raj.linux@gmail.com, platform-driver-x86@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org,
hpa@zytor.com, rostedt@goodmis.org, mhiramat@kernel.org,
mathieu.desnoyers@efficios.com,
linux-trace-kernel@vger.kernel.org,
sathyanarayanan.kuppuswamy@linux.intel.com,
pengfei.xu@intel.com, ravi.v.shankar@intel.com
Subject: Re: [PATCH v2 07/17] stop_machine: Add stop_cluster_cpuslocked() for per-cluster operations
Date: Thu, 19 Nov 2026 13:28:50 +0200 (EET) [thread overview]
Message-ID: <61f51eda-ed44-0f0a-86b8-522134896d17@linux.intel.com> (raw)
In-Reply-To: <20261118193259.519568-8-ehab.ababneh@intel.com>
On Wed, 18 Nov 2026, Ehab Ababneh wrote:
> From: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
>
> There is already stop_core_cpuslocked() for hardware core-level testing
Please rewrite this paragraph, as is it starts at middle of nowhere so it
won't connect to anything.
Do not depend on shortlog in the changelog body, the body should be 100%
readable on its own.
> features, which requires near-simultaneous execution of the WRMSR
> instruction on all threads of a core to initiate a test. However, some
> hardware requires this simultaneous execution of WRMSR at the cluster
> level.
Something along the lines of:
stop_core_cpuslocked() is limited in performing simultaneous execution of
WRMSR on all threads of a core. However, ...
That will immediately tell the reader there's a limitation and why the
limitation has to be removed.
I'm not sure if "for hardware core-level testing features" is that
necessary at all (perhaps that's from LLM that wanted to describe
unnecessary details like it usually does).
"some hardware" is vague, please be precise.
> Add stop_cluster_cpuslocked(), a customized version of
> stop_machine_cpuslocked() for operating solely on the threads of a
> single cluster.
>
> Suggested-by: Tony Luck <tony.luck@intel.com>
> Signed-off-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>
> Signed-off-by: Ehab Ababneh <ehab.ababneh@intel.com>
> Tested-by: Yi Lai <yi1.lai@intel.com>
> ---
> include/linux/stop_machine.h | 15 +++++++++++++++
> kernel/stop_machine.c | 35 ++++++++++++++++++++++-------------
> 2 files changed, 37 insertions(+), 13 deletions(-)
>
> diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h
> index 84e7fb627ba4..a189f405a4f2 100644
> --- a/include/linux/stop_machine.h
> +++ b/include/linux/stop_machine.h
> @@ -157,6 +157,21 @@ int stop_machine_cpuslocked(cpu_stop_fn_t fn, void *data, const struct cpumask *
> */
> int stop_core_cpuslocked(unsigned int cpu, cpu_stop_fn_t fn, void *data);
>
> +/**
> + * stop_cluster_cpuslocked: - stop all threads on a CPU cluster
Extra :
> + * @cpu: any CPU in the targeted cluster
> + * @fn: the function to run
> + * @data: the data ptr for @fn()
> + *
> + * Same as above, only the CPUs associated with a single CPU cluster are affected.
> + *
> + * Context: Must be called from within a cpus_read_lock() protected region.
> + *
> + * Return: 0 if all executions of @fn returned 0, any non zero return
> + * value if any returned non zero.
> + */
> +int stop_cluster_cpuslocked(unsigned int cpu, cpu_stop_fn_t fn, void *data);
> +
> int stop_machine_from_inactive_cpu(cpu_stop_fn_t fn, void *data,
> const struct cpumask *cpus);
> #else /* CONFIG_SMP || CONFIG_HOTPLUG_CPU */
> diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c
> index d085ba1f4b44..1afda0ddfb90 100644
> --- a/kernel/stop_machine.c
> +++ b/kernel/stop_machine.c
> @@ -630,32 +630,41 @@ int stop_machine(cpu_stop_fn_t fn, void *data, const struct cpumask *cpus)
> }
> EXPORT_SYMBOL_GPL(stop_machine);
>
> -#ifdef CONFIG_SCHED_SMT
> -/*
> - * INTEL_IFS is the only user of this API. That selftest can
> - * only be compiled if SMP=y. On x86 it selects SCHED_SMT.
> - * Keep the ifdefs for now.
> - */
> -int stop_core_cpuslocked(unsigned int cpu, cpu_stop_fn_t fn, void *data)
> +static int stop_cpus_cpuslocked(const struct cpumask *cpus, cpu_stop_fn_t fn, void *data)
> {
> - const struct cpumask *smt_mask = cpu_smt_mask(cpu);
> -
> struct multi_stop_data msdata = {
> .fn = fn,
> .data = data,
> - .num_threads = cpumask_weight(smt_mask),
> - .active_cpus = smt_mask,
> + .num_threads = cpumask_weight(cpus),
> + .active_cpus = cpus,
> };
>
> lockdep_assert_cpus_held();
>
> - /* Set the initial state and stop all online cpus. */
> + /* Set the initial state and stop all online @cpus. */
> set_state(&msdata, MULTI_STOP_PREPARE);
> - return stop_cpus(smt_mask, multi_cpu_stop, &msdata);
> + return stop_cpus(cpus, multi_cpu_stop, &msdata);
> +}
> +
> +#ifdef CONFIG_SCHED_SMT
> +/*
> + * INTEL_IFS is the only user of this API. That selftest can
> + * only be compiled if SMP=y. On x86 it selects SCHED_SMT.
> + * Keep the ifdefs for now.
> + */
> +int stop_core_cpuslocked(unsigned int cpu, cpu_stop_fn_t fn, void *data)
> +{
> + return stop_cpus_cpuslocked(cpu_smt_mask(cpu), fn, data);
> }
> EXPORT_SYMBOL_GPL(stop_core_cpuslocked);
> #endif
>
> +int stop_cluster_cpuslocked(unsigned int cpu, cpu_stop_fn_t fn, void *data)
> +{
> + return stop_cpus_cpuslocked(topology_cluster_cpumask(cpu), fn, data);
> +}
> +EXPORT_SYMBOL_GPL(stop_cluster_cpuslocked);
> +
> /**
> * stop_machine_from_inactive_cpu - stop_machine() from inactive CPU
> * @fn: the function to run
>
--
i.
next prev parent reply other threads:[~2026-11-19 11:29 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 19:32 [PATCH v2 00/17] platform/x86/intel/ifs: Support group-based In-Field Scan and Diamond Rapids Ehab Ababneh
2026-11-18 19:32 ` [PATCH v2 01/17] platform/x86/intel/ifs: Revert SBAF feature Ehab Ababneh
2026-11-18 19:32 ` [PATCH v2 02/17] platform/x86/intel/ifs: Fix IFS sysfs interfaces in the comments Ehab Ababneh
2026-11-18 19:32 ` [PATCH v2 03/17] platform/x86/intel/ifs: Clarify In-Field Scan MSR bit macro definitions Ehab Ababneh
2026-11-18 19:32 ` [PATCH v2 04/17] platform/x86/intel/ifs: Use u64 to define the bits of IFS MSR registers Ehab Ababneh
2026-11-18 19:32 ` [PATCH v2 05/17] platform/x86/intel/ifs: Early return on the IFS image hash/chunk error Ehab Ababneh
2026-11-18 19:32 ` [PATCH v2 06/17] platform/x86/intel/ifs: Refactor Array BIST function interface Ehab Ababneh
2026-11-18 19:32 ` [PATCH v2 07/17] stop_machine: Add stop_cluster_cpuslocked() for per-cluster operations Ehab Ababneh
2026-11-19 11:28 ` Ilpo Järvinen [this message]
2026-11-18 19:32 ` [PATCH v2 08/17] platform/x86/intel/ifs: Enumerate the bit to determine if CPUs need to join for IFS tests Ehab Ababneh
2026-11-18 19:32 ` [PATCH v2 09/17] platform/x86/intel/ifs: Select CPUs from topology_cluster_cpumask() for simultaneous " Ehab Ababneh
2026-11-19 11:38 ` Ilpo Järvinen
2026-11-18 19:32 ` [PATCH v2 10/17] platform/x86/intel/ifs: Warn if a group test fails with CPUs missing Ehab Ababneh
2026-11-19 11:42 ` Ilpo Järvinen
2026-11-18 19:32 ` [PATCH v2 11/17] platform/x86/intel/ifs: Track and report scan results on a per-CPU basis Ehab Ababneh
2026-11-19 12:00 ` Ilpo Järvinen
2026-11-18 19:32 ` [PATCH v2 12/17] platform/x86/intel/ifs: Add new sysfs interfaces {status, details, cpus_ran}_list Ehab Ababneh
2026-11-19 12:06 ` Ilpo Järvinen
2026-11-18 19:32 ` [PATCH v2 13/17] platform/x86/intel/ifs: Add additional details sysfs interface Ehab Ababneh
2026-11-18 19:32 ` [PATCH v2 14/17] platform/x86/intel/ifs: Add Intel Diamond Rapids server support Ehab Ababneh
2026-11-18 19:32 ` [PATCH v2 15/17] platform/x86/intel/ifs: Remove limit on number of batch files Ehab Ababneh
2026-11-19 12:09 ` Ilpo Järvinen
2026-11-18 19:32 ` [PATCH v2 16/17] platform/x86/intel/ifs: Update IFS documentation Ehab Ababneh
2026-11-19 12:12 ` Ilpo Järvinen
2026-11-18 19:32 ` [PATCH v2 17/17] Documentation/ABI: Update IFS ABI doc Ehab Ababneh
2026-11-19 12:13 ` Ilpo Järvinen
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=61f51eda-ed44-0f0a-86b8-522134896d17@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=ashok.raj.linux@gmail.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=ehab.ababneh@intel.com \
--cc=hansg@kernel.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=mingo@redhat.com \
--cc=pengfei.xu@intel.com \
--cc=peterz@infradead.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=ravi.v.shankar@intel.com \
--cc=rostedt@goodmis.org \
--cc=sathyanarayanan.kuppuswamy@linux.intel.com \
--cc=tglx@kernel.org \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
/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
all inboxes | Powered by JetHome®