add mechanism to report map pressure
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 15 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | bpf: add new map ops ->map_pressureinclude/ include/ kernel/ +3 more | +99 | 15 replies | |
| 2/2 | selftests/bpf: test map pressuretools/ | +309 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH bpf-next 0/2] add mechanism to report map pressure
This series adds a mechanism to report "map pressure" (read as "the current number of elements" for most maps) to userspace.
The primary reason for adding this functionality in our case (Cilium) is to get signals about how full some heavy-used maps are and what the actual dynamic profile of map capacity is. In the case of RCU maps this is impossible to get this information anyhow else. See also [1].
The first patch in the series adds the api and implements the ops for all maps in hashtab.c + for the lpm_trie.c (the maps which are of most interest for us). See the commit description for additional details.
The second commit adds a new map selftest map_tests/map_pressure.c.
[1] https://lpc.events/event/16/contributions/1368/
Anton Protopopov (2):
bpf: add new map ops ->map_pressure
selftests/bpf: test map pressure
include/linux/bpf.h | 1 + include/uapi/linux/bpf.h | 2 +- kernel/bpf/hashtab.c | 118 ++++--- kernel/bpf/lpm_trie.c | 8 + kernel/bpf/syscall.c | 15 + tools/include/uapi/linux/bpf.h | 2 +- .../selftests/bpf/map_tests/map_pressure.c | 307 ++++++++++++++++++ 7 files changed, 406 insertions(+), 47 deletions(-) create mode 100644 tools/testing/selftests/bpf/map_tests/map_pressure.c
Signature · 1 line
2.34.1