public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Mike Pagano" <mpagano@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/linux-patches:6.11 commit in: /
Date: Thu, 21 Nov 2024 18:02:26 +0000 (UTC)	[thread overview]
Message-ID: <1732212112.0f40783765322f593867fe66021be5d411d17648.mpagano@gentoo> (raw)

commit:     0f40783765322f593867fe66021be5d411d17648
Author:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 21 18:01:52 2024 +0000
Commit:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
CommitDate: Thu Nov 21 18:01:52 2024 +0000
URL:        https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=0f407837

kbuild,bpf: Pass make jobs' value to pahole

Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>

 0000_README                               |  4 ++
 2996_kbuild-bpf-jobs-val-pahole-fix.patch | 64 +++++++++++++++++++++++++++++++
 2 files changed, 68 insertions(+)

diff --git a/0000_README b/0000_README
index 069847dc..3c22b167 100644
--- a/0000_README
+++ b/0000_README
@@ -139,6 +139,10 @@ Patch:  2995_dtrace-6.11_p1.patch
 From:   https://github.com/thesamesam/linux/tree/dtrace-sam/v2/6.11-flat
 Desc:   dtrace patch for 6.11.X (CTF, modules.builtin.objs)
 
+Patch:  2996_kbuild-bpf-jobs-val-pahole-fix.patch
+From:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
+Desc:   kbuild,bpf: Pass make jobs' value to pahole
+
 Patch:  3000_Support-printing-firmware-info.patch
 From:   https://bugs.gentoo.org/732852
 Desc:   Print firmware info (Reqs CONFIG_GENTOO_PRINT_FIRMWARE_INFO). Thanks to Georgy Yakovlev

diff --git a/2996_kbuild-bpf-jobs-val-pahole-fix.patch b/2996_kbuild-bpf-jobs-val-pahole-fix.patch
new file mode 100644
index 00000000..e69cde35
--- /dev/null
+++ b/2996_kbuild-bpf-jobs-val-pahole-fix.patch
@@ -0,0 +1,64 @@
+From 09048d22b7825a5025cf7e135f7e3134daff4df2 Mon Sep 17 00:00:00 2001
+From: Florian Schmaus <flo@geekplace.eu>
+Date: Sat, 2 Nov 2024 11:04:51 +0100
+Subject: kbuild,bpf: Pass make jobs' value to pahole
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Pass the value of make's -j/--jobs argument to pahole, to avoid out of
+memory errors and make pahole respect the "jobs" value of make.
+
+On systems with little memory but many cores, invoking pahole using -j
+without argument potentially creates too many pahole instances,
+causing an out-of-memory situation. Instead, we should pass make's
+"jobs" value as an argument to pahole's -j, which is likely configured
+to be (much) lower than the actual core count on such systems.
+
+If make was invoked without -j, either via cmdline or MAKEFLAGS, then
+JOBS will be simply empty, resulting in the existing behavior, as
+expected.
+
+Signed-off-by: Florian Schmaus <flo@geekplace.eu>
+Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
+Tested-by: Holger Hoffstätte <holger@applied-asynchrony.com>
+Link: https://lore.kernel.org/bpf/20241102100452.793970-1-flo@geekplace.eu
+---
+ scripts/Makefile.btf | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+(limited to 'scripts/Makefile.btf')
+
+diff --git a/scripts/Makefile.btf b/scripts/Makefile.btf
+index b75f09f3f4248d..c3cbeb13de5035 100644
+--- a/scripts/Makefile.btf
++++ b/scripts/Makefile.btf
+@@ -3,6 +3,8 @@
+ pahole-ver := $(CONFIG_PAHOLE_VERSION)
+ pahole-flags-y :=
+ 
++JOBS := $(patsubst -j%,%,$(filter -j%,$(MAKEFLAGS)))
++
+ ifeq ($(call test-le, $(pahole-ver), 125),y)
+ 
+ # pahole 1.18 through 1.21 can't handle zero-sized per-CPU vars
+@@ -12,14 +14,14 @@ endif
+ 
+ pahole-flags-$(call test-ge, $(pahole-ver), 121)	+= --btf_gen_floats
+ 
+-pahole-flags-$(call test-ge, $(pahole-ver), 122)	+= -j
++pahole-flags-$(call test-ge, $(pahole-ver), 122)	+= -j$(JOBS)
+ 
+ pahole-flags-$(call test-ge, $(pahole-ver), 125)	+= --skip_encoding_btf_inconsistent_proto --btf_gen_optimized
+ 
+ else
+ 
+ # Switch to using --btf_features for v1.26 and later.
+-pahole-flags-$(call test-ge, $(pahole-ver), 126)  = -j --btf_features=encode_force,var,float,enum64,decl_tag,type_tag,optimized_func,consistent_func,decl_tag_kfuncs
++pahole-flags-$(call test-ge, $(pahole-ver), 126)  = -j$(JOBS) --btf_features=encode_force,var,float,enum64,decl_tag,type_tag,optimized_func,consistent_func,decl_tag_kfuncs
+ 
+ ifneq ($(KBUILD_EXTMOD),)
+ module-pahole-flags-$(call test-ge, $(pahole-ver), 126) += --btf_features=distilled_base
+-- 
+cgit 1.2.3-korg
+


             reply	other threads:[~2024-11-21 18:02 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-21 18:02 Mike Pagano [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-12-05 14:07 [gentoo-commits] proj/linux-patches:6.11 commit in: / Mike Pagano
2024-11-22 17:54 Mike Pagano
2024-11-22 17:46 Mike Pagano
2024-11-19 18:42 Mike Pagano
2024-11-17 18:15 Mike Pagano
2024-11-14 14:53 Mike Pagano
2024-11-14 13:49 Mike Pagano
2024-11-13 19:54 Mike Pagano
2024-11-08 16:29 Mike Pagano
2024-11-04 20:27 Mike Pagano
2024-11-03 11:29 Mike Pagano
2024-11-01 11:54 Mike Pagano
2024-11-01 11:26 Mike Pagano
2024-10-27 13:40 Mike Pagano
2024-10-25 11:42 Mike Pagano
2024-10-22 16:56 Mike Pagano
2024-10-21 13:35 Mike Pagano
2024-10-17 14:31 Mike Pagano
2024-10-17 14:04 Mike Pagano
2024-10-10 11:34 Mike Pagano
2024-10-04 22:53 Mike Pagano
2024-10-04 15:21 Mike Pagano
2024-09-30 16:02 Mike Pagano
2024-09-21 15:21 Mike Pagano
2024-09-15 19:09 Mike Pagano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1732212112.0f40783765322f593867fe66021be5d411d17648.mpagano@gentoo \
    --to=mpagano@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox