mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH bpf-next v3 0/7] bpf: introduce and use rcu_read_lock_dont_migrate
@ 2025-08-21  9:06 Menglong Dong
  2025-08-21  9:06 ` [PATCH bpf-next v3 1/7] rcu: add rcu_read_lock_dont_migrate() Menglong Dong
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Menglong Dong @ 2025-08-21  9:06 UTC (permalink / raw)
  To: ast, paulmck
  Cc: frederic, neeraj.upadhyay, joelagnelf, josh, boqun.feng, urezki,
	rostedt, mathieu.desnoyers, jiangshanlai, qiang.zhang, daniel,
	john.fastabend, andrii, martin.lau, eddyz87, song, yonghong.song,
	kpsingh, sdf, haoluo, jolsa, rcu, linux-kernel, bpf

migrate_disable() and rcu_read_lock() are used to together in many case in
bpf. However, when PREEMPT_RCU is not enabled, rcu_read_lock() will
disable preemption, which indicate migrate_disable(), so we don't need to
call it in this case.

In this series, we introduce rcu_read_lock_dont_migrate and
rcu_read_unlock_migrate, which will call migrate_disable and
migrate_enable only when PREEMPT_RCU enabled. And use
rcu_read_lock_dont_migrate in bpf subsystem.

Changes since V2:
* make rcu_read_lock_dont_migrate() more compatible by using IS_ENABLED()

Changes since V1:
* introduce rcu_read_lock_dont_migrate() instead of
  rcu_migrate_disable() + rcu_read_lock()

Menglong Dong (7):
  rcu: add rcu_read_lock_dont_migrate()
  bpf: use rcu_read_lock_dont_migrate() for bpf_cgrp_storage_free()
  bpf: use rcu_read_lock_dont_migrate() for bpf_inode_storage_free()
  bpf: use rcu_read_lock_dont_migrate() for bpf_iter_run_prog()
  bpf: use rcu_read_lock_dont_migrate() for bpf_task_storage_free()
  bpf: use rcu_read_lock_dont_migrate() for bpf_prog_run_array_cg()
  bpf: use rcu_read_lock_dont_migrate() for trampoline.c

 include/linux/rcupdate.h       | 14 ++++++++++++++
 kernel/bpf/bpf_cgrp_storage.c  |  6 ++----
 kernel/bpf/bpf_inode_storage.c |  6 ++----
 kernel/bpf/bpf_iter.c          |  6 ++----
 kernel/bpf/bpf_task_storage.c  |  6 ++----
 kernel/bpf/cgroup.c            |  6 ++----
 kernel/bpf/trampoline.c        | 18 ++++++------------
 7 files changed, 30 insertions(+), 32 deletions(-)

-- 
2.50.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-08-26  5:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-08-21  9:06 [PATCH bpf-next v3 0/7] bpf: introduce and use rcu_read_lock_dont_migrate Menglong Dong
2025-08-21  9:06 ` [PATCH bpf-next v3 1/7] rcu: add rcu_read_lock_dont_migrate() Menglong Dong
2025-08-21 11:41   ` Paul E. McKenney
2025-08-21  9:06 ` [PATCH bpf-next v3 2/7] bpf: use rcu_read_lock_dont_migrate() for bpf_cgrp_storage_free() Menglong Dong
2025-08-21  9:06 ` [PATCH bpf-next v3 3/7] bpf: use rcu_read_lock_dont_migrate() for bpf_inode_storage_free() Menglong Dong
2025-08-21  9:06 ` [PATCH bpf-next v3 4/7] bpf: use rcu_read_lock_dont_migrate() for bpf_iter_run_prog() Menglong Dong
2025-08-21  9:06 ` [PATCH bpf-next v3 5/7] bpf: use rcu_read_lock_dont_migrate() for bpf_task_storage_free() Menglong Dong
2025-08-21  9:06 ` [PATCH bpf-next v3 6/7] bpf: use rcu_read_lock_dont_migrate() for bpf_prog_run_array_cg() Menglong Dong
2025-08-21  9:06 ` [PATCH bpf-next v3 7/7] bpf: use rcu_read_lock_dont_migrate() for trampoline.c Menglong Dong
2025-08-26  5:40 ` [PATCH bpf-next v3 0/7] bpf: introduce and use rcu_read_lock_dont_migrate patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®