lkml.org 
[lkml]   [2018]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] genirq/affinity: Spread IRQs to all available NUMA nodes
Date
> Subject: RE: [PATCH] genirq/affinity: Spread IRQs to all available NUMA
> nodes
>
> 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'.

Thanks. I will fix this in v2.

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

\
 
 \ /
  Last update: 2018-11-02 18:54    [W:0.289 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site