From: Jakub Kicinski <kuba@kernel.org>
To: Martin Karsten <mkarsten@uwaterloo.ca>
Cc: "Dragos Tatulea" <dtatulea@nvidia.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Paolo Abeni" <pabeni@redhat.com>,
"Simon Horman" <horms@kernel.org>,
"Daniel Borkmann" <daniel@iogearbox.net>,
"Björn Töpel" <bjorn@kernel.org>, "Gal Pressman" <gal@nvidia.com>,
"Tariq Toukan" <tariqt@nvidia.com>, "Joe Damato" <joe@dama.to>,
"Frederik Deweerdt" <fdeweerdt@fastly.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH net-next 1/2] net: napi: Fix interrupts permanently disabled during busy poll
Date: Tue, 28 Apr 2026 17:31:54 -0700 [thread overview]
Message-ID: <20260428173154.7b6864ef@kernel.org> (raw)
In-Reply-To: <4c45f423-ea41-4ae8-9cb0-7aca9157d8a4@uwaterloo.ca>
On Tue, 28 Apr 2026 20:04:13 -0400 Martin Karsten wrote:
> On 2026-04-28 19:40, Jakub Kicinski wrote:
> > On Tue, 28 Apr 2026 17:51:30 +0000 Dragos Tatulea wrote:
> >> Under certain conditions a queue can be left out with interrupts
> >> disabled and with the napi re-scheduling timer permanently stopped.
> >> This behaviour is triggered by the napi busy poll path when
> >> gro-flush-timeout and defer-hard-irq are set. Here's a sequence of
> >> operations:
> >>
> >> 1. Busy poll starts, NAPI_STATE_SCHED is set to avoid rescheduling napi
> >> from the timer.
> >>
> >> 2. During napi poll, driver disables interrupts due to being in poll
> >> mode (napi_complete_done() returns false because napi->state has
> >> NAPIF_STATE_IN_BUSY_POLL set).
> >
> > Why does the driver have IRQs disabled in busy poll?
>
> The problems occurs in irq deferral mode when both gro-flush-timeout and
> defer-hard-irqs are nonzero and NIC interrupts are disabled.
Okay.
> >> 3. At the end of the busy poll (busy_poll_stop()):
> >> 3.1 napi timer is scheduled and skip_schedule is set (due to config)
> >> 3.2 napi->poll() is called:
> >> - driver poll() processes exactly budget packets
> >> and exits early => napi not scheduled.
> >> (interrupts are still disabled at this point)
> >> 3.3 Since napi poll processed budget packets, __busy_poll_stop()
> >> is called with skip_schedule set => napi is not scheduled here
> >> either.
> >
> > with skip_schedule it calls:
> >
> > clear_bit(NAPI_STATE_SCHED, &napi->state);
> >
> >> 4. If the napi timer from 3.1 gets to be triggered due to slow napi poll
> >> or some other reason, the timer will run with no effect (due to
> >> NAPI_STATE_SCHED being set).
> >
> > And here you claim STATE_SCHED is still set?
>
> Labelling this with number 4. might be misleading, sorry! The concern is
> that a short enough timer (compared to the duration of the driver poll)
> can be triggered before the NAPI_STATE_SCHED bit is cleared at the end
> of Step 3.3.
Ah. Just say that :D Two pages of buggy text, y'all would have been
better off using this one paragraph as the commit message.
Please don't use AI for generating commit messages if that's the cause.
It really is spectacularly shit at it.
next prev parent reply other threads:[~2026-04-29 0:31 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-28 17:51 [RFC PATCH net-next 0/2] net: napi: Fix timer arming during busy poll timeout Dragos Tatulea
2026-04-28 17:51 ` [RFC PATCH net-next 1/2] net: napi: Fix interrupts permanently disabled during busy poll Dragos Tatulea
2026-04-28 23:40 ` Jakub Kicinski
2026-04-29 0:04 ` Martin Karsten
2026-04-29 0:31 ` Jakub Kicinski [this message]
2026-04-29 8:13 ` Dragos Tatulea
2026-04-29 22:52 ` Jakub Kicinski
2026-04-29 0:38 ` Jakub Kicinski
2026-04-29 8:43 ` Dragos Tatulea
2026-04-29 12:13 ` Björn Töpel
2026-04-29 12:43 ` Dragos Tatulea
2026-05-04 11:30 ` Dragos Tatulea
2026-05-05 1:00 ` Jakub Kicinski
2026-04-28 17:51 ` [RFC PATCH net-next 2/2] net: napi: Skip poll when arming GRO timer in " Dragos Tatulea
2026-04-29 0:37 ` Jakub Kicinski
2026-04-29 1:02 ` Martin Karsten
2026-04-29 12:37 ` Björn Töpel
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=20260428173154.7b6864ef@kernel.org \
--to=kuba@kernel.org \
--cc=bjorn@kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dtatulea@nvidia.com \
--cc=edumazet@google.com \
--cc=fdeweerdt@fastly.com \
--cc=gal@nvidia.com \
--cc=horms@kernel.org \
--cc=joe@dama.to \
--cc=linux-kernel@vger.kernel.org \
--cc=mkarsten@uwaterloo.ca \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=tariqt@nvidia.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