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() indicate migrate_disable(), so we don't need to call it in this case. In this series, we introduce rcu_migrate_disable and rcu_migrate_enable, which will call migrate_disable and migrate_enable only when PREEMPT_RCU enabled. And replace the migrate_enable/migrate_disable with rcu_migrate_enable/rcu_migrate_disable in bpf. Menglong Dong (7): rcu: add rcu_migrate_enable and rcu_migrate_disable bpf: use rcu_migrate_* for bpf_cgrp_storage_free() bpf: use rcu_migrate_* for bpf_inode_storage_free() bpf: use rcu_migrate_* for bpf_iter_run_prog() bpf: use rcu_migrate_* for bpf_task_storage_free() bpf: use rcu_migrate_* for bpf_prog_run_array_cg() bpf: use rcu_migrate_* for trampoline.c include/linux/rcupdate.h | 18 ++++++++++++++++++ kernel/bpf/bpf_cgrp_storage.c | 4 ++-- kernel/bpf/bpf_inode_storage.c | 4 ++-- kernel/bpf/bpf_iter.c | 4 ++-- kernel/bpf/bpf_task_storage.c | 4 ++-- kernel/bpf/cgroup.c | 4 ++-- kernel/bpf/trampoline.c | 12 ++++++------ 7 files changed, 34 insertions(+), 16 deletions(-) -- 2.50.1