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

From: Menglong Dong

Date: Tue Oct 14 2025 - 07:26:51 EST


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(-)

--
2.51.0