Skip to content

Commit a230a7c

Browse files
image-dragonKernel Patches Daemon
authored andcommitted
bpf: use rcu_read_lock_dont_migrate() for bpf_cgrp_storage_free()
Use rcu_read_lock_dont_migrate() and rcu_read_unlock_migrate() in bpf_cgrp_storage_free to obtain better performance when PREEMPT_RCU is not enabled. Signed-off-by: Menglong Dong <[email protected]>
1 parent 9a1212e commit a230a7c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

kernel/bpf/bpf_cgrp_storage.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ void bpf_cgrp_storage_free(struct cgroup *cgroup)
4545
{
4646
struct bpf_local_storage *local_storage;
4747

48-
migrate_disable();
49-
rcu_read_lock();
48+
rcu_read_lock_dont_migrate();
5049
local_storage = rcu_dereference(cgroup->bpf_cgrp_storage);
5150
if (!local_storage)
5251
goto out;
@@ -55,8 +54,7 @@ void bpf_cgrp_storage_free(struct cgroup *cgroup)
5554
bpf_local_storage_destroy(local_storage);
5655
bpf_cgrp_storage_unlock();
5756
out:
58-
rcu_read_unlock();
59-
migrate_enable();
57+
rcu_read_unlock_migrate();
6058
}
6159

6260
static struct bpf_local_storage_data *

0 commit comments

Comments
 (0)