diff options
| author | Breno Leitao <leitao@debian.org> | 2026-08-10 02:36:11 -0700 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2026-08-13 15:04:40 +0200 |
| commit | a9560343d4e9da962616110140afed20249f81c2 (patch) | |
| tree | ba63f5db01202435bf18d3ef41c318139e362ca7 /tools/perf/scripts/python/net_dropmonitor.py | |
| parent | 885a48b521b40aa515ad47f5581535b5763d105c (diff) | |
netconsole: publish the userdata payload with RCU
update_userdata() takes target_list_lock to swap nt->userdata and
nt->userdata_length, then frees the old buffer. Since commit
7eab73b18630 ("netconsole: convert to NBCON console infrastructure")
that lock is also the console's device_lock, so writing a userdata value
from configfs serialises against the printk core emitting messages.
The buffer is immutable once published, which is what RCU is for. Move
the string and its length into a single netcons_userdata object and
publish it with rcu_replace_pointer(), freeing the old one with
kfree_rcu().
New userdata design:
0) Unify the userdata fields into a struct netcons_userdata
1) update_userdata() no longer needs target_list_lock.
2) writers stay serialised by dynamic_netconsole_mutex.
3) reading userdata needs an RCU read lock.
No functional change intended.
Signed-off-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Gustavo Luiz Duarte <gustavold@gmail.com>
Link: https://patch.msgid.link/20260810-netcons-userdata-rcu-v3-1-f65557f769ce@debian.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'tools/perf/scripts/python/net_dropmonitor.py')
0 files changed, 0 insertions, 0 deletions
