Re: [PATCH net 3/3] selftests: net: test that RTM_GETLINK answers from the target netns

From: Chris Bannister

Date: Mon Nov 30 2026 - 19:12:15 EST


Thanks for the review. The points about the test are fair, and I will
send a v2.

> Could the fix this test depends on be named by its subject rather than
> as "1/3 and 2/3"?

Yes. The test needs "rtnetlink: look the device up under RTNL in full
rtnl_getlink() requests".

> Could the message say who produced these results?

AI tools that I directed did those 80 runs, in VMs on a test machine of
mine. I had not run the test when I posted it. I have now run it myself
in VMs: it fails without the fixes and passes with them.

> Is a 'D' state enough to show that the sender is on the rtnl_mutex
> wait list?

No. With a 50 ms sleep added before the lookup in a kernel without the
fixes, the test passed all 20 runs when it should have failed.

Checking wchan instead is not simple, because the function it shows
differs between kernels. It showed rtnl_setlink and rtnl_getlink,
rtnetlink_rcv_msg for the request before e896e5c0734b, and
rt_mutex_schedule with PREEMPT_RT. It never showed rtnl_lock or
__mutex_lock in the kernels tried.

> Should the test skip rather than fail in that case, so that fixing the
> RTNL stall doesn't make this selftest fail?

Yes, it should skip. On a kernel changed so that SIOCGIFCONF waits for
the page before taking RTNL, the test did not fail. It passed all 20
runs, because it mistook another sleep during the netns move for waiting
on RTNL.

> Would resolving the fault before the ASSERT fails keep a failing run
> from stalling RTNL for the whole machine?

Not by much, because a failed ASSERT ends the process, and that releases
the lock. The stall comes from the waiting before it, so that is what
needs a limit.

> Should there also be a request by name?

Yes. With only the lookup by name moved back before RTNL, the test still
passed all 20 runs.

AI tools that I directed also did the runs on changed kernels and with
PREEMPT_RT.

A question for the maintainers, following the one in the cover letter:
is this test worth keeping? It relies on SIOCGIFCONF holding RTNL while
it copies to user space, and checking the wait properly seems to need
more reliance on kernel internals. I can send a fixed 3/3, or only 1/3
and 2/3.

pw-bot: cr