[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKPOu+_gcEmZuLc=H7mczc_PKq5YzsWkuu8Bdoyn7T1pi+RZiQ@mail.gmail.com>
Date: Mon, 9 Oct 2023 19:40:00 +0200
From: Max Kellermann <max.kellermann@...os.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Jens Axboe <axboe@...nel.dk>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Ilya Dryomov <idryomov@...il.com>,
Dongsheng Yang <dongsheng.yang@...ystack.cn>,
Dmitry Torokhov <dmitry.torokhov@...il.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
Rodolfo Giometti <giometti@...eenne.com>,
Alessandro Zummo <a.zummo@...ertech.it>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Jiri Slaby <jirislaby@...nel.org>,
Mark Fasheh <mark@...heh.com>,
Joel Becker <jlbec@...lplan.org>,
Joseph Qi <joseph.qi@...ux.alibaba.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
ceph-devel@...r.kernel.org, linux-input@...r.kernel.org,
linux-pci@...r.kernel.org, linux-rtc@...r.kernel.org,
linux-serial@...r.kernel.org, ocfs2-devel@...ts.linux.dev,
linux-mm@...ck.org
Subject: Re: [PATCH 7/7] block, drivers: make lots of attribute_group globals const
On Mon, Oct 9, 2023 at 7:30 PM Greg Kroah-Hartman
<gregkh@...uxfoundation.org> wrote:
>
> On Mon, Oct 09, 2023 at 06:57:40PM +0200, Max Kellermann wrote:
> > This moves those variables to the ".rodata" section which reduces the
> > kernel size a bit and protects the variables by putting them on
> > read-only pages at runtime.
>
> The kernel size should still be the same overall, you are just moving
> pointers from one section to another, right?
>
> If not, what are the numbers, show them please.
Before this patch series:
text data bss dec hex filename
10645342 6836166 12476420 29957928 1c91f28 vmlinux
After:
text data bss dec hex filename
10645342 6835398 12476420 29957160 1c91c28 vmlinux
(Config attached if you wish to reproduce. I'm using stock GCC from
Debian Bookworm.)
It's only a few hundred bytes, and I havn't really dug deep enough to
explain to you why this is - my goal was (semantic) const-correctness
and .rodata protection, but those numbers are a side effect that
exists.
> But step back, are you SURE you can make these attribute group pointers
> const? They are modified by some subsystems by adding or removing items
> from the lists, so why does the core need to change for that?
Some few do modify them, but they do not modify those pointers; they
allocate a new one (the 3 I sbumitted a patch for) or they modify
global variables (arch/pmu) which I'm not going to make "const". But
most globals can indeed be made "const".
Download attachment ".config" of type "application/octet-stream" (81166 bytes)
Powered by blists - more mailing lists