[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <MWHPR2101MB072985A6219256609C99190FCECF0@MWHPR2101MB0729.namprd21.prod.outlook.com>
Date: Fri, 2 Nov 2018 17:53:08 +0000
From: Long Li <longli@...rosoft.com>
To: Michael Kelley <mikelley@...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
> 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'.
Thanks. I will fix this in v2.
>
> > goto out;
> > }
> >
> > --
> > 2.14.1
Powered by blists - more mailing lists