Skip to content

Uprobe srcu fast#12709

Open
puranjaymohan wants to merge 2 commits into
kernel-patches:bpf-next_basefrom
puranjaymohan:uprobe_srcu_fast
Open

Uprobe srcu fast#12709
puranjaymohan wants to merge 2 commits into
kernel-patches:bpf-next_basefrom
puranjaymohan:uprobe_srcu_fast

Conversation

@puranjaymohan

Copy link
Copy Markdown
Collaborator

No description provided.

Add a guard(srcu_fast_updown) definition for scoped
SRCU-fast-updown read-side critical sections, following the
existing pattern of guard(srcu) and guard(srcu_fast).

Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
uretprobes_srcu currently uses normal SRCU, which issues
two smp_mb() per read lock/unlock pair. This overhead is
paid on every uretprobe hit in prepare_uretprobe().

Switch to SRCU-fast-updown, which eliminates the per-reader
memory barriers by moving the ordering cost to the
grace-period side (synchronize_rcu() instead of smp_mb()).
This is acceptable because grace periods (uprobe
unregistration) are infrequent compared to reader-side
uretprobe hits.

The updown flavor is required because the SRCU read lock is
acquired in prepare_uretprobe() but can be released from a
different context: ri_timer() (timer callback) or
dup_utask() (fork path). The srcu_down_read_fast() /
srcu_up_read_fast() API is designed for this cross-context
pattern and does not carry lockdep tracking that would warn
on cross-task usage. For the same-context short-lived SRCU
sections in ri_timer() and dup_utask(),
guard(srcu_fast_updown) provides proper lockdep coverage.

Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
@kernel-patches-daemon-bpf kernel-patches-daemon-bpf Bot force-pushed the bpf-next_base branch 27 times, most recently from 386cc3c to ded8f8a Compare July 11, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant