summaryrefslogtreecommitdiff
path: root/tools/lib
diff options
context:
space:
mode:
authorMartin KaFai Lau <martin.lau@kernel.org>2022-12-21 04:30:36 +0300
committerDaniel Borkmann <daniel@iogearbox.net>2022-12-21 17:42:39 +0300
commit552d42a356ebf78df9d2f4b73e077d2459966fac (patch)
treeb07facf6579086fbd7b20f4c41448fcb0627b432 /tools/lib
parent7b43df6c6ec38c9097420902a1c8165c4b25bf70 (diff)
downloadlinux-552d42a356ebf78df9d2f4b73e077d2459966fac.tar.xz
bpf: Reduce smap->elem_size
'struct bpf_local_storage_elem' has an unused 56 byte padding at the end due to struct's cache-line alignment requirement. This padding space is overlapped by storage value contents, so if we use sizeof() to calculate the total size, we overinflate it by 56 bytes. Use offsetof() instead to calculate more exact memory use. Signed-off-by: Martin KaFai Lau <martin.lau@kernel.org> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Acked-by: Yonghong Song <yhs@fb.com> Acked-by: Andrii Nakryiko <andrii@kernel.org> Link: https://lore.kernel.org/bpf/20221221013036.3427431-1-martin.lau@linux.dev
Diffstat (limited to 'tools/lib')
0 files changed, 0 insertions, 0 deletions