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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Date:   Thu, 3 Dec 2020 10:36:14 -0500
From:   Tejun Heo <tj@...nel.org>
To:     Hillf Danton <hdanton@...a.com>
Cc:     NeilBrown <neilb@...e.de>, LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH] workqueue: cut wq_rr_cpu_last

Hello,

On Thu, Dec 03, 2020 at 06:28:41PM +0800, Hillf Danton wrote:
> +	new_cpu = cpumask_any_and_distribute(wq_unbound_cpumask, cpu_online_mask);
> +	if (new_cpu < nr_cpu_ids)
> +		return new_cpu;
> +	else
> +		return cpu;
>  }
>  
>  static void __queue_work(int cpu, struct workqueue_struct *wq,
> @@ -1554,7 +1546,7 @@ static int workqueue_select_cpu_near(int
>  		return cpu;
>  
>  	/* Use "random" otherwise know as "first" online CPU of node */
> -	cpu = cpumask_any_and(cpumask_of_node(node), cpu_online_mask);
> +	cpu = cpumask_any_and_distribute(cpumask_of_node(node), cpu_online_mask);

This looks generally okay but I think there's a real risk of different
cpumasks interfering with cpu selection. e.g. imagine a cpu issuing work
items to two unbound workqueues consecutively, one numa-bound, the other
not. The above change will basically confine the !numa one to the numa node.

I think the right thing to do here is expanding the
cpumask_any_and_distribute() so that the user can provide its own cursor
similar to what we do with ratelimits.

Thanks.

-- 
tejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ