Skip to content

Commit 85bdff2

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

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/bpf/cgroup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ bpf_prog_run_array_cg(const struct cgroup_bpf *cgrp,
7171
u32 func_ret;
7272

7373
run_ctx.retval = retval;
74-
migrate_disable();
74+
rcu_migrate_disable();
7575
rcu_read_lock();
7676
array = rcu_dereference(cgrp->effective[atype]);
7777
item = &array->items[0];
@@ -89,7 +89,7 @@ bpf_prog_run_array_cg(const struct cgroup_bpf *cgrp,
8989
}
9090
bpf_reset_run_ctx(old_run_ctx);
9191
rcu_read_unlock();
92-
migrate_enable();
92+
rcu_migrate_enable();
9393
return run_ctx.retval;
9494
}
9595

0 commit comments

Comments
 (0)