linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Kelley <mikelley@microsoft.com>
To: Long Li <longli@microsoft.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] genirq/affinity: Spread IRQs to all available NUMA nodes
Date: Fri, 2 Nov 2018 17:37:43 +0000	[thread overview]
Message-ID: <CY4PR21MB077387C5E70FD9D96D00FE62D7CF0@CY4PR21MB0773.namprd21.prod.outlook.com> (raw)
In-Reply-To: <20181101235157.27607-1-longli@linuxonhyperv.com>

From: Long Li <longli@microsoft.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

  reply	other threads:[~2018-11-02 17:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-01 23:51 [PATCH] genirq/affinity: Spread IRQs to all available NUMA nodes Long Li
2018-11-02 17:37 ` Michael Kelley [this message]
2018-11-02 17:53   ` Long Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CY4PR21MB077387C5E70FD9D96D00FE62D7CF0@CY4PR21MB0773.namprd21.prod.outlook.com \
    --to=mikelley@microsoft.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longli@microsoft.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).