From: ming.lei@redhat.com (Ming Lei)
Subject: [PATCH V3 1/3] genirq/affinity: Enhance warning check
Date: Wed, 14 Aug 2019 16:58:46 +0800 [thread overview]
Message-ID: <20190814085845.GA21802@ming.t460p> (raw)
In-Reply-To: <ac920ba3996d0feedc924045b54724ba5482e427.camel@intel.com>
On Tue, Aug 13, 2019@07:31:39PM +0000, Derrick, Jonathan wrote:
> Hi Ming,
>
> On Tue, 2019-08-13@16:14 +0800, Ming Lei wrote:
> > The two-stage spread is done on same irq vectors, and we just need that
> > either one stage covers all vector, not two stage work together to cover
> > all vectors.
> >
> > So enhance the warning check to make sure all vectors are spread.
> >
> > Cc: Christoph Hellwig <hch at lst.de>
> > Cc: Keith Busch <kbusch at kernel.org>
> > Cc: linux-nvme at lists.infradead.org,
> > Cc: Jon Derrick <jonathan.derrick at intel.com>
> > Cc: Jens Axboe <axboe at kernel.dk>
> > Fixes: 6da4b3ab9a6 ("genirq/affinity: Add support for allocating interrupt sets")
> > Signed-off-by: Ming Lei <ming.lei at redhat.com>
> > ---
> > kernel/irq/affinity.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/kernel/irq/affinity.c b/kernel/irq/affinity.c
> > index 6fef48033f96..265b3076f16b 100644
> > --- a/kernel/irq/affinity.c
> > +++ b/kernel/irq/affinity.c
> > @@ -215,8 +215,7 @@ static int irq_build_affinity_masks(unsigned int startvec, unsigned int numvecs,
> > npresmsk, nmsk, masks);
> > put_online_cpus();
> >
> > - if (nr_present < numvecs)
> > - WARN_ON(nr_present + nr_others < numvecs);
> > + WARN_ON(max(nr_present, nr_others) < numvecs);
>
> I think the patch description assumes the first condition
> "The two-stage spread is done on same irq vectors"
>
> /*
> * Spread on non present CPUs starting from the next vector to be
> * handled. If the spreading of present CPUs already exhausted the
> * vector space, assign the non present CPUs to the already spread
> * out vectors.
> */
> if (nr_present >= numvecs)
> curvec = firstvec;
>
> But doesn't following condition imply nr_others spread is potentionally
> different vector set?
>
> else
> curvec = firstvec + nr_present;
>
Most times, __irq_build_affinity_masks() returns numvecs.
However, each stage may expose less CPU number than num_vecs, then less
vectors than 'numvecs' can be spread.
So this patch is actually wrong.
Thank,
Ming
next prev parent reply other threads:[~2019-08-14 8:58 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-13 8:14 [PATCH V3 0/3] genriq/affinity: Make vectors allocation fair Ming Lei
2019-08-13 8:14 ` [PATCH V3 1/3] genirq/affinity: Enhance warning check Ming Lei
2019-08-13 19:31 ` Derrick, Jonathan
2019-08-14 8:58 ` Ming Lei [this message]
2019-08-13 8:14 ` [PATCH V3 2/3] genirq/affinity: Improve __irq_build_affinity_masks() Ming Lei
2019-08-13 8:14 ` [PATCH V3 3/3] genirq/affinity: Spread vectors on node according to nr_cpu ratio Ming Lei
2019-08-13 9:34 ` Daniel Wagner
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=20190814085845.GA21802@ming.t460p \
--to=ming.lei@redhat.com \
/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