lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <077e8b78-f526-497b-b651-50a4e4fbef5e@amd.com>
Date: Tue, 6 Jan 2026 14:11:57 +0530
From: K Prateek Nayak <kprateek.nayak@....com>
To: Chen Jinghuang <chenjinghuang2@...wei.com>, <mingo@...hat.com>,
	<peterz@...radead.org>, <juri.lelli@...hat.com>, <vincent.guittot@...aro.org>
CC: <dietmar.eggemann@....com>, <rostedt@...dmis.org>, <bsegall@...gle.com>,
	<mgorman@...e.de>, <vschneid@...hat.com>, <linux-kernel@...r.kernel.org>
Subject: Re: [RESEND] sched/rt: Skip currently executing CPU in rto_next_cpu()

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ