Skip to content

Commit a3c02a4

Browse files
image-dragonKernel Patches Daemon
authored andcommitted
bpf: use rcu_migrate_* for bpf_iter_run_prog()
Replace the migrate_disable/migrate_enable with rcu_migrate_disable/rcu_migrate_enable in bpf_iter_run_prog to obtain better performance when PREEMPT_RCU is not enabled. Signed-off-by: Menglong Dong <[email protected]>
1 parent 079d1ea commit a3c02a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/bpf/bpf_iter.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,11 +706,11 @@ int bpf_iter_run_prog(struct bpf_prog *prog, void *ctx)
706706
rcu_read_unlock_trace();
707707
} else {
708708
rcu_read_lock();
709-
migrate_disable();
709+
rcu_migrate_disable();
710710
old_run_ctx = bpf_set_run_ctx(&run_ctx);
711711
ret = bpf_prog_run(prog, ctx);
712712
bpf_reset_run_ctx(old_run_ctx);
713-
migrate_enable();
713+
rcu_migrate_enable();
714714
rcu_read_unlock();
715715
}
716716

0 commit comments

Comments
 (0)