projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
68748f0
)
bpf: use rcu_read_lock_dont_migrate() for bpf_task_storage_free()
author
Menglong Dong
<menglong8.dong@gmail.com>
Thu, 21 Aug 2025 09:06:07 +0000
(17:06 +0800)
committer
Alexei Starovoitov
<ast@kernel.org>
Tue, 26 Aug 2025 01:52:16 +0000
(18:52 -0700)
Use rcu_read_lock_dont_migrate() and rcu_read_unlock_migrate() in
bpf_task_storage_free to obtain better performance when PREEMPT_RCU is
not enabled.
Signed-off-by: Menglong Dong <dongml2@chinatelecom.cn>
Link:
https://lore.kernel.org/r/20250821090609.42508-6-dongml2@chinatelecom.cn
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/bpf_task_storage.c
patch
|
blob
|
history
diff --git
a/kernel/bpf/bpf_task_storage.c
b/kernel/bpf/bpf_task_storage.c
index
1109475
..
a1dc1bf
100644
(file)
--- a/
kernel/bpf/bpf_task_storage.c
+++ b/
kernel/bpf/bpf_task_storage.c
@@
-70,8
+70,7
@@
void bpf_task_storage_free(struct task_struct *task)
{
struct bpf_local_storage *local_storage;
- migrate_disable();
- rcu_read_lock();
+ rcu_read_lock_dont_migrate();
local_storage = rcu_dereference(task->bpf_storage);
if (!local_storage)
@@
-81,8
+80,7
@@
void bpf_task_storage_free(struct task_struct *task)
bpf_local_storage_destroy(local_storage);
bpf_task_storage_unlock();
out:
- rcu_read_unlock();
- migrate_enable();
+ rcu_read_unlock_migrate();
}
static void *bpf_pid_task_storage_lookup_elem(struct bpf_map *map, void *key)