From: Thomas Gleixner <tglx@linutronix.de>
To: Angus Chen <angus.chen@jaguarmicro.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"Michael S. Tsirkin" <mst@redhat.com>,
Ming Lei <ming.lei@redhat.com>, Jason Wang <jasowang@redhat.com>
Subject: Re: IRQ affinity problem from virtio_blk
Date: Tue, 15 Nov 2022 23:19:47 +0100 [thread overview]
Message-ID: <87v8nfrhbw.ffs@tglx> (raw)
In-Reply-To: <TY2PR06MB3424CB11DB57CA1FAA16F10D85049@TY2PR06MB3424.apcprd06.prod.outlook.com>
On Tue, Nov 15 2022 at 03:40, Angus Chen wrote:
> Before probe one virtio_blk.
> crash_cts> p *vector_matrix
> $44 = {
> matrix_bits = 256,
> alloc_start = 32,
> alloc_end = 236,
> alloc_size = 204,
> global_available = 15354,
> global_reserved = 154,
> systembits_inalloc = 3,
> total_allocated = 411,
> online_maps = 80,
> maps = 0x46100,
> scratch_map = {1160908723191807, 0, 1, 18435222497520517120},
> system_map = {1125904739729407, 0, 1, 18435221191850459136}
> }
> After probe one virtio_blk.
> crash_cts> p *vector_matrix
> $45 = {
> matrix_bits = 256,
> alloc_start = 32,
> alloc_end = 236,
> alloc_size = 204,
> global_available = 15273,
> global_reserved = 154,
> systembits_inalloc = 3,
> total_allocated = 413,
> online_maps = 80,
> maps = 0x46100,
> scratch_map = {25769803776, 0, 0, 14680064},
> system_map = {1125904739729407, 0, 1, 18435221191850459136}
> }
>
> We can see global_available drop from 15354 to 15273, is 81.
> And the total_allocated increase from 411 to 413. One config irq,and
> one vq irq.
Right. That's perfectly fine. At the point where you looking at it, the
matrix allocator has given out 2 vectors as can be seen via
total_allocated.
But then it also has another 79 vectors put aside for the other queues,
but those queues have not yet requested the interrupts so there is no
allocation yet. But the vectors are guaranteed to be available when
request_irq() for those queues runs, which does the actual allocation.
Btw, you can enable CONFIG_GENERIC_IRQ_DEBUGFS and then look at the
content of /sys/kernel/debug/irq/domain/VECTOR which gives you a very
clear picture of what's going on. No need for gdb.
> It is easy to expend the irq resource ,because virtio_blk device could
> be more than 512.
How so? virtio_blk allocates a config interrupt and one queue interrupt
per CPU. So in your case a total of 81.
How would you exhaust the vector space? Each CPU has about ~200 (in your
case exactly 204) vectors which can be handed out to devices. You'd need
to instantiate about 200 virtio_blk devices to get to the point of
vector exhaustion.
So what are you actually worried about and which problem are you trying
to solve?
Thanks,
tglx
next prev parent reply other threads:[~2022-11-15 22:20 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-15 3:40 IRQ affinity problem from virtio_blk Angus Chen
2022-11-15 22:19 ` Thomas Gleixner [this message]
2022-11-15 22:44 ` Michael S. Tsirkin
2022-11-15 23:04 ` Thomas Gleixner
2022-11-15 23:24 ` Thomas Gleixner
2022-11-15 23:36 ` Michael S. Tsirkin
2022-11-16 1:02 ` Angus Chen
2022-11-16 10:55 ` Thomas Gleixner
2022-11-16 11:24 ` Angus Chen
2022-11-16 13:27 ` Thomas Gleixner
2022-11-16 10:43 ` Thomas Gleixner
2022-11-16 11:35 ` Ming Lei
2022-11-16 13:06 ` Thomas Gleixner
2022-11-16 0:46 ` Angus Chen
2022-11-16 10:54 ` Thomas Gleixner
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=87v8nfrhbw.ffs@tglx \
--to=tglx@linutronix.de \
--cc=angus.chen@jaguarmicro.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=ming.lei@redhat.com \
--cc=mst@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