Re: [PATCH net v2] net: yield the CPU on every exit of the threaded NAPI poll loop
From: Jakub Kicinski
Date: Wed Sep 02 2026 - 18:56:44 EST
On Wed, 2 Sep 2026 22:00:53 +0100 Vitaliy Sochnev wrote:
> On preemption, raised in v1: same board and load, unpatched, two halves
> differing only in that choice - worst "ip link del" 248.48 s with 8 stalls
> under PREEMPT_NONE against 0.39 s and none under PREEMPT_LAZY. So lazy
> preemption does hide the symptom, and PREEMPT_NONE and PREEMPT_VOLUNTARY
> builds are what is left. It is not the NAPI thread being preempted more -
> nonvoluntary_ctxt_switches on it is 4.6/s under LAZY against 13.9/s under
> PREEMPT_NONE - so that is a measurement, not a mechanism. The missing yield
> is there under either model.
>
> The loop is unchanged in Linus's tree - net/core/dev.c at v7.3-rc1 is
> identical here to net/main. The numbers come from 6.18 because that is the
> only kernel this board runs: mainline carries en7581-evb alone, while the
> SoC dtsi, the board DTS and the airoha_eth changes it needs are still out
> of tree. On 6.18 the loop has no busy_poll_last_qs parameter, but with that
> pointer NULL the two are the same code, so the change under test is this
> one. The busy-poll path is unaffected; cond_resched() was already reached
> there.
Rebase your OOT patches on latest and test the tree you're targeting
or keep this patch in your downstream kernel as well.