mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: K Prateek Nayak <kprateek.nayak@amd.com>
To: Hui Su <sh_def@163.com>, Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Juri Lelli <juri.lelli@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Steven Rostedt <rostedt@goodmis.org>,
	Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
	Valentin Schneider <vschneid@redhat.com>,
	Barry Song <baohua@kernel.org>,
	Tim Chen <tim.c.chen@linux.intel.com>,
	Chen Yu <yu.c.chen@intel.com>,
	Yicong Yang <yangyicong@hisilicon.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sched/topology: Balance cluster static-key updates
Date: Wed, 21 Oct 2026 09:25:50 +0530	[thread overview]
Message-ID: <62a7530f-ffe7-490e-8d0a-3bed170e24d3@amd.com> (raw)
In-Reply-To: <20261021034314.864713-1-sh_def@163.com>

Hello Hui,

On 10/21/2026 9:13 AM, Hui Su wrote:
> diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c
> index 3dab0253976fb..c9e10bfade6d0 100644
> --- a/kernel/sched/topology.c
> +++ b/kernel/sched/topology.c
> @@ -3314,12 +3314,22 @@ int __init sched_init_domains(const struct cpumask *cpu_map)
>  static void detach_destroy_domains(const struct cpumask *cpu_map)
>  {
>  	unsigned int cpu = cpumask_any(cpu_map);
> +	bool has_cluster = false;
>  	int i;
>  
>  	if (rcu_access_pointer(per_cpu(sd_asym_cpucapacity, cpu)))
>  		static_branch_dec_cpuslocked(&sched_asym_cpucapacity);
>  
> -	if (static_branch_unlikely(&sched_cluster_active))
> +	rcu_read_lock();
> +	for_each_cpu(i, cpu_map) {
> +		if (lowest_flag_domain(i, SD_CLUSTER)) {
> +			has_cluster = true;
> +			break;
> +		}
> +	}
> +	rcu_read_unlock();

nit.

This should be done only when sched_cluster_active is enabled to
avoid the extra loop on systems that don't have any cluster domain.

Apart from that, feel free to include:

Reviewed-by: K Prateek Nayak <kprateek.nayak@amd.com>

> +
> +	if (has_cluster)
>  		static_branch_dec_cpuslocked(&sched_cluster_active);
>  
>  	rcu_read_lock();

-- 
Thanks and Regards,
Prateek


  reply	other threads:[~2026-10-21  3:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-21  3:43 Hui Su
2026-10-21  3:55 ` K Prateek Nayak [this message]
2026-10-21  4:38   ` Hui Su

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=62a7530f-ffe7-490e-8d0a-3bed170e24d3@amd.com \
    --to=kprateek.nayak@amd.com \
    --cc=baohua@kernel.org \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sh_def@163.com \
    --cc=tim.c.chen@linux.intel.com \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    --cc=yangyicong@hisilicon.com \
    --cc=yu.c.chen@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

all inboxes | Powered by JetHome®