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]
Date:   Fri, 8 Jan 2021 13:01:10 +0000
From:   Qais Yousef <qais.yousef@....com>
To:     Mel Gorman <mgorman@...hsingularity.net>
Cc:     Peter Zijlstra <peterz@...radead.org>,
        "Li, Aubrey" <aubrey.li@...ux.intel.com>,
        vincent.guittot@...aro.org, linux-kernel@...r.kernel.org,
        mingo@...hat.com, juri.lelli@...hat.com,
        valentin.schneider@....com, dietmar.eggemann@....com,
        rostedt@...dmis.org, bsegall@...gle.com,
        tim.c.chen@...ux.intel.com, benbjiang@...il.com
Subject: Re: [RFC][PATCH 1/5] sched/fair: Fix select_idle_cpu()s cost
 accounting

On 01/08/21 10:27, Mel Gorman wrote:
>  	for_each_cpu_wrap(cpu, cpus, target) {
> -		if (available_idle_cpu(cpu) || sched_idle_cpu(cpu))
> +		if (available_idle_cpu(cpu) || sched_idle_cpu(cpu)) {
> +			/* Adjust cost of a successful scan */
> +			loops <<= 2;
> +
>  			break;
> +		}
>  
> -		if (loops >= nr) {
> +		if (++loops >= nr) {
>  			cpu = -1;
>  			break;
>  		}
> -		loops++;

Random (out of the blue) comment.

Now this will increment loops before the comparison/break. ie: we're
effectively doing one iteration less IIRC. Should loops be initialized to
0 instead of 1?

Thanks

--
Qais Yousef

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ