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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CY4PR21MB077387C5E70FD9D96D00FE62D7CF0@CY4PR21MB0773.namprd21.prod.outlook.com>
Date:   Fri, 2 Nov 2018 17:37:43 +0000
From:   Michael Kelley <mikelley@...rosoft.com>
To:     Long Li <longli@...rosoft.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] genirq/affinity: Spread IRQs to all available NUMA nodes

From: Long Li <longli@...rosoft.com>  Sent: Thursday, November 1, 2018 4:52 PM
> 
> --- a/kernel/irq/affinity.c
> +++ b/kernel/irq/affinity.c
> @@ -117,12 +117,13 @@ static int irq_build_affinity_masks(const struct irq_affinity *affd,
>  	 */
>  	if (numvecs <= nodes) {
>  		for_each_node_mask(n, nodemsk) {
> -			cpumask_copy(masks + curvec, node_to_cpumask[n]);
> -			if (++done == numvecs)
> -				break;
> +			cpumask_or(masks + curvec, masks + curvec, node_to_cpumask[n]);
> +			done++;
>  			if (++curvec == last_affv)
>  				curvec = affd->pre_vectors;
>  		}

When the above for loop is exited, 'done' will always be equal to 'nodes' since
there are no early exits from the loop.  Hence there's no need to be
incrementing 'done' in the loop. 

> +		if (done > numvecs)
> +			done = numvecs;

And if 'done' would always be equal to 'nodes', there is no need for the test.
Just always set 'done' to 'numvecs'.

>  		goto out;
>  	}
> 
> --
> 2.14.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ