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:   Tue, 13 Jun 2017 16:10:29 -0400
From:   Tejun Heo <tj@...nel.org>
To:     Michael Bringmann <mwb@...ux.vnet.ibm.com>
Cc:     Lai Jiangshan <jiangshanlai@...il.com>,
        linux-kernel@...r.kernel.org,
        Nathan Fontenot <nfont@...ux.vnet.ibm.com>
Subject: Re: [PATCH] workqueue: Ensure that cpumask set for pools created
 after boot

Hello,

On Tue, Jun 13, 2017 at 03:04:30PM -0500, Michael Bringmann wrote:
> @@ -3564,19 +3564,28 @@ static struct pool_workqueue *alloc_unbound_pwq(struct workqueue_struct *wq,
>  static bool wq_calc_node_cpumask(const struct workqueue_attrs *attrs, int node,
>  				 int cpu_going_down, cpumask_t *cpumask)
>  {
> +	cpumask_t	onl_targ_cm;
> +
>  	if (!wq_numa_enabled || attrs->no_numa)
>  		goto use_dfl;
>  
>  	/* does @node have any online CPUs @attrs wants? */
> -	cpumask_and(cpumask, cpumask_of_node(node), attrs->cpumask);
> +	cpumask_and(&onl_targ_cm, cpumask_of_node(node), attrs->cpumask);
>  	if (cpu_going_down >= 0)
> -		cpumask_clear_cpu(cpu_going_down, cpumask);
> +		cpumask_clear_cpu(cpu_going_down, &onl_targ_cm);
>  
> -	if (cpumask_empty(cpumask))
> +	if (cpumask_empty(&onl_targ_cm))
>  		goto use_dfl;
>  
>  	/* yeap, return possible CPUs in @node that @attrs wants */
>  	cpumask_and(cpumask, attrs->cpumask, wq_numa_possible_cpumask[node]);
> +
> +	if (cpumask_weight(&onl_targ_cm) > cpumask_weight(cpumask)) {
> +		printk(KERN_INFO "WARNING: WQ cpumask: onl intersect > "
> +						"possible intersect\n");
> +		return false;
> +	}

Yeah, alternatively, we can just add right before returning,

	if (WARN_ON(cpumask_empty(cpumask)))
		return false;

Thanks.

-- 
tejun

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ