Re: [PATCH v2] io_uring/napi: clean up list traversal with list_for_each_entry_safe()

From: Sebastian Andrzej Siewior

Date: Mon Nov 02 2026 - 14:05:10 EST


On 2026-10-29 20:17:45 [+0530], Anvik Loitongbam wrote:
> Switch both loops to the standard list_for_each_entry_safe() pattern and
> remove the explanatory comment.

I don't think this is useful as in clean-up or needed. The 'next'
pointer is pre-loaded with the next element but list_del_rcu() does not
destroy it (unlike list_del()). The spinlock_t holds off the grace
period. The item's next pointer needs to remain valid for a RCU
traversal that can happen.

The comment in __io_napi_remove_stale() explained the situation to
non-RCU fluent person. The list is not touched in io_napi_free() at all.

But okay, it is not a hot path…

> Signed-off-by: Anvik Loitongbam <permissiontogallop@xxxxxxxxx>

Sebastian