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 leftover accounting in htab_map_mem_usage after rqspinlock

After commit 4fa8d68aa53e ("bpf: Convert hashtab.c to rqspinlock")
we no longer use HASHTAB_MAP_LOCK_{COUNT,MASK} as the per-CPU
map_locked[HASHTAB_MAP_LOCK_COUNT] array got removed from struct
bpf_htab. Right now it is still accounted for in htab_map_mem_usage.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/09703eb6bb249f12b1d5253b5a50a0c4fa239d27.1768913513.git.daniel@iogearbox.net

authored by

Daniel Borkmann and committed by
Andrii Nakryiko
713edc71 ef7d4e42

+4 -7
+4 -7
kernel/bpf/hashtab.c
··· 82 82 rqspinlock_t raw_lock; 83 83 }; 84 84 85 - #define HASHTAB_MAP_LOCK_COUNT 8 86 - #define HASHTAB_MAP_LOCK_MASK (HASHTAB_MAP_LOCK_COUNT - 1) 87 - 88 85 struct bpf_htab { 89 86 struct bpf_map map; 90 87 struct bpf_mem_alloc ma; ··· 2234 2237 bool prealloc = htab_is_prealloc(htab); 2235 2238 bool percpu = htab_is_percpu(htab); 2236 2239 bool lru = htab_is_lru(htab); 2237 - u64 num_entries; 2238 - u64 usage = sizeof(struct bpf_htab); 2240 + u64 num_entries, usage; 2239 2241 2240 - usage += sizeof(struct bucket) * htab->n_buckets; 2241 - usage += sizeof(int) * num_possible_cpus() * HASHTAB_MAP_LOCK_COUNT; 2242 + usage = sizeof(struct bpf_htab) + 2243 + sizeof(struct bucket) * htab->n_buckets; 2244 + 2242 2245 if (prealloc) { 2243 2246 num_entries = map->max_entries; 2244 2247 if (htab_has_extra_elems(htab))