public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: K Prateek Nayak <kprateek.nayak@amd.com>
To: Chen Jinghuang <chenjinghuang2@huawei.com>, <mingo@redhat.com>,
	<peterz@infradead.org>, <juri.lelli@redhat.com>,
	<vincent.guittot@linaro.org>
Cc: <dietmar.eggemann@arm.com>, <rostedt@goodmis.org>,
	<bsegall@google.com>, <mgorman@suse.de>, <vschneid@redhat.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [RESEND] sched/rt: Skip currently executing CPU in rto_next_cpu()
Date: Tue, 6 Jan 2026 14:11:57 +0530	[thread overview]
Message-ID: <077e8b78-f526-497b-b651-50a4e4fbef5e@amd.com> (raw)
In-Reply-To: <20260105034012.3196947-1-chenjinghuang2@huawei.com>

Hello Chen, Steve,

On 1/5/2026 9:10 AM, Chen Jinghuang wrote:
> @@ -2118,10 +2119,13 @@ static int rto_next_cpu(struct root_domain *rd)
>  	 */
>  	for (;;) {
>  
> -		/* When rto_cpu is -1 this acts like cpumask_first() */
> -		cpu = cpumask_next(rd->rto_cpu, rd->rto_mask);
> +		do {
> +			/* When rto_cpu is -1 this acts like cpumask_first() */
> +			cpu = cpumask_next(rd->rto_cpu, rd->rto_mask);
>  
> -		rd->rto_cpu = cpu;
> +			rd->rto_cpu = cpu;
> +			/* Do not send IPI to self */
> +		} while (cpu == this_cpu);

nit.

Since we are already within an infinite for-loop, can't we simply do:

    /* Do not send IPI to self */
    if (cpu == this_cpu)
        continue;

here and go evaluate cpumask_next() again instead of adding another
do-while? Was the nested loop intentional to highlight these bits
explicitly?

>  
>  		if (cpu < nr_cpu_ids)
>  			return cpu;

-- 
Thanks and Regards,
Prateek


  parent reply	other threads:[~2026-01-06  8:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-05  3:40 [RESEND] sched/rt: Skip currently executing CPU in rto_next_cpu() Chen Jinghuang
2026-01-05 21:25 ` Steven Rostedt
2026-01-06  8:41 ` K Prateek Nayak [this message]
2026-01-06 15:49   ` Steven Rostedt
  -- strict thread matches above, loose matches on Subject: below --
2026-01-15  6:13 Chen Jinghuang
2026-01-22  1:25 Chen Jinghuang
2026-01-23 10:06 ` Peter Zijlstra

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=077e8b78-f526-497b-b651-50a4e4fbef5e@amd.com \
    --to=kprateek.nayak@amd.com \
    --cc=bsegall@google.com \
    --cc=chenjinghuang2@huawei.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=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