From: Joel Granados <j.granados@samsung.com>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: Kees Cook <keescook@chromium.org>,
Iurii Zaikin <yzaikin@google.com>, <willy@infradead.org>,
<josh@joshtriplett.org>, <linux-kernel@vger.kernel.org>,
<linux-fsdevel@vger.kernel.org>, <netdev@vger.kernel.org>
Subject: Re: [PATCH 00/14] sysctl: Add a size argument to register functions in sysctl
Date: Thu, 27 Jul 2023 13:43:18 +0200 [thread overview]
Message-ID: <20230727114318.q5hxwwnjbwhm37wn@localhost> (raw)
In-Reply-To: <ZMFizKFkVxUFtSqa@bombadil.infradead.org>
[-- Attachment #1: Type: text/plain, Size: 3312 bytes --]
On Wed, Jul 26, 2023 at 11:15:40AM -0700, Luis Chamberlain wrote:
> On Wed, Jul 26, 2023 at 04:06:20PM +0200, Joel Granados wrote:
> > What?
> > These commits set things up so we can start removing the sentinel elements.
>
> Yes but the why must explained right away.
My intention of putting the "what" first was to explain the chunking and
clarify right away that what was contained in the "why" was not for this
chunk but for the *whole* patchset.
I have swapped them in my cover letter as I can see that the ambiguity
is gone once you start reading the "what"
>
> > Why?
> > This is part of the push to trim down kernel/sysctl.c by moving the large array
> > that was causing merge conflicts.
>
> Let me elaborate on that:
>
> While the move moving over time of array elements out of kernel/sysctl.c
> to their own place helps merge conflicts this patch set does not help
> with that in and of itself, what it does is help make sure the move of
> sysctls to their own files does not bloat the kernel more, and in fact
> helps reduce the overall build time size of the kernel and run time
> memory consumed by the kernel by about ~64 bytes per array.
>
> Without this patch set each time we moved a set of sysctls out of
> kernel/sysctl.c to its own subsystem we'd have to add a new sentinel
> element (an empty sysctl entry), and while that helps clean up
> kernel/sysctl.c to avoid merge conflicts, it also bloats the kernel
> by about 64 bytes on average each time.
>
> We can do better. We can make those moves *not* have a size penalty, and
> all around also reduce the build / run time of the kernel.
>
> *This* is the why, that if we don't do this the cleanup of
> kernel/sysctl.c ends up slowly bloating the kernel. Willy had
> suggested we instead remove the sentinel so that each move does not
> incur a size penalty, but also that in turn reduces the size of the
> kernel at build time / run time by a ballpark about ~64 bytes per
> array.
Thx for this.
This is a more clear wording for the "Why". Do you mind if I copy/paste
it (with some changes to make it flow) into my next cover letter?
>
> Then the following is more details about estimates of overall size
> savings, it's not miscellaneous information at all, it's very relevant
> information to this patch set.
Did not mean to downplay the importance here. Just did not have a good
title for the section. I'll change it to "Size saving estimates".
>
> > Misc:
> > A consequence of eventually removing all the sentinels (64 bytes per sentinel)
> > is the bytes we save. Here I include numbers for when all sentinels are removed
> > to contextualize this chunk
> > * bloat-o-meter:
> > The "yesall" configuration results save 9158 bytes (you can see the output here
> > https://lore.kernel.org/all/20230621091000.424843-1-j.granados@samsung.com/.
> > The "tiny" configuration + CONFIG_SYSCTL save 1215 bytes (you can see the
> > output here [2])
> > * memory usage:
> > As we no longer need the sentinel element within proc_sysctl.c, we save some
> > bytes in main memory as well. In my testing kernel I measured a difference of
> > 6720 bytes. I include the way to measure this in [1]
>
> Luis
--
best
Joel Granados
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
next prev parent reply other threads:[~2023-07-27 11:43 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20230726140656eucas1p26cd9da21663d25b51dda75258aaa3b55@eucas1p2.samsung.com>
[not found] ` <20230726140635.2059334-1-j.granados@samsung.com>
2023-07-26 14:06 ` [PATCH 05/14] sysctl: Add a size arg to __register_sysctl_table Joel Granados
2023-07-28 10:51 ` Simon Horman
2023-07-28 16:08 ` Joel Granados
2023-07-26 14:06 ` [PATCH 06/14] sysctl: Add size to register_sysctl Joel Granados
2023-07-26 17:58 ` Luis Chamberlain
2023-07-27 12:22 ` Joel Granados
2023-07-27 15:42 ` Luis Chamberlain
2023-07-28 7:41 ` Joel Granados
2023-07-26 14:06 ` [PATCH 08/14] sysctl: Add size to register_net_sysctl function Joel Granados
2023-07-26 14:06 ` [PATCH 09/14] ax.25: Update to register_net_sysctl_sz Joel Granados
2023-07-26 18:00 ` Luis Chamberlain
2023-07-27 12:31 ` Joel Granados
2023-07-27 15:44 ` Luis Chamberlain
2023-07-28 7:35 ` Joel Granados
2023-07-28 18:16 ` Luis Chamberlain
2023-07-31 7:09 ` Joel Granados
2023-07-27 15:38 ` Joel Granados
2023-07-27 15:50 ` Luis Chamberlain
2023-07-26 14:06 ` [PATCH 10/14] netfilter: " Joel Granados
2023-07-26 18:01 ` Luis Chamberlain
2023-07-26 14:06 ` [PATCH 11/14] networking: " Joel Granados
2023-07-26 18:05 ` Luis Chamberlain
2023-07-27 0:33 ` David Ahern
2023-07-27 12:33 ` Joel Granados
2023-07-28 7:08 ` Joel Granados
2023-07-26 14:06 ` [PATCH 12/14] vrf: " Joel Granados
2023-07-26 14:06 ` [PATCH 13/14] sysctl: SIZE_MAX->ARRAY_SIZE in register_net_sysctl Joel Granados
2023-07-26 18:15 ` [PATCH 00/14] sysctl: Add a size argument to register functions in sysctl Luis Chamberlain
2023-07-27 11:43 ` Joel Granados [this message]
2023-07-27 15:39 ` Luis Chamberlain
2023-07-28 7:04 ` Joel Granados
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=20230727114318.q5hxwwnjbwhm37wn@localhost \
--to=j.granados@samsung.com \
--cc=josh@joshtriplett.org \
--cc=keescook@chromium.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=willy@infradead.org \
--cc=yzaikin@google.com \
/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