From: Petr Mladek <pmladek@suse.com>
To: Joel Granados <j.granados@samsung.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 13:36:46 +0200 [thread overview]
Message-ID: <ZJLgzo1GuykDV8fd@alley> (raw)
In-Reply-To: <20230621091000.424843-9-j.granados@samsung.com>
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 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.
And the code with the added ARRAY_SIZE() parameter looks worse than before.
> 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,
please? I am not in Cc on the related patches.
Best Regards,
Petr
next prev parent reply other threads:[~2023-06-21 11:37 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20230621091000.424843-1-j.granados@samsung.com>
[not found] ` <CGME20230621091004eucas1p2e53ad3001cdaef7b3c44555653bbec37@eucas1p2.samsung.com>
2023-06-21 9:09 ` [PATCH 01/11] sysctl: Prefer ctl_table_header in proc_sysctl Joel Granados
[not found] ` <CGME20230621091007eucas1p2271595a5889075994e8dceb0c06ae7cc@eucas1p2.samsung.com>
2023-06-21 9:09 ` [PATCH 02/11] sysctl: Use the ctl header in list ctl_table macro Joel Granados
[not found] ` <CGME20230621091009eucas1p1e4fa56beb44e49e4d1160bfac6eb59ec@eucas1p1.samsung.com>
2023-06-21 9:09 ` [PATCH 03/11] sysctl: Add ctl_table_size to ctl_table_header Joel Granados
[not found] ` <CGME20230621091011eucas1p2116c1fb8f406bec7ca9a831f66955724@eucas1p2.samsung.com>
2023-06-21 9:09 ` [PATCH 04/11] sysctl: Add size argument to init_header Joel Granados
[not found] ` <CGME20230621091014eucas1p1a30430568d0f7fec5ccbed31cab73aa0@eucas1p1.samsung.com>
2023-06-21 9:09 ` [PATCH 05/11] sysctl: Add a size arg to __register_sysctl_table Joel Granados
2023-06-21 20:53 ` Jakub Kicinski
2023-06-22 14:09 ` Joel Granados
[not found] ` <CGME20230621091029eucas1p2f9fd694dae3dfbdfffd25dccf4fcb568@eucas1p2.samsung.com>
2023-06-21 9:09 ` [PATCH 07/11] sysctl: Add size to register_sysctl Joel Granados
[not found] ` <CGME20230621091037eucas1p188e11d8064526a5a0549217d5a419647@eucas1p1.samsung.com>
2023-06-21 9:09 ` [PATCH 08/11] sysctl: Add size to register_sysctl_init 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 [this message]
2023-06-21 15:30 ` Joel Granados
[not found] ` <CGME20230621094824eucas1p2b6adfbd3f15ff3665674917f419b25d3@eucas1p2.samsung.com>
2023-06-21 9:48 ` [PATCH 09/11] sysctl: Remove the end element in sysctl table arrays Joel Granados
[not found] ` <CGME20230621094825eucas1p2d37372e5bd2377bfe953e6e4f7ff0363@eucas1p2.samsung.com>
2023-06-21 9:48 ` [PATCH 10/11] sysctl: Remove nr_entries from new_links Joel Granados
[not found] ` <CGME20230621094828eucas1p22b0b45adc25f881fe00a20d96d495d95@eucas1p2.samsung.com>
2023-06-21 9:48 ` [PATCH 11/11] sysctl: rm "child" from __register_sysctl_table doc Joel Granados
2023-06-21 11:16 ` [PATCH 09/11] sysctl: Remove the end element in sysctl table arrays Jani Nikula
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=ZJLgzo1GuykDV8fd@alley \
--to=pmladek@suse.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=j.granados@samsung.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=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;
as well as URLs for NNTP newsgroup(s).