From: Joel Granados <j.granados@samsung.com>
To: Petr Mladek <pmladek@suse.com>
Cc: <mcgrof@kernel.org>, Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>, <x86@kernel.org>,
Theodore Ts'o <tytso@mit.edu>,
"Jason A. Donenfeld" <Jason@zx2c4.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jirislaby@kernel.org>,
Juergen Gross <jgross@suse.com>,
Stefano Stabellini <sstabellini@kernel.org>,
Benjamin LaHaise <bcrl@kvack.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Christian Brauner <brauner@kernel.org>,
Jeff Layton <jlayton@kernel.org>,
Chuck Lever <chuck.lever@oracle.com>, Jan Kara <jack@suse.cz>,
Kees Cook <keescook@chromium.org>,
Iurii Zaikin <yzaikin@google.com>,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Balbir Singh <bsingharora@gmail.com>,
Eric Biederman <ebiederm@xmission.com>,
"Naveen N. Rao" <naveen.n.rao@linux.ibm.com>,
Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
"David S. Miller" <davem@davemloft.net>,
Masami Hiramatsu <mhiramat@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Will Deacon <will@kernel.org>,
Sergey Senozhatsky <senozhatsky@chromium.org>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Steven Rostedt <rostedt@goodmis.org>,
Andrew Morton <akpm@linux-foundation.org>,
Mike Kravetz <mike.kravetz@oracle.com>,
Muchun Song <muchun.song@linux.dev>,
Naoya Horiguchi <naoya.horiguchi@nec.com>,
"Matthew Wilcox (Oracle)" <willy@infradead.org>,
David Howells <dhowells@redhat.com>,
Jarkko Sakkinen <jarkko@kernel.org>,
Paul Moore <paul@paul-moore.com>,
James Morris <jmorris@namei.org>,
"Serge E. Hallyn" <serge@hallyn.com>,
"H. Peter Anvin" <hpa@zytor.com>,
Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com>,
Amir Goldstein <amir73il@gmail.com>,
John Fastabend <john.fastabend@gmail.com>,
Martin KaFai Lau <martin.lau@linux.dev>,
Song Liu <song@kernel.org>, Yonghong Song <yhs@fb.com>,
KP Singh <kpsingh@kernel.org>,
Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>,
Jiri Olsa <jolsa@kernel.org>, Waiman Long <longman@redhat.com>,
Boqun Feng <boqun.feng@gmail.com>,
John Ogness <john.ogness@linutronix.de>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
Daniel Bristot de Oliveira <bristot@redhat.com>,
Valentin Schneider <vschneid@redhat.com>,
Andy Lutomirski <luto@amacapital.net>,
Will Drewry <wad@chromium.org>,
Mark Rutland <mark.rutland@arm.com>,
Miaohe Lin <linmiaohe@huawei.com>, <linux-kernel@vger.kernel.org>,
<xen-devel@lists.xenproject.org>, <linux-aio@kvack.org>,
<linux-fsdevel@vger.kernel.org>, <linux-mm@kvack.org>,
<bpf@vger.kernel.org>, <kexec@lists.infradead.org>,
<linux-trace-kernel@vger.kernel.org>, <keyrings@vger.kernel.org>,
<linux-security-module@vger.kernel.org>
Subject: Re: [PATCH 08/11] sysctl: Add size to register_sysctl_init
Date: Wed, 21 Jun 2023 17:30:08 +0200 [thread overview]
Message-ID: <20230621153008.lpxi5gh6fzvammg5@localhost> (raw)
In-Reply-To: <ZJLgzo1GuykDV8fd@alley>
[-- Attachment #1: Type: text/plain, Size: 2019 bytes --]
On Wed, Jun 21, 2023 at 01:36:46PM +0200, Petr Mladek wrote:
> On Wed 2023-06-21 11:09:57, Joel Granados wrote:
> > In order to remove the end element from the ctl_table struct arrays, we
> > explicitly define the size when registering the targes. We add a size
> > argument to the register_sysctl_init call and pass an ARRAY_SIZE for all
> > the callers.
>
> This does not explain the motivatin why the end element is removed.
I also see that the cover letter also lacks this. Let me clarify in my
V2.
>
> I agree with Jiri that saving 9k is a questionable gain. According to
> the cover letter it saved 0,00%. It is because it saved 9k with allyes
> config which produces huge kernel. IMHO, the 9k might be interesting
> only for a tiny kernel. But I guess that it would safe much less
> bytes there.
I put the 9K as a upper bound kind of value. To get an idea of exactly
how much we are talking about. A lower bound with tiny config and sysctl
enabled is a good idea to give a range.
>
> And the code with the added ARRAY_SIZE() parameter looks worse than before.
This might not even be an issue in V2. After analysing Greg's feedback,
these might just go away.
>
> > diff --git a/kernel/printk/sysctl.c b/kernel/printk/sysctl.c
> > index c228343eeb97..28f37b86414e 100644
> > --- a/kernel/printk/sysctl.c
> > +++ b/kernel/printk/sysctl.c
> > @@ -81,5 +81,6 @@ static struct ctl_table printk_sysctls[] = {
> >
> > void __init printk_sysctl_init(void)
> > {
> > - register_sysctl_init("kernel", printk_sysctls);
> > + register_sysctl_init("kernel", printk_sysctls,
> > + ARRAY_SIZE(printk_sysctls));
> > }
>
> Is register_sysctl_init() still ready to handle the last empty element,
nope, after all the patch set, this functionality would be gone.
> please? I am not in Cc on the related patches.
Not sure what happened there. Should I just add you for the next batch?
>
> Best Regards,
> Petr
Thx for the feedback
Best
--
Joel Granados
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
prev parent reply other threads:[~2023-06-21 15:30 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230621091000.424843-1-j.granados@samsung.com>
[not found] ` <CGME20230621091037eucas1p188e11d8064526a5a0549217d5a419647@eucas1p1.samsung.com>
2023-06-21 9:09 ` Joel Granados
2023-06-21 9:56 ` Jiri Slaby
2023-06-21 13:11 ` Joel Granados
2023-06-22 4:25 ` Jiri Slaby
2023-06-22 13:59 ` Joel Granados
2023-06-21 10:47 ` Greg Kroah-Hartman
2023-06-21 13:15 ` Joel Granados
2023-06-22 4:21 ` Jiri Slaby
2023-06-22 14:00 ` Joel Granados
2023-06-23 15:20 ` Petr Mladek
2023-06-21 11:36 ` Petr Mladek
2023-06-21 15:30 ` Joel Granados [this message]
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=20230621153008.lpxi5gh6fzvammg5@localhost \
--to=j.granados@samsung.com \
--cc=Jason@zx2c4.com \
--cc=akpm@linux-foundation.org \
--cc=amir73il@gmail.com \
--cc=andrii@kernel.org \
--cc=anil.s.keshavamurthy@intel.com \
--cc=ast@kernel.org \
--cc=bcrl@kvack.org \
--cc=boqun.feng@gmail.com \
--cc=bp@alien8.de \
--cc=bpf@vger.kernel.org \
--cc=brauner@kernel.org \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=bsingharora@gmail.com \
--cc=chuck.lever@oracle.com \
--cc=daniel@iogearbox.net \
--cc=dave.hansen@linux.intel.com \
--cc=davem@davemloft.net \
--cc=dhowells@redhat.com \
--cc=dietmar.eggemann@arm.com \
--cc=ebiederm@xmission.com \
--cc=gregkh@linuxfoundation.org \
--cc=haoluo@google.com \
--cc=hpa@zytor.com \
--cc=jack@suse.cz \
--cc=jarkko@kernel.org \
--cc=jgross@suse.com \
--cc=jirislaby@kernel.org \
--cc=jlayton@kernel.org \
--cc=jmorris@namei.org \
--cc=john.fastabend@gmail.com \
--cc=john.ogness@linutronix.de \
--cc=jolsa@kernel.org \
--cc=juri.lelli@redhat.com \
--cc=keescook@chromium.org \
--cc=kexec@lists.infradead.org \
--cc=keyrings@vger.kernel.org \
--cc=kpsingh@kernel.org \
--cc=linmiaohe@huawei.com \
--cc=linux-aio@kvack.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-security-module@vger.kernel.org \
--cc=linux-trace-kernel@vger.kernel.org \
--cc=longman@redhat.com \
--cc=luto@amacapital.net \
--cc=mark.rutland@arm.com \
--cc=martin.lau@linux.dev \
--cc=mcgrof@kernel.org \
--cc=mgorman@suse.de \
--cc=mhiramat@kernel.org \
--cc=mike.kravetz@oracle.com \
--cc=mingo@redhat.com \
--cc=muchun.song@linux.dev \
--cc=naoya.horiguchi@nec.com \
--cc=naveen.n.rao@linux.ibm.com \
--cc=oleksandr_tyshchenko@epam.com \
--cc=paul@paul-moore.com \
--cc=peterz@infradead.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=sdf@google.com \
--cc=senozhatsky@chromium.org \
--cc=serge@hallyn.com \
--cc=song@kernel.org \
--cc=sstabellini@kernel.org \
--cc=tglx@linutronix.de \
--cc=tytso@mit.edu \
--cc=vincent.guittot@linaro.org \
--cc=viro@zeniv.linux.org.uk \
--cc=vschneid@redhat.com \
--cc=wad@chromium.org \
--cc=will@kernel.org \
--cc=willy@infradead.org \
--cc=x86@kernel.org \
--cc=xen-devel@lists.xenproject.org \
--cc=yhs@fb.com \
--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