Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

bpf: Remove unused percpu counter from bpf_local_storage_map_free

Percpu locks have been removed from cgroup and task local storage. Now
that all local storage no longer use percpu variables as locks preventing
recursion, there is no need to pass them to bpf_local_storage_map_free().
Remove the argument from the function.

Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Amery Hung <ameryhung@gmail.com>
Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org>
Link: https://patch.msgid.link/20260205222916.1788211-9-ameryhung@gmail.com

authored by

Amery Hung and committed by
Martin KaFai Lau
3417dffb 5254de7b

+6 -12
+1 -2
include/linux/bpf_local_storage.h
··· 166 166 void bpf_local_storage_destroy(struct bpf_local_storage *local_storage); 167 167 168 168 void bpf_local_storage_map_free(struct bpf_map *map, 169 - struct bpf_local_storage_cache *cache, 170 - int __percpu *busy_counter); 169 + struct bpf_local_storage_cache *cache); 171 170 172 171 int bpf_local_storage_map_check_btf(const struct bpf_map *map, 173 172 const struct btf *btf,
+1 -1
kernel/bpf/bpf_cgrp_storage.c
··· 119 119 120 120 static void cgroup_storage_map_free(struct bpf_map *map) 121 121 { 122 - bpf_local_storage_map_free(map, &cgroup_cache, NULL); 122 + bpf_local_storage_map_free(map, &cgroup_cache); 123 123 } 124 124 125 125 /* *gfp_flags* is a hidden argument provided by the verifier */
+1 -1
kernel/bpf/bpf_inode_storage.c
··· 184 184 185 185 static void inode_storage_map_free(struct bpf_map *map) 186 186 { 187 - bpf_local_storage_map_free(map, &inode_cache, NULL); 187 + bpf_local_storage_map_free(map, &inode_cache); 188 188 } 189 189 190 190 const struct bpf_map_ops inode_storage_map_ops = {
+1 -6
kernel/bpf/bpf_local_storage.c
··· 807 807 } 808 808 809 809 void bpf_local_storage_map_free(struct bpf_map *map, 810 - struct bpf_local_storage_cache *cache, 811 - int __percpu *busy_counter) 810 + struct bpf_local_storage_cache *cache) 812 811 { 813 812 struct bpf_local_storage_map_bucket *b; 814 813 struct bpf_local_storage_elem *selem; ··· 840 841 while ((selem = hlist_entry_safe( 841 842 rcu_dereference_raw(hlist_first_rcu(&b->list)), 842 843 struct bpf_local_storage_elem, map_node))) { 843 - if (busy_counter) 844 - this_cpu_inc(*busy_counter); 845 844 bpf_selem_unlink(selem, true); 846 - if (busy_counter) 847 - this_cpu_dec(*busy_counter); 848 845 cond_resched_rcu(); 849 846 } 850 847 rcu_read_unlock();
+1 -1
kernel/bpf/bpf_task_storage.c
··· 217 217 218 218 static void task_storage_map_free(struct bpf_map *map) 219 219 { 220 - bpf_local_storage_map_free(map, &task_cache, NULL); 220 + bpf_local_storage_map_free(map, &task_cache); 221 221 } 222 222 223 223 BTF_ID_LIST_GLOBAL_SINGLE(bpf_local_storage_map_btf_id, struct, bpf_local_storage_map)
+1 -1
net/core/bpf_sk_storage.c
··· 60 60 61 61 static void bpf_sk_storage_map_free(struct bpf_map *map) 62 62 { 63 - bpf_local_storage_map_free(map, &sk_cache, NULL); 63 + bpf_local_storage_map_free(map, &sk_cache); 64 64 } 65 65 66 66 static struct bpf_map *bpf_sk_storage_map_alloc(union bpf_attr *attr)