From: Thomas Gleixner <tglx@linutronix.de>
To: Keith Busch <kbusch@kernel.org>, Christoph Hellwig <hch@lst.de>
Cc: santhosh kumar <santhu.linux@gmail.com>,
linux-kernel@vger.kernel.org, Ming Lei <ming.lei@redhat.com>,
x86@kernel.org
Subject: Re: [RFC] PCI_IRQ_AFFINITY limits MSI-X allocation on 384 CPU / 1000+ NVMe system
Date: Tue, 04 Aug 2026 23:27:04 +0200 [thread overview]
Message-ID: <871pcdfufr.ffs@fw13> (raw)
In-Reply-To: <anH9gUs2dT-A-khw@kbusch-mbp>
On Tue, Aug 04 2026 at 04:56, Keith Busch wrote:
> On Tue, Aug 04, 2026 at 04:10:23PM +0200, Christoph Hellwig wrote:
>> On Mon, Aug 03, 2026 at 05:43:59AM -1000, Keith Busch wrote:
>> > On Thu, Jul 30, 2026 at 09:44:21PM +0200, Thomas Gleixner wrote:
>> > > On Thu, Jul 30 2026 at 07:28, Keith Busch wrote:
>> > > > We can introduce a module parameter to throttle down the maximum number
>> > > > of IO queues to allocate per controller. I don't think the driver can
>> > > > automatically reason out what the correct number should be because it
>> > > > doesn't know how many devices it's going to see.
>> > >
>> > > I might be missing something here as usual, but the number of io queues
>> > > per controller does not affect that at all as I explained before.
>> >
>> > Oh, you did explain that. I skipped to the end as I had too many
>> > distractions last week. Sorry about that, and thanks for the
>> > re-explanation.
>> >
>> > I mistakenly was thinking the effective_affinity was the only hardware
>> > resource used. Back to the drawing board.
>>
>> But given that we don't use multiple tag_set by default this can't
>> be the issue of the reported unless they didnt report enabling
>> multiple tag sets.
>
> I believe the use of additional sets makes the problem worse, but I
> think we still have a problem even if we have only the one default set.
> This is the quote from Thomas that I'm reading into:
>
> "the per CPU vector consumption is always _one_ per set."
>
> So just the default set with only 1 NVMe IO queue managed IRQ will still
> consume 384 vectors for the reported system even though the effective
> affinity is pinned to 1 CPU.
Correct. We don't treat the one I/O queue case differently than the
multi I/O queue case.
We could come up with some less restrictive mechanism, but that would at
the end run into the vector limitation on hotplug/hibernate because you
can't fit more than ~200 vectors into the last online CPU.
OTOH. With 1000 devices which consume also one non-managed interrupt for
their management queues, i.e. a total of 1000, that's not going to work
anyway.
The restriction given by the x86 vector limitations when ignoring that
there might be network cards and other devices which consume interrupts
as well for the current managed model is:
nr_sets nr_nonmanaged device limit
1 1 200/2 = 100
2 1 200/3 = 66
Subtract the interrupts consumed by other devices and your number might
become significantly smaller.
FRED will lift that restriction in the non-foreseeable future, but until
then you can only create a mode which effectively prevents hotplug
either upfront or in the hotplug case (see below).
The spreading mechanism would be basically the same as for managed mode,
so you can spread out several queues per device and let the vector
allocation pick one CPU out of the provided mask, but without guarantees
that in the hotplug case there is a free vector on another online CPU
within the mask.
Right now there is no mechanism to figure this out, so
lapic_can_unplug_cpu() would have to walk the vectors, look at the
affinity mask in each 'light managed' descriptor and validate that _all_
of them can be moved within their masks to prevent hotplug if not. The
hackery needed for that will be disgusting at best.
The only simple case are devices with one I/O queue per set. There you
could just do what Santhosh did: make the interrupts not be managed
at all and hotplug will fail at some point when the still online CPUs do
not have the capacity to take over the ones of the outgoing CPU. That
needs no change and works already today. If you would use two sets with
one queue each that works too, but then hotplug will simply fail
earlier.
Thanks,
tglx
prev parent reply other threads:[~2026-08-04 21:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-28 6:42 [RFC] PCI_IRQ_AFFINITY limits MSI-X allocation on 384 CPU / 1000+ NVMe system santhosh kumar
2026-07-28 22:52 ` Thomas Gleixner
2026-07-29 6:29 ` santhosh kumar
2026-07-30 13:16 ` Thomas Gleixner
2026-07-30 13:28 ` Keith Busch
2026-07-30 19:44 ` Thomas Gleixner
2026-08-03 15:43 ` Keith Busch
2026-08-04 14:10 ` Christoph Hellwig
2026-08-04 14:56 ` Keith Busch
2026-08-04 21:27 ` Thomas Gleixner [this message]
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=871pcdfufr.ffs@fw13 \
--to=tglx@linutronix.de \
--cc=hch@lst.de \
--cc=kbusch@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=santhu.linux@gmail.com \
--cc=x86@kernel.org \
/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