Commit a6fb03a9 authored by Anton Protopopov's avatar Anton Protopopov Committed by Greg Kroah-Hartman
Browse files

bpf: add percpu stats for bpf_map elements insertions/deletions



[ Upstream commit 25954730 ]

Add a generic percpu stats for bpf_map elements insertions/deletions in order
to keep track of both, the current (approximate) number of elements in a map
and per-cpu statistics on update/delete operations.

To expose these stats a particular map implementation should initialize the
counter and adjust it as needed using the 'bpf_map_*_elem_count' helpers
provided by this commit.

Signed-off-by: default avatarAnton Protopopov <aspsk@isovalent.com>
Link: https://lore.kernel.org/r/20230706133932.45883-2-aspsk@isovalent.com


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
Stable-dep-of: 87667336 ("bpf: Defer the free of inner map when necessary")
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 10108826
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment