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: Wed, 31 Jan 2024 17:10:38 -0800
From: Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
To: alexs@...nel.org
Cc: Ingo Molnar <mingo@...hat.com>, Peter Zijlstra <peterz@...radead.org>,
	Juri Lelli <juri.lelli@...hat.com>,
	Vincent Guittot <vincent.guittot@...aro.org>,
	Dietmar Eggemann <dietmar.eggemann@....com>,
	Steven Rostedt <rostedt@...dmis.org>,
	Ben Segall <bsegall@...gle.com>,
	Daniel Bristot de Oliveira <bristot@...hat.com>,
	Valentin Schneider <vschneid@...hat.com>,
	linux-kernel@...r.kernel.org, sshegde@...ux.ibm.com
Subject: Re: [PATCH v2 6/6 RFT] sched/fair: change sched asym checking
 condition

On Tue, Jan 30, 2024 at 09:17:08PM +0800, alexs@...nel.org wrote:
> From: Alex Shi <alexs@...nel.org>
> 
> Asym only used on SMT sd, or core sd with ITMT and core idled.
> !sched_smt_active isn't necessary.

sched_smt_active() is implemented as a static key. Thus, if SMT is not
enabled, we can quickly return without having to check the rest of the
conditions, as we should.

> 
> Signed-off-by: Alex Shi <alexs@...nel.org>
> To: Ricardo Neri <ricardo.neri-calderon@...ux.intel.com>
> To: linux-kernel@...r.kernel.org
> To: Valentin Schneider <vschneid@...hat.com>
> To: Daniel Bristot de Oliveira <bristot@...hat.com>
> To: Ben Segall <bsegall@...gle.com>
> To: Steven Rostedt <rostedt@...dmis.org>
> To: Dietmar Eggemann <dietmar.eggemann@....com>
> To: Vincent Guittot <vincent.guittot@...aro.org>
> To: Juri Lelli <juri.lelli@...hat.com>
> To: Peter Zijlstra <peterz@...radead.org>
> To: Ingo Molnar <mingo@...hat.com>
> ---
>  kernel/sched/fair.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 6680cb39c787..0b7530b93429 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -9744,8 +9744,8 @@ static bool sched_use_asym_prio(struct sched_domain *sd, int cpu)
>  	if (!(sd->flags & SD_ASYM_PACKING))
>  		return false;
>  
> -	return (!sched_smt_active()) ||
> -		(sd->flags & SD_SHARE_CPUCAPACITY) || is_core_idle(cpu);
> +	return (sd->flags & SD_SHARE_CPUCAPACITY) ||
> +		(is_core_idle(cpu) && test_bit(cpu_core_flags(), (void *)&sd->flags));

cpu_core_flags() can contain more than one flag, AFAICS. Which bit should
it check? Moreover, it is implemented differently for each architecture.
Also, as stated, in x86 asym_packing is also used in domains other than MC.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ