diff options
author | Paul E. McKenney <paulmck@kernel.org> | 2025-01-18 03:06:58 +0300 |
---|---|---|
committer | Boqun Feng <boqun.feng@gmail.com> | 2025-02-05 18:12:06 +0300 |
commit | f8b8df19b2dcb528e97395fdb74ca18b61db5207 (patch) | |
tree | 9ba59897c7599edb8e1025d1862688d62d0367f0 /tools/testing/selftests/bpf/prog_tests/autoload.c | |
parent | 729fb74889d94e6051d6ef2b21c769fe7e54f176 (diff) | |
download | linux-f8b8df19b2dcb528e97395fdb74ca18b61db5207.tar.xz |
srcu: Add srcu_down_read_fast() and srcu_up_read_fast()
A pair of matching srcu_read_lock_fast() and srcu_read_unlock_fast()
invocations must take place within the same context, for example, within
the same task. Otherwise, lockdep complains, as is the right thing to
do for most use cases.
However, there are use cases involving tracing (for example, uretprobes)
in which an SRCU reader needs to begin in one task and end in a
timer handler, which might interrupt some other task. This commit
therefore supplies the semaphore-like srcu_down_read_fast() and
srcu_up_read_fast() functions, which act like srcu_read_lock_fast() and
srcu_read_unlock_fast(), but permitting srcu_up_read_fast() to be invoked
in a different context than was the matching srcu_down_read_fast().
Neither srcu_down_read_fast() nor srcu_up_read_fast() may be invoked
from an NMI handler.
Reported-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Cc: Alexei Starovoitov <ast@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Kent Overstreet <kent.overstreet@linux.dev>
Cc: <bpf@vger.kernel.org>
Signed-off-by: Boqun Feng <boqun.feng@gmail.com>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/autoload.c')
0 files changed, 0 insertions, 0 deletions