From: Breno Leitao <leitao@debian.org>
To: Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Paolo Abeni <pabeni@redhat.com>, Shuah Khan <shuah@kernel.org>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org, gustavold@gmail.com,
asantostc@gmail.com, Breno Leitao <leitao@debian.org>,
kernel-team@meta.com
Subject: [PATCH net-next v2 0/2] netconsole: replace target_list_lock by RCU on userdata hot path
Date: Wed, 05 Aug 2026 03:58:18 -0700 [thread overview]
Message-ID: <20260805-netcons-userdata-rcu-v2-0-c5e80f6a7a46@debian.org> (raw)
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.
Link: https://lore.kernel.org/all/20251121-nbcon-v1-0-503d17b2b4af@debian.org/[1]
Signed-off-by: Breno Leitao <leitao@debian.org>
---
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/20260803-netcons-userdata-rcu-v1-0-1e5e6b62b75d@debian.org
---
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: 8ba098e6b6ff0db8edf28528d1552be261af30d4
change-id: 20260801-netcons-userdata-rcu-40446e018f86
Best regards,
--
Breno Leitao <leitao@debian.org>
next reply other threads:[~2026-08-05 10:59 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 10:58 Breno Leitao [this message]
2026-08-05 10:58 ` [PATCH net-next v2 1/2] netconsole: publish the userdata payload with RCU Breno Leitao
2026-08-05 14:22 ` Gustavo Luiz Duarte
2026-08-05 10:58 ` [PATCH net-next v2 2/2] selftests: netconsole: add a userdata torture test Breno Leitao
2026-08-05 14:22 ` Gustavo Luiz Duarte
2026-08-08 0:09 ` [PATCH net-next v2 0/2] netconsole: replace target_list_lock by RCU on userdata hot path Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260805-netcons-userdata-rcu-v2-0-c5e80f6a7a46@debian.org \
--to=leitao@debian.org \
--cc=andrew+netdev@lunn.ch \
--cc=asantostc@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gustavold@gmail.com \
--cc=kernel-team@meta.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).