Re: [PATCH] wifi: mt76: dma: run threaded NAPI kthreads with SCHED_FIFO low priority

From: David Laight

Date: Thu Oct 22 2026 - 05:46:19 EST


On Wed, 21 Oct 2026 17:25:53 +0300
Fil Dunsky <filipp.dunsky@xxxxxxxxx> wrote:

> Adding netdev to Cc, as suggested on the GitHub mirror of this patch [1],
> since it touches the scheduling policy of threaded NAPI kthreads.

I had to fix the same thing for other NAPI threads when doing some
tests that were receiving 'silly numbers' of RTP (aka very short UDP)
packets.

There is a similar problem with the softint threads.
Softint callbacks drop form being the very highest priority items
to things that really won't be run in a timely manner.

David

>
> For context on why this is done in the driver rather than left to the
> admin (chrt / sysfs): mt76 already does exactly this for its other
> rx/status and tx workers (sched_set_fifo_low() for the usb and sdio
> workers and for the tx worker), so the dma napi kthreads were the only
> mt76 rx path left at SCHED_OTHER. A userspace chrt also has to race
> the creation of the napi threads at boot and module reload.
>
> Numbers from the setup in the commit message (MT7621 + MT7612E as 5 GHz
> client, 3 runs x 5 min each, ~200-280 Mbit/s rx with userspace load):
>
> stock: ~500 full-ring events / 5 min, watchdog
> resets and MCU timeouts, occasional hard hang
> this patch: 0 resets in 3 runs, rx 276-288 Mbit/s
> stock + chrt -f 1: 0 resets in 3 runs, rx 249-273 Mbit/s
> napi_threaded=0: 0 resets
> rx ring 1024 (stock): 800-1300 full-ring events / run, more resets
>
> A similar restart pattern is reported on single-core MT7620 at much
> lower rates [2], which fits CPU contention rather than throughput as the
> trigger.
>
> [1] https://github.com/openwrt/mt76/pull/1164
> [2] https://github.com/openwrt/mt76/issues/457
>
> Thanks,
> Fil
>
>