diff options
| author | Jiayuan Chen <jiayuan.chen@linux.dev> | 2026-07-17 19:37:02 +0800 |
|---|---|---|
| committer | Kumar Kartikeya Dwivedi <memxor@gmail.com> | 2026-07-19 17:56:09 +0200 |
| commit | 89318afb141437817a88fe3e5d8f6638c6ab3ed3 (patch) | |
| tree | ac3353938707397c8edfe7561aeef5c750050d66 /tools/perf/scripts/python/stackcollapse.py | |
| parent | f8248ac8f044ad3e79279cf3355412456bf416b0 (diff) | |
bpf: Add memory usage for arena
arena is the only map type whose map_mem_usage() still returns 0, so
"bpftool map show" and fdinfo always showed 0 memlock for an arena no
matter how many pages it had.
Count the pages that are actually mapped into the arena: bump a counter in
apply_range_set_cb() when a page goes in and drop it in
apply_range_clear_cb() when a page goes out, both under the arena spinlock.
map_mem_usage() then just returns nr_pages << PAGE_SHIFT.
Only real data pages are counted, not the scratch page.
Signed-off-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Reviewed-by: Emil Tsalapatis <emil@etsalapatis.com>
Link: https://lore.kernel.org/bpf/20260717114117.350851-3-jiayuan.chen@linux.dev
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Diffstat (limited to 'tools/perf/scripts/python/stackcollapse.py')
0 files changed, 0 insertions, 0 deletions
