mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Li kunyu <likunyu@open-hieco.net>
Cc: mingo@redhat.com, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
	vschneid@redhat.com, kprateek.nayak@amd.com,
	linux-kernel@vger.kernel.org,
	"Li Wang (Hieco)" <li.wang@linux.dev>
Subject: Re: [RFC PATCH 4/6] sched/fair: Restrict newidle balance to LLC domain
Date: Wed, 21 Oct 2026 14:42:18 +0200	[thread overview]
Message-ID: <20261021124218.GJ2823843@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20261020083746.37068-5-likunyu@open-hieco.net>

On Tue, Oct 20, 2026 at 04:37:44PM +0800, Li kunyu wrote:

> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 6e2271484c86..f2bf4b53d8a9 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -14983,6 +14983,24 @@ static inline bool nohz_idle_balance(struct rq *this_rq, enum cpu_idle_type idle
>  static inline void nohz_newidle_balance(struct rq *this_rq) { }
>  #endif /* !CONFIG_NO_HZ_COMMON */
>  
> +/*
> + * is_smt_buddy_newidle_constrain - After enabling the smt_buddy_assist
> + *                                  feature, check whether the current
> + *                                  scheduling domain meets the conditions
> + *                                  for skipping statistics.
> + * @sd: The current scheduling domain that is to be traversed.
> + */
> +static bool is_smt_buddy_newidle_constrain(struct sched_domain *sd)
> +{
> +	if (!sched_feat(SMT_BUDDY_ASSIST))
> +		return false;
> +
> +	if (sd->flags & SD_NUMA)
> +		return true;
> +
> +	return false;
> +}
> +
>  /*
>   * sched_balance_newidle is called by schedule() if this_cpu is about to become
>   * idle. Attempts to pull tasks from other CPUs.
> @@ -15080,7 +15098,8 @@ static int sched_balance_newidle(struct rq *this_rq, struct rq_flags *rf)
>  				weight = (1024 + weight/2) / weight;
>  			}
>  
> -			pulled_task = sched_balance_rq(this_cpu, this_rq,
> +			if (!is_smt_buddy_newidle_constrain(sd))
> +				pulled_task = sched_balance_rq(this_cpu, this_rq,
>  						   sd, CPU_NEWLY_IDLE,
>  						   &continue_balancing,
>  							false);

You could have just fiddled with SD_BALANCE_NEWIDLE, no? But instead you
went and did something inscrutable and violated coding style *again*.
Any multi-line block must have {} on.

  reply	other threads:[~2026-10-21 12:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-20  8:37 [RFC PATCH 0/6] sched/fair: Introduce the SMT_BUDDY_ASSIST feature Li kunyu
2026-10-20  8:37 ` [RFC PATCH 1/6] sched/fair: Add SMT sibling push in periodic load balance Li kunyu
2026-10-21 12:34   ` Peter Zijlstra
2026-10-20  8:37 ` [RFC PATCH 2/6] sched/fair: Add is_smt_buddy_run() to skip SMT domain Li kunyu
2026-10-21 12:35   ` Peter Zijlstra
2026-10-20  8:37 ` [RFC PATCH 3/6] sched/fair: SMT sibling exclusion after successful push Li kunyu
2026-10-21 12:39   ` Peter Zijlstra
2026-10-20  8:37 ` [RFC PATCH 4/6] sched/fair: Restrict newidle balance to LLC domain Li kunyu
2026-10-21 12:42   ` Peter Zijlstra [this message]
2026-10-20  8:37 ` [RFC PATCH 5/6] sched/fair: Add task burst threshold for large-scale bursts Li kunyu
2026-10-21 12:54   ` Peter Zijlstra
2026-10-20  8:37 ` [RFC PATCH 6/6] sched/docs: Add documentation for SMT Buddy Assist feature Li kunyu
2026-10-21 12:55   ` Peter Zijlstra
2026-10-21 12:44 ` [RFC PATCH 0/6] sched/fair: Introduce the SMT_BUDDY_ASSIST feature Kayra Cizmeci

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=20261021124218.GJ2823843@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=kprateek.nayak@amd.com \
    --cc=li.wang@linux.dev \
    --cc=likunyu@open-hieco.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.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®