[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 08/11] sysctl: Add size to register_sysctl_init
- To: Petr Mladek <pmladek@xxxxxxxx>
- From: Joel Granados <j.granados@xxxxxxxxxxx>
- Date: Wed, 21 Jun 2023 17:30:08 +0200
- Cc: <mcgrof@xxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, <x86@xxxxxxxxxx>, Theodore Ts'o <tytso@xxxxxxx>, "Jason A. Donenfeld" <Jason@xxxxxxxxx>, Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>, Jiri Slaby <jirislaby@xxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Benjamin LaHaise <bcrl@xxxxxxxxx>, Alexander Viro <viro@xxxxxxxxxxxxxxxxxx>, Christian Brauner <brauner@xxxxxxxxxx>, Jeff Layton <jlayton@xxxxxxxxxx>, Chuck Lever <chuck.lever@xxxxxxxxxx>, Jan Kara <jack@xxxxxxx>, Kees Cook <keescook@xxxxxxxxxxxx>, Iurii Zaikin <yzaikin@xxxxxxxxxx>, Alexei Starovoitov <ast@xxxxxxxxxx>, Daniel Borkmann <daniel@xxxxxxxxxxxxx>, Andrii Nakryiko <andrii@xxxxxxxxxx>, Balbir Singh <bsingharora@xxxxxxxxx>, Eric Biederman <ebiederm@xxxxxxxxxxxx>, "Naveen N. Rao" <naveen.n.rao@xxxxxxxxxxxxx>, Anil S Keshavamurthy <anil.s.keshavamurthy@xxxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, Masami Hiramatsu <mhiramat@xxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Will Deacon <will@xxxxxxxxxx>, Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx>, Juri Lelli <juri.lelli@xxxxxxxxxx>, Vincent Guittot <vincent.guittot@xxxxxxxxxx>, Steven Rostedt <rostedt@xxxxxxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Mike Kravetz <mike.kravetz@xxxxxxxxxx>, Muchun Song <muchun.song@xxxxxxxxx>, Naoya Horiguchi <naoya.horiguchi@xxxxxxx>, "Matthew Wilcox (Oracle)" <willy@xxxxxxxxxxxxx>, David Howells <dhowells@xxxxxxxxxx>, Jarkko Sakkinen <jarkko@xxxxxxxxxx>, Paul Moore <paul@xxxxxxxxxxxxxx>, James Morris <jmorris@xxxxxxxxx>, "Serge E. Hallyn" <serge@xxxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, Oleksandr Tyshchenko <oleksandr_tyshchenko@xxxxxxxx>, Amir Goldstein <amir73il@xxxxxxxxx>, John Fastabend <john.fastabend@xxxxxxxxx>, Martin KaFai Lau <martin.lau@xxxxxxxxx>, Song Liu <song@xxxxxxxxxx>, Yonghong Song <yhs@xxxxxx>, KP Singh <kpsingh@xxxxxxxxxx>, Stanislav Fomichev <sdf@xxxxxxxxxx>, Hao Luo <haoluo@xxxxxxxxxx>, Jiri Olsa <jolsa@xxxxxxxxxx>, Waiman Long <longman@xxxxxxxxxx>, Boqun Feng <boqun.feng@xxxxxxxxx>, John Ogness <john.ogness@xxxxxxxxxxxxx>, Dietmar Eggemann <dietmar.eggemann@xxxxxxx>, Ben Segall <bsegall@xxxxxxxxxx>, Mel Gorman <mgorman@xxxxxxx>, Daniel Bristot de Oliveira <bristot@xxxxxxxxxx>, Valentin Schneider <vschneid@xxxxxxxxxx>, Andy Lutomirski <luto@xxxxxxxxxxxxxx>, Will Drewry <wad@xxxxxxxxxxxx>, Mark Rutland <mark.rutland@xxxxxxx>, Miaohe Lin <linmiaohe@xxxxxxxxxx>, <linux-kernel@xxxxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, <linux-aio@xxxxxxxxx>, <linux-fsdevel@xxxxxxxxxxxxxxx>, <linux-mm@xxxxxxxxx>, <bpf@xxxxxxxxxxxxxxx>, <kexec@xxxxxxxxxxxxxxxxxxx>, <linux-trace-kernel@xxxxxxxxxxxxxxx>, <keyrings@xxxxxxxxxxxxxxx>, <linux-security-module@xxxxxxxxxxxxxxx>
- Cms-type: 201P
- Delivery-date: Wed, 21 Jun 2023 15:30:21 +0000
- Dkim-filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230621153011euoutp01192645862d3e0a543891af4b47de94a9~qtkOS32Qw0899308993euoutp01Q
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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:
signature.asc
Description: PGP signature
|