From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CDD5A11CBF for ; Wed, 21 Jun 2023 11:36:57 +0000 (UTC) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 191251733; Wed, 21 Jun 2023 04:36:53 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id C87691FDE8; Wed, 21 Jun 2023 11:36:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1687347411; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/FQApQPgb/S6VB9crvo39szrL+RZ0B9Iq9K2WpGCiTo=; b=iwyLnEK1VeUWv/tmm/Nm6Cx5NbYxgFmj0mH+P5/gDg9l9WiFHQ1aqfL3EEa87DHfpr/aUI PhCVJRawNs68LlACkkSmFEImXna0QGgLP5xUaED+wkuZFJn4wrg4DCWfOxgJw3/ea1pY1O C9tLa1Flx054EBbIvKK/ApG8ncbzfFo= Received: from suse.cz (unknown [10.100.201.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 144972C141; Wed, 21 Jun 2023 11:36:46 +0000 (UTC) Date: Wed, 21 Jun 2023 13:36:46 +0200 From: Petr Mladek To: Joel Granados Cc: mcgrof@kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Theodore Ts'o , "Jason A. Donenfeld" , Greg Kroah-Hartman , Jiri Slaby , Juergen Gross , Stefano Stabellini , Benjamin LaHaise , Alexander Viro , Christian Brauner , Jeff Layton , Chuck Lever , Jan Kara , Kees Cook , Iurii Zaikin , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Balbir Singh , Eric Biederman , "Naveen N. Rao" , Anil S Keshavamurthy , "David S. Miller" , Masami Hiramatsu , Peter Zijlstra , Will Deacon , Sergey Senozhatsky , Juri Lelli , Vincent Guittot , Steven Rostedt , Andrew Morton , Mike Kravetz , Muchun Song , Naoya Horiguchi , "Matthew Wilcox (Oracle)" , David Howells , Jarkko Sakkinen , Paul Moore , James Morris , "Serge E. Hallyn" , "H. Peter Anvin" , Oleksandr Tyshchenko , Amir Goldstein , John Fastabend , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Waiman Long , Boqun Feng , John Ogness , Dietmar Eggemann , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Andy Lutomirski , Will Drewry , Mark Rutland , Miaohe Lin , 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 Message-ID: References: <20230621091000.424843-1-j.granados@samsung.com> <20230621091000.424843-9-j.granados@samsung.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230621091000.424843-9-j.granados@samsung.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 65F31C001DB for ; Wed, 28 Jun 2023 15:16:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=A7Fu29udPjrjmAvMBIkUYeKThD8/2TsVp6dnlC/XloQ=; b=SUXP0UdHiblgjF 4zbXM+FQVUlna5dcHhXPILmImp8ZXNvNjKtu2XLe+SlfrQeLGXjMmduhGLc4ZGsWa71VRozzXtTZy iwGsOlchqZNEwyb+PZjH8VSrsV4ItQsyWPj0lQOjH8ZfnxWT7HoTTeGFk/qpOhH759l9MbJB2KJMH wmfmAdDWiqpVpalH6KLgQ+u6wsu4rklI910fjZPz1UUfGugrDXh9r6WDmOfgdWsWhZR0V833U9B7D BaZWxyphmh0jUocKu/1xCScMPeonc2AoHpYruKWzmTECc07xNdrNxJuj6tA578gU2FU0mNjx6j6GJ /e/HZ+Jz4N+osLGBwttw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qEWuT-00Fx5f-1W; Wed, 28 Jun 2023 15:16:45 +0000 Received: from smtp-out2.suse.de ([2001:67c:2178:6::1d]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qBw8t-00EPRe-13 for kexec@lists.infradead.org; Wed, 21 Jun 2023 11:36:56 +0000 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id C87691FDE8; Wed, 21 Jun 2023 11:36:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1687347411; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=/FQApQPgb/S6VB9crvo39szrL+RZ0B9Iq9K2WpGCiTo=; b=iwyLnEK1VeUWv/tmm/Nm6Cx5NbYxgFmj0mH+P5/gDg9l9WiFHQ1aqfL3EEa87DHfpr/aUI PhCVJRawNs68LlACkkSmFEImXna0QGgLP5xUaED+wkuZFJn4wrg4DCWfOxgJw3/ea1pY1O C9tLa1Flx054EBbIvKK/ApG8ncbzfFo= Received: from suse.cz (unknown [10.100.201.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 144972C141; Wed, 21 Jun 2023 11:36:46 +0000 (UTC) Date: Wed, 21 Jun 2023 13:36:46 +0200 From: Petr Mladek To: Joel Granados Cc: mcgrof@kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, Theodore Ts'o , "Jason A. Donenfeld" , Greg Kroah-Hartman , Jiri Slaby , Juergen Gross , Stefano Stabellini , Benjamin LaHaise , Alexander Viro , Christian Brauner , Jeff Layton , Chuck Lever , Jan Kara , Kees Cook , Iurii Zaikin , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Balbir Singh , Eric Biederman , "Naveen N. Rao" , Anil S Keshavamurthy , "David S. Miller" , Masami Hiramatsu , Peter Zijlstra , Will Deacon , Sergey Senozhatsky , Juri Lelli , Vincent Guittot , Steven Rostedt , Andrew Morton , Mike Kravetz , Muchun Song , Naoya Horiguchi , "Matthew Wilcox (Oracle)" , David Howells , Jarkko Sakkinen , Paul Moore , James Morris , "Serge E. Hallyn" , "H. Peter Anvin" , Oleksandr Tyshchenko , Amir Goldstein , John Fastabend , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Waiman Long , Boqun Feng , John Ogness , Dietmar Eggemann , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Andy Lutomirski , Will Drewry , Mark Rutland , Miaohe Lin , 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 Message-ID: References: <20230621091000.424843-1-j.granados@samsung.com> <20230621091000.424843-9-j.granados@samsung.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230621091000.424843-9-j.granados@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230621_043655_526479_942A066B X-CRM114-Status: GOOD ( 20.34 ) X-Mailman-Approved-At: Wed, 28 Jun 2023 08:16:38 -0700 X-BeenThere: kexec@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "kexec" Errors-To: kexec-bounces+kexec=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec