Skip to content

bpf: add and use migrate_enable_rcu

Menglong Dong bpf lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4rcu: factor out migrate_enable_rcu and migrate_disable_rcuinclude/linux/rcupdate.h+17 -32 replies
2/4bpf: introduce bpf_prog_run_pin_on_cpu_rcu()include/linux/filter.h+12 -00 replies
3/4bpf: use bpf_prog_run_pin_on_cpu_rcu() in skmsg.cnet/core/skmsg.c+5 -50 replies
4/4bpf: use bpf_prog_run_pin_on_cpu_rcu() in bpf_prog_run_clear_cbinclude/linux/filter.h+1 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH bpf-next 0/4] bpf: add and use migrate_enable_rcu

For now, we can use rcu_read_lock_dont_migrate() for the case that call both rcu_read_lock() and migrate_disable(). However, sometimes they can be called separately.

Therefore, we factor out migrate_enable_rcu and migrate_disable_rcu from rcu_read_lock_dont_migrate and rcu_read_unlock_migrate.

And we introduce the function bpf_prog_run_pin_on_cpu_rcu(), which is similar to bpf_prog_run_pin_on_cpu() but use migrate_disable_rcu/migrate_enable_rcu instead.

The function bpf_prog_run_pin_on_cpu_rcu() is used in following functions:

sk_psock_msg_verdict
sk_psock_tls_strp_read
sk_psock_strp_read
sk_psock_strp_parse
sk_psock_verdict_recv
bpf_prog_run_clear_cb

Menglong Dong (4):
rcu: factor out migrate_enable_rcu and migrate_disable_rcu
bpf: introduce bpf_prog_run_pin_on_cpu_rcu()
bpf: use bpf_prog_run_pin_on_cpu_rcu() in skmsg.c
bpf: use bpf_prog_run_pin_on_cpu_rcu() in bpf_prog_run_clear_cb

 include/linux/filter.h   | 16 +++++++++++++++-
 include/linux/rcupdate.h | 18 +++++++++++++++---
 net/core/skmsg.c         | 10 +++++-----
 3 files changed, 35 insertions(+), 9 deletions(-)
Signature · 1 line
2.51.0