From: "Dr. David Alan Gilbert" <linux@treblig.org>
To: Jiri Slaby <jirislaby@kernel.org>
Cc: Uros Bizjak <ubizjak@gmail.com>,
x86@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org,
linux-bcachefs@vger.kernel.org, linux-arch@vger.kernel.org,
netdev@vger.kernel.org, Nadav Amit <nadav.amit@gmail.com>,
Dennis Zhou <dennis@kernel.org>, Tejun Heo <tj@kernel.org>,
Christoph Lameter <cl@linux.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@kernel.org>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Andy Lutomirski <luto@kernel.org>,
Brian Gerst <brgerst@gmail.com>,
Peter Zijlstra <peterz@infradead.org>,
Shung-Hsi Yu <shung-hsi.yu@suse.com>
Subject: Re: Large modules with 6.15 [was: [PATCH v4 6/6] percpu/x86: Enable strict percpu checks via named AS qualifiers]
Date: Thu, 5 Jun 2025 14:39:41 +0000 [thread overview]
Message-ID: <aEGsLeUWj6_wiovf@gallifrey> (raw)
In-Reply-To: <02c00acd-9518-4371-be2c-eb63e5d11d9c@kernel.org>
* Jiri Slaby (jirislaby@kernel.org) wrote:
> On 27. 01. 25, 17:05, Uros Bizjak wrote:
> > This patch declares percpu variables in __seg_gs/__seg_fs named AS
> > and keeps them named AS qualified until they are dereferenced with
> > percpu accessor. This approach enables various compiler check
> > for cross-namespace variable assignments.
> >
> > Signed-off-by: Uros Bizjak <ubizjak@gmail.com>
> > Acked-by: Nadav Amit <nadav.amit@gmail.com>
> > Cc: Dennis Zhou <dennis@kernel.org>
> > Cc: Tejun Heo <tj@kernel.org>
> > Cc: Christoph Lameter <cl@linux.com>
> > Cc: Thomas Gleixner <tglx@linutronix.de>
> > Cc: Ingo Molnar <mingo@kernel.org>
> > Cc: Borislav Petkov <bp@alien8.de>
> > Cc: Dave Hansen <dave.hansen@linux.intel.com>
> > Cc: "H. Peter Anvin" <hpa@zytor.com>
> > Cc: Linus Torvalds <torvalds@linux-foundation.org>
> > Cc: Andy Lutomirski <luto@kernel.org>
> > Cc: Brian Gerst <brgerst@gmail.com>
> > Cc: Peter Zijlstra <peterz@infradead.org>
> > ---
> > arch/x86/include/asm/percpu.h | 15 ++++++++++++---
> > 1 file changed, 12 insertions(+), 3 deletions(-)
> >
> > diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h
> > index 27f668660abe..474d648bca9a 100644
> > --- a/arch/x86/include/asm/percpu.h
> > +++ b/arch/x86/include/asm/percpu.h
> > @@ -95,9 +95,18 @@
> > #endif /* CONFIG_SMP */
> > -#define __my_cpu_type(var) typeof(var) __percpu_seg_override
> > -#define __my_cpu_ptr(ptr) (__my_cpu_type(*(ptr))*)(__force uintptr_t)(ptr)
> > -#define __my_cpu_var(var) (*__my_cpu_ptr(&(var)))
> > +#if defined(CONFIG_USE_X86_SEG_SUPPORT) && defined(USE_TYPEOF_UNQUAL)
> > +# define __my_cpu_type(var) typeof(var)
> > +# define __my_cpu_ptr(ptr) (ptr)
> > +# define __my_cpu_var(var) (var)
> > +
> > +# define __percpu_qual __percpu_seg_override
> > +#else
> > +# define __my_cpu_type(var) typeof(var) __percpu_seg_override
> > +# define __my_cpu_ptr(ptr) (__my_cpu_type(*(ptr))*)(__force uintptr_t)(ptr)
> > +# define __my_cpu_var(var) (*__my_cpu_ptr(&(var)))
> > +#endif
> > +
>
> Another issue with this is this causes all modules in 6.15 are 2-4 times
> (compressed size) bigger:
Oh, is that why config-all kernel is too big?
Dave
> $ ll /usr/lib/modules/*-[0-9]-default/kernel/drivers/atm/atmtcp.ko.zst
> > -rw-r--r--. 1 root root 10325 May 13 11:49
> /usr/lib/modules/6.14.6-2-default/kernel/drivers/atm/atmtcp.ko.zst
> > -rw-r--r--. 1 root root 39677 Jun 2 09:13
> /usr/lib/modules/6.15.0-1-default/kernel/drivers/atm/atmtcp.ko.zst
>
> It's due to larger .BTF section:
> .BTF PROGBITS 0000000000000000 [-00003080-]
> [- 00000000000011a8-] {+00003100+}
> {+ 0000000000012cf8+} 0000000000000000 0 0 1
>
> There are a lot of new BTF types defined in each module like:
> +attribute_group STRUCT
> +backing_dev_info STRUCT
> +bdi_writeback STRUCT
> +bin_attribute STRUCT
> +bio_end_io_t TYPEDEF
> +bio_list STRUCT
> +bio_set STRUCT
> +bio STRUCT
> +bio_vec STRUCT
>
> Reverting this gives me back to normal sizes.
>
> Any ideas?
>
> FTR downstream report:
> https://bugzilla.suse.com/show_bug.cgi?id=1244135
>
> thanks,
> --
> js
> suse labs
>
>
--
-----Open up your eyes, open up your mind, open up your code -------
/ Dr. David Alan Gilbert | Running GNU/Linux | Happy \
\ dave @ treblig.org | | In Hex /
\ _________________________|_____ http://www.treblig.org |_______/
next prev parent reply other threads:[~2025-06-05 14:39 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-27 16:05 [PATCH v4 0/6] Enable strict percpu address space checks Uros Bizjak
2025-01-27 16:05 ` [PATCH v4 1/6] x86/kgdb: Use IS_ERR_PCPU() macro Uros Bizjak
2025-01-27 16:05 ` [PATCH v4 2/6] compiler.h: Introduce TYPEOF_UNQUAL() macro Uros Bizjak
2025-01-27 16:05 ` [PATCH v4 3/6] percpu: Use TYPEOF_UNQUAL() in variable declarations Uros Bizjak
2025-01-27 16:05 ` [PATCH v4 4/6] percpu: Use TYPEOF_UNQUAL() in *_cpu_ptr() accessors Uros Bizjak
2025-01-27 16:05 ` [PATCH v4 5/6] percpu: Repurpose __percpu tag as a named address space qualifier Uros Bizjak
2025-01-27 16:05 ` [PATCH v4 6/6] percpu/x86: Enable strict percpu checks via named AS qualifiers Uros Bizjak
2025-04-09 11:07 ` Jiri Slaby
2025-04-09 11:43 ` Uros Bizjak
2025-04-09 15:09 ` H. Peter Anvin
2025-04-09 15:15 ` Uros Bizjak
2025-06-05 14:27 ` Large modules with 6.15 [was: [PATCH v4 6/6] percpu/x86: Enable strict percpu checks via named AS qualifiers] Jiri Slaby
2025-06-05 14:32 ` Jiri Slaby
2025-06-05 16:17 ` Alexei Starovoitov
2025-06-05 14:39 ` Dr. David Alan Gilbert [this message]
2025-06-05 17:15 ` Dave Hansen
2025-06-05 17:31 ` Uros Bizjak
2025-06-06 9:17 ` Jiri Slaby
2025-06-06 9:27 ` Uros Bizjak
2025-06-06 13:56 ` James Bottomley
2025-06-06 16:39 ` Alexei Starovoitov
2025-06-06 18:48 ` Uros Bizjak
2025-06-06 15:43 ` Dave Hansen
2025-06-07 8:52 ` Uros Bizjak
2025-06-07 14:12 ` Dave Hansen
2025-06-07 14:31 ` James Bottomley
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=aEGsLeUWj6_wiovf@gallifrey \
--to=linux@treblig.org \
--cc=bp@alien8.de \
--cc=brgerst@gmail.com \
--cc=cl@linux.com \
--cc=dave.hansen@linux.intel.com \
--cc=dennis@kernel.org \
--cc=hpa@zytor.com \
--cc=jirislaby@kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-bcachefs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=luto@kernel.org \
--cc=mingo@kernel.org \
--cc=nadav.amit@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=shung-hsi.yu@suse.com \
--cc=tglx@linutronix.de \
--cc=tj@kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=ubizjak@gmail.com \
--cc=x86@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.