Skip to content

Commit 09eddfb

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

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/bpf/bpf_task_storage.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ void bpf_task_storage_free(struct task_struct *task)
7070
{
7171
struct bpf_local_storage *local_storage;
7272

73-
migrate_disable();
73+
rcu_migrate_disable();
7474
rcu_read_lock();
7575

7676
local_storage = rcu_dereference(task->bpf_storage);
@@ -82,7 +82,7 @@ void bpf_task_storage_free(struct task_struct *task)
8282
bpf_task_storage_unlock();
8383
out:
8484
rcu_read_unlock();
85-
migrate_enable();
85+
rcu_migrate_enable();
8686
}
8787

8888
static void *bpf_pid_task_storage_lookup_elem(struct bpf_map *map, void *key)

0 commit comments

Comments
 (0)