Skip to content

netconsole: replace target_list_lock by RCU on userdata hot path

Breno Leitao linux-kselftest lkml netdev 3 versions – Applied

Status from this message: This series was applied to netdev/net-next.git (main)

Get series with b4
b4 am [email protected] change-id 20260801-netcons-userdata-rcu-40446e018f86

Versions newest first

  1. v3 Latest2 patches 2 repliesApplied 2/2
  2. v22 patches 4 repliesSuperseded
  3. v12 patches 2 repliesSuperseded

Changes in v3 from the cover letter

- Rebased on top of net-next
- Link to v2: https://patch.msgid.link/[email protected]

Patches in v3 All 2 applied

#Subject and filesSizeRepliesApplied
1/2netconsole: publish the userdata payload with RCUdrivers/net/netconsole.c+56 -361 replyApplied
2/2selftests: netconsole: add a userdata torture testtools/testing/selftests/drivers/net/netconsole/Makefile tools/testing/selftests/drivers/net/netconsole/netcons_userdata.sh+230 -01 replyApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchGustavo Luiz Duarte
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH net-next v3 0/2] netconsole: replace target_list_lock by RCU on userdata hot path

I would like to move netconsole to use RCU on the hot path for a while instead of target_list_lock. My goal is to have no lock on the tx side at all and eventually drop CON_NBCON_ATOMIC_UNSAFE, if that is possible [1].

Start removing target_list_lock on certain parts of the code. This patch transforms the userdata array into a RCU-protected pointer, and uses the dynamic mutex as the write lock.

Added a selftest, given we didn't have any netconsole selftest for userdata operations. Feel free to drop it if this is not useful, dear maintainers.

---
Changes in v3:
- Rebased on top of net-next
- Link to v2: https://patch.msgid.link/[email protected]

Changes in v2:
- netconsole: free the payload with kfree(rcu_access_pointer()) in the
teardown paths, silencing a sparse __rcu warning (Gustavo Luiz Duarte)
- selftest: reap every torture worker before reporting a failure, so
none is left writing to configfs while the exit trap runs
- Link to v1: https://patch.msgid.link/[email protected]

---
Breno Leitao (2):
netconsole: publish the userdata payload with RCU
selftests: netconsole: add a userdata torture test

 drivers/net/netconsole.c                           |  92 +++++----
 .../selftests/drivers/net/netconsole/Makefile      |   1 +
 .../drivers/net/netconsole/netcons_userdata.sh     | 229 +++++++++++++++++++++
 3 files changed, 286 insertions(+), 36 deletions(-)

---
base-commit: 001b5d347d8ba39b2dccaefcc57967b18caec8fe
change-id: 20260801-netcons-userdata-rcu-40446e018f86

Best regards,

Signature · 1 line
Breno Leitao <[email protected]>