Re: [RFC] kbuild: bpf: Do not run pahole with -j on 32bit userspace

From: Jiri Slaby
Date: Tue Aug 20 2024 - 05:08:34 EST


On 20. 08. 24, 10:59, Jiri Slaby (SUSE) wrote:
From: Jiri Slaby <jslaby@xxxxxxx>

== WARNING ==
This is only a PoC. There are deficiencies like CROSS_COMPILE or LLVM
are completely unhandled.

The simple version is just do there:
ifeq ($(CONFIG_64BIT,y)
but it has its own deficiencies, of course.

So any ideas, inputs?

Also as Shung-Hsi Yu suggests, we can cap -j to 1 in pahole proper when sizeof(long) == 4.

== WARNING ==

When pahole is run with -j on 32bit userspace (32bit pahole in
particular), it randomly fails with OOM:
btf_encoder__tag_kfuncs: Failed to get ELF section(62) data: out of memory.
btf_encoder__encode: failed to tag kfuncs!

or simply SIGSEGV (failed to allocate the btf encoder).

It very depends on how many threads are created.

I forgot to add, that it depends on the kernel version too. It happens much often with 6.11-rc now (vmlinux got big enough, apparently).

thanks,
--
js
suse labs