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: <cf36ae81-c9a4-4a79-bd68-47ed1e6adab4@amd.com>
Date: Wed, 18 Dec 2024 11:51:00 +0530
From: K Prateek Nayak <kprateek.nayak@....com>
To: Chuyi Zhou <zhouchuyi@...edance.com>, <mingo@...hat.com>,
	<peterz@...radead.org>, <juri.lelli@...hat.com>,
	<vincent.guittot@...aro.org>, <dietmar.eggemann@....com>,
	<rostedt@...dmis.org>, <bsegall@...gle.com>, <mgorman@...e.de>,
	<vschneid@...hat.com>
CC: <chengming.zhou@...ux.dev>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/3] sched/fair: Ensure select housekeeping cpus in
 task_numa_find_cpu

Hello Chuyi,

On 12/16/2024 5:53 PM, Chuyi Zhou wrote:
> [..snip..]
> @@ -2081,6 +2081,12 @@ numa_type numa_classify(unsigned int imbalance_pct,
>   	return node_fully_busy;
>   }
>   
> +static inline bool numa_migrate_test_cpu(struct task_struct *p, int cpu)
> +{
> +	return cpumask_test_cpu(cpu, p->cpus_ptr) &&
> +			housekeeping_cpu(cpu, HK_TYPE_DOMAIN);
> +}
> +
>   #ifdef CONFIG_SCHED_SMT
>   /* Forward declarations of select_idle_sibling helpers */
>   static inline bool test_idle_cores(int cpu);
> @@ -2168,7 +2174,7 @@ static void task_numa_assign(struct task_numa_env *env,
>   		/* Find alternative idle CPU. */
>   		for_each_cpu_wrap(cpu, cpumask_of_node(env->dst_nid), start + 1) {

Can we just do:

	for_each_cpu_and(cpu, cpumask_of_node(env->dst_nid), housekeeping_cpumask(HK_TYPE_DOMAIN)) {
		...
	}

and avoid adding numa_migrate_test_cpu(). Thoughts?

>   			if (cpu == env->best_cpu || !idle_cpu(cpu) ||
> -			    !cpumask_test_cpu(cpu, env->p->cpus_ptr)) {
> +			    !numa_migrate_test_cpu(env->p, cpu)) {
>   				continue;
>   			}
>   
> @@ -2480,7 +2486,7 @@ static void task_numa_find_cpu(struct task_numa_env *env,
>   
>   	for_each_cpu(cpu, cpumask_of_node(env->dst_nid)) {

Same modifications can be made for this outer loop.

-- 
Thanks and Regards,
Prateek

>   		/* Skip this CPU if the source task cannot migrate */
> -		if (!cpumask_test_cpu(cpu, env->p->cpus_ptr))
> +		if (!numa_migrate_test_cpu(env->p, cpu))
>   			continue;
>   
>   		env->dst_cpu = cpu;



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ