diff options
author | Yafang Shao <laoar.shao@gmail.com> | 2023-03-05 15:45:59 +0300 |
---|---|---|
committer | Alexei Starovoitov <ast@kernel.org> | 2023-03-07 20:33:42 +0300 |
commit | 41d5941e7f9a27f3d28220f08b843e8d87df1be4 (patch) | |
tree | 4e805c69a2180983bc0c958afaa8376bf5d188f8 /kernel/bpf/stackmap.c | |
parent | 90a5527d7686d3ebe0dd2a831356a6c7d7dc31bc (diff) | |
download | linux-41d5941e7f9a27f3d28220f08b843e8d87df1be4.tar.xz |
bpf: lpm_trie memory usage
trie_mem_usage() is introduced to calculate the lpm_trie memory usage.
Some small memory allocations are ignored. The inner node is also
ignored.
The result as follows,
- before
10: lpm_trie flags 0x1
key 8B value 8B max_entries 65536 memlock 1048576B
- after
10: lpm_trie flags 0x1
key 8B value 8B max_entries 65536 memlock 2291536B
Signed-off-by: Yafang Shao <laoar.shao@gmail.com>
Link: https://lore.kernel.org/r/20230305124615.12358-3-laoar.shao@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'kernel/bpf/stackmap.c')
0 files changed, 0 insertions, 0 deletions