Re: [PATCH] io_uring/napi: clear tracked NAPI entries on unregister
From: Jens Axboe
Date: Mon May 04 2026 - 01:10:16 EST
On Mon, 04 May 2026 01:56:10 +0800, Yufan Chen wrote:
> IORING_UNREGISTER_NAPI disables NAPI busy polling, but it currently
> leaves any previously tracked NAPI IDs on the ring context. The normal
> wait path only checks whether the list is empty before entering the busy
> poll helper, so an unregistered ring can still observe stale entries and
> run an unexpected busy poll pass.
>
> Make unregister switch the context to inactive and free the tracked
> entries. Do the same inactive transition while changing the tracking
> strategy, and recheck the expected tracking mode under napi_lock before
> inserting a newly learned NAPI ID. This prevents a racing poll path from
> repopulating the list after unregister or reconfiguration.
>
> [...]
Applied, thanks!
[1/1] io_uring/napi: clear tracked NAPI entries on unregister
commit: 2c9cbd7dbde2462dd3d91f7a24eac2d142aa4cf0
Best regards,
--
Jens Axboe