summaryrefslogtreecommitdiff
path: root/Documentation/RCU/checklist.rst
diff options
context:
space:
mode:
authorToke Høiland-Jørgensen <toke@redhat.com>2021-06-24 19:05:53 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2021-06-24 20:41:14 +0300
commite74c74f9e51deb725e72d129084ba8252d47222d (patch)
tree7d52ec628c6aa39a9123dd851a85479298bca25d /Documentation/RCU/checklist.rst
parent9a145c04a293933002ec288a4d6b4f370b59e4d1 (diff)
downloadlinux-e74c74f9e51deb725e72d129084ba8252d47222d.tar.xz
doc: Give XDP as example of non-obvious RCU reader/updater pairing
This commit gives an example of non-obvious RCU reader/updater pairing in the guise of the XDP feature in networking, which calls BPF programs from network-driver NAPI (softirq) context. Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Link: https://lore.kernel.org/bpf/20210624160609.292325-4-toke@redhat.com
Diffstat (limited to 'Documentation/RCU/checklist.rst')
-rw-r--r--Documentation/RCU/checklist.rst11
1 files changed, 9 insertions, 2 deletions
diff --git a/Documentation/RCU/checklist.rst b/Documentation/RCU/checklist.rst
index 07f6cb8f674d..01cc21f17f7b 100644
--- a/Documentation/RCU/checklist.rst
+++ b/Documentation/RCU/checklist.rst
@@ -236,8 +236,15 @@ over a rather long period of time, but improvements are always welcome!
Mixing things up will result in confusion and broken kernels, and
has even resulted in an exploitable security issue. Therefore,
- when using non-obvious pairs of primitives, commenting is of
- course a must.
+ when using non-obvious pairs of primitives, commenting is
+ of course a must. One example of non-obvious pairing is
+ the XDP feature in networking, which calls BPF programs from
+ network-driver NAPI (softirq) context. BPF relies heavily on RCU
+ protection for its data structures, but because the BPF program
+ invocation happens entirely within a single local_bh_disable()
+ section in a NAPI poll cycle, this usage is safe. The reason
+ that this usage is safe is that readers can use anything that
+ disables BH when updaters use call_rcu() or synchronize_rcu().
8. Although synchronize_rcu() is slower than is call_rcu(), it
usually results in simpler code. So, unless update performance is