diff options
author | Andrii Nakryiko <andrii@kernel.org> | 2025-04-04 12:48:48 -0700 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2025-04-07 20:15:16 +0200 |
commit | 0cd575cab10e114e95921321f069a08d45bc412e (patch) | |
tree | 868c6e2f12a7397ddfb4d9c76152108e4da2712d /rust/helpers/workqueue.c | |
parent | 0ba3a4ab76fd3367b9cb680cad70182c896c795c (diff) | |
download | linux-0cd575cab10e114e95921321f069a08d45bc412e.tar.gz linux-0cd575cab10e114e95921321f069a08d45bc412e.tar.bz2 linux-0cd575cab10e114e95921321f069a08d45bc412e.zip |
uprobes: Avoid false-positive lockdep splat on CONFIG_PREEMPT_RT=y in the ri_timer() uprobe timer callback, use raw_write_seqcount_*()
Avoid a false-positive lockdep warning in the CONFIG_PREEMPT_RT=y
configuration when using write_seqcount_begin() in the uprobe timer
callback by using raw_write_* APIs.
Uprobe's use of timer callback is guaranteed to not race with itself
for a given uprobe_task, and as such seqcount's insistence on having
preemption disabled on the writer side is irrelevant. So switch to
raw_ variants of seqcount API instead of disabling preemption unnecessarily.
Also, point out in the comments more explicitly why we use seqcount
despite our reader side being rather simple and never retrying. We favor
well-maintained kernel primitive in favor of open-coding our own memory
barriers.
Fixes: 8622e45b5da1 ("uprobes: Reuse return_instances between multiple uretprobes within task")
Reported-by: Alexei Starovoitov <ast@kernel.org>
Suggested-by: Sebastian Siewior <bigeasy@linutronix.de>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: stable@kernel.org
Link: https://lore.kernel.org/r/20250404194848.2109539-1-andrii@kernel.org
Diffstat (limited to 'rust/helpers/workqueue.c')
0 files changed, 0 insertions, 0 deletions