[PATCH bpf-next v2 0/3] bpf: account for local storage map elements memory
From: Mahe Tardy
Date: Mon Nov 30 2026 - 15:14:31 EST
We started using task local storage within Tetragon and realized memlock
omitted the memory used by map entries[^1] which is significant in our
use case, this aims at making the memory usage more accurate.
v2 changes:
- use map->elem_count instead of walking the elements (alexei)
Link to v1: https://lore.kernel.org/bpf/20261126131318.470837-1-mahe.tardy@xxxxxxxxx/
[^1]: https://github.com/cilium/tetragon/issues/6139
Mahe Tardy (3):
bpf: reuse local storage map link and unlink helpers
bpf: account for local storage map elements memory
selftests/bpf: test task storage memory accounting
kernel/bpf/bpf_local_storage.c | 41 ++++++++-----
.../bpf/prog_tests/task_local_storage.c | 61 +++++++++++++++++++
2 files changed, 87 insertions(+), 15 deletions(-)
--
2.43.0