[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211023120452.212885-1-jolsa@kernel.org>
Date: Sat, 23 Oct 2021 14:04:50 +0200
From: Jiri Olsa <jolsa@...hat.com>
To: Alexei Starovoitov <ast@...nel.org>,
Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii@...nel.org>
Cc: netdev@...r.kernel.org, bpf@...r.kernel.org,
Martin KaFai Lau <kafai@...com>,
Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
John Fastabend <john.fastabend@...il.com>,
KP Singh <kpsingh@...omium.org>
Subject: [RFC bpf-next 0/2] bpf: Fix BTF data for modules
hi,
I'm trying to enable BTF for kernel module in fedora,
and I'm getting big increase on modules sizes on s390x arch.
Size of modules in total - kernel dir under /lib/modules/VER/
from kernel-core and kernel-module packages:
current new
aarch64 60M 76M
ppc64le 53M 66M
s390x 21M 41M
x86_64 64M 79M
The reason for higher increase on s390x was that dedup algorithm
did not detect some of the big kernel structs like 'struct module',
so they are duplicated in the kernel module BTF data. The s390x
has many small modules that increased significantly in size because
of that even after compression.
First issues was that the '--btf_gen_floats' option is not passed
to pahole for kernel module BTF generation.
The other problem is more tricky and is the reason why this patchset
is RFC ;-)
The s390x compiler generates multiple definitions of the same struct
and dedup algorithm does not seem to handle this at the moment.
I put the debuginfo and btf dump of the s390x pnet.ko module in here:
http://people.redhat.com/~jolsa/kmodbtf/
Please let me know if you'd like to see other info/files.
I found code in dedup that seems to handle such situation for arrays,
and added 'some' fix for structs. With that change I can no longer
see vmlinux's structs in kernel module BTF data, but I have no idea
if that breaks anything else.
thoughts? thanks,
jirka
---
Jiri Olsa (2):
kbuild: Unify options for BTF generation for vmlinux and modules
bpf: Add support to detect and dedup instances of same structs
Makefile | 3 +++
scripts/Makefile.modfinal | 2 +-
scripts/link-vmlinux.sh | 11 +----------
scripts/pahole-flags.sh | 20 ++++++++++++++++++++
tools/lib/bpf/btf.c | 12 ++++++++++--
5 files changed, 35 insertions(+), 13 deletions(-)
create mode 100755 scripts/pahole-flags.sh
Powered by blists - more mailing lists