From: Longjun Tang <lange_tang@163.com>
To: mst@redhat.com, jasowang@redhat.com, xuanzhuo@linux.alibaba.com,
edumazet@google.com
Cc: lange_tang@163.com, tanglongjun@kylinos.cn,
virtualization@lists.linux.dev
Subject: [PATCH 0/2] fix virtio_net/virtio when in busy-polling
Date: Tue, 31 Mar 2026 18:26:24 +0800 [thread overview]
Message-ID: <20260331102626.108962-1-lange_tang@163.com> (raw)
From: Longjun Tang <tanglongjun@kylinos.cn>
hi,
about this two patch:
1. virtio_net: disable cb when in busy-polling
When in a busy-polling context, it's possible to be in an enable cb
state,even though it doesn't need to be. This can lead to vring_interrupt
returning IRQ_NONE. so, This patch proactively disables the cb when
in busy_polling.
2. virtio_ring: return IRQ_HANDLED for stale interrupts when cb disabled
In the vring_interrupt, if the used ring is empty, IRQ_NONE is returned.
However,Sometimes, such as with busy-polling, buffers might be consumed
from the used ring before an stale interrupt notification arrives. it
leading to return IRQ_NONE.The kernel's spurious-IRQ detector counts
consecutive IRQ_NONE returnsand will permanently disable the interrupt
line if 99,900 out of 100,000 interrupts go unhandled. so, this patch
add is_cb_disabled() to virtqueue_ops and, when more_used() is false but
cb are suppressed, return IRQ_HANDLED instead of IRQ_NONE so the spurious
counter does not accumulate.
stale interrupts: the device posted this notification before it observed
the cb suppression;
Longjun Tang (2):
virtio_net: disable cb when in busy-polling
virtio_ring: return IRQ_HANDLED for stale interrupts when cb disabled
drivers/net/virtio_net.c | 3 +++
drivers/virtio/virtio_ring.c | 29 +++++++++++++++++++++++++++++
2 files changed, 32 insertions(+)
--
2.43.0
next reply other threads:[~2026-03-31 10:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-31 10:26 Longjun Tang [this message]
2026-03-31 10:26 ` [PATCH 1/2] virtio_net: disable cb when in busy-polling Longjun Tang
2026-04-03 2:57 ` Jason Wang
2026-04-07 7:02 ` Lange Tang
2026-03-31 10:26 ` [PATCH 2/2] virtio_ring: return IRQ_HANDLED for stale interrupts when cb disabled Longjun Tang
2026-04-03 2:55 ` Jason Wang
2026-04-07 7:28 ` Lange Tang
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=20260331102626.108962-1-lange_tang@163.com \
--to=lange_tang@163.com \
--cc=edumazet@google.com \
--cc=jasowang@redhat.com \
--cc=mst@redhat.com \
--cc=tanglongjun@kylinos.cn \
--cc=virtualization@lists.linux.dev \
--cc=xuanzhuo@linux.alibaba.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