Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4812550rwb; Mon, 31 Jul 2023 12:38:11 -0700 (PDT) X-Google-Smtp-Source: APBJJlGgtPeS3dU9mvVVI7ltcDlOuiSKuYYBkd0FTxr+9smWb9zjT2MkpwAlSK72zlF8TCJgSc7l X-Received: by 2002:a17:902:e847:b0:1b9:ea60:cd82 with SMTP id t7-20020a170902e84700b001b9ea60cd82mr12381756plg.5.1690832291515; Mon, 31 Jul 2023 12:38:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690832291; cv=none; d=google.com; s=arc-20160816; b=SXPimWWQyb91nH7rRUxc4mNfqGrlwa+07reADffv2y/vfwGP9PF6kCcQ+ECbUfitYG o8YNB5rH1Hlun5n+RlQzZf4Qzo7xUuC6fB9zxdIWHLAJpZOoyroIOQnjClMQ5iXYCWQO 4P57HJJj0Dpo5N+hqCMLi4G/RvhQV3BNhnJAWKd1MQueqQdk1Iy6ehzwYa8MvcrVEM9z 9+vvKEh1lkvXcUYMJHUx/0Cb/PoFgYdnD1A+evCE4cUAMXV/ZGhsnV8MwypSWkFEyuz3 MkTnan1S7SEgc6kvSi8WoybN5J3K2q7VuJSJunv9HEZitKxaDaWKpmLt+eZ9XmG8MaQO 70Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hJ3zzLVEI4QXPSwc/84yxSbSJjk1j3HDPakK1jLYA78=; fh=ZSnpN+KGcUa4W3WsFJ3piESg98J0ieUxtDNqUvrnhcs=; b=AyhX01iEuoYaiQ7UieI0Q/dWFfv0SyQzkENijVmIAyXktn1dnkE0HA8NcpbwBcKSbC FDHtTq8h9zhuXTs7XE4ePKQ457dSSpuWGFCgXHZMnSgoQr46+usVMn9HpWwNpZg2R2lW kd1n+9D2QjcIgzPOf62pfB8cXwMxrNPGhK/kz12yncejom3d/fXUJzFIb/Wsxgbxx0xT kx64MfKuHy/gRIctG2P3C65++1MPDOrNrGzmmFuKwilGXAmEx0sNLLe6XaP2aJridl6w OQOGuUO+VMdpC8AjhFcmgwF5cxoc4RgkjNL7XIW7JP+Bo5Uo2WewBfr5Sn9qNDHameCT v8Yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qNrewbNA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d9-20020a170903230900b0019c354055d0si7961534plh.304.2023.07.31.12.37.59; Mon, 31 Jul 2023 12:38:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qNrewbNA; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231434AbjGaTHa (ORCPT + 99 others); Mon, 31 Jul 2023 15:07:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231465AbjGaTH0 (ORCPT ); Mon, 31 Jul 2023 15:07:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F0C11BEF; Mon, 31 Jul 2023 12:07:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1C24C61277; Mon, 31 Jul 2023 19:07:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7B762C433CA; Mon, 31 Jul 2023 19:07:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690830438; bh=nmClbRXgHNUMiULKcf/Jk+DyC9Yg7VyUEy4VtDl2IjU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qNrewbNAX17gBaT9Awc7kLxyeODJt9zjauiKu558BxEajhl+UBhYRZwqRx6cWeHYn /zuVvbQaNBiuopq/kD+gx3SiMgrrB4MgcqFzkwka4tmMi/XAbA2FIpu1zJo3jHGMFS jhyimOaJ5FACsZvRjzfBSFnEPlg+YWjqbMAHWa9UE/JGz7oIMYGNYBV6v2pi6RxtNy TeakImoXcXW120Qu2jjSuApH00LkcbYkihQNLUz9k0og5rn3y7lNctSODiL9scopmi iB0tVmAKbMsbEb2SJqgvXUVTq2OVJTiNE9RZH6YtQ8C4wGrxz5CbDS2228aNpuQVLk 0MIPw+3+S2ZKg== Date: Mon, 31 Jul 2023 21:07:06 +0200 From: Simon Horman To: Joel Granados Cc: mcgrof@kernel.org, Catalin Marinas , Iurii Zaikin , Jozsef Kadlecsik , Sven Schnelle , Marcelo Ricardo Leitner , Steffen Klassert , Kees Cook , "D. Wythe" , mptcp@lists.linux.dev, Jakub Kicinski , Vasily Gorbik , Paolo Abeni , coreteam@netfilter.org, Jan Karcher , Alexander Aring , Will Deacon , Stefan Schmidt , Matthieu Baerts , bridge@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org, Joerg Reuter , Julian Anastasov , David Ahern , netfilter-devel@vger.kernel.org, Wen Gu , linux-kernel@vger.kernel.org, Santosh Shilimkar , linux-wpan@vger.kernel.org, lvs-devel@vger.kernel.org, Karsten Graul , Miquel Raynal , Herbert Xu , linux-sctp@vger.kernel.org, Tony Lu , Pablo Neira Ayuso , Ralf Baechle , Florian Westphal , willy@infradead.org, Heiko Carstens , "David S. Miller" , linux-rdma@vger.kernel.org, Roopa Prabhu , Alexander Gordeev , Simon Horman , Mat Martineau , josh@joshtriplett.org, Christian Borntraeger , Eric Dumazet , linux-hams@vger.kernel.org, Wenjia Zhang , linux-fsdevel@vger.kernel.org, linux-s390@vger.kernel.org, Xin Long , Nikolay Aleksandrov , netdev@vger.kernel.org, rds-devel@oss.oracle.com, Joel Granados Subject: Re: [PATCH v2 03/14] sysctl: Add ctl_table_size to ctl_table_header Message-ID: References: <20230731071728.3493794-1-j.granados@samsung.com> <20230731071728.3493794-4-j.granados@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 31, 2023 at 08:30:34PM +0200, Simon Horman wrote: > On Mon, Jul 31, 2023 at 09:17:17AM +0200, Joel Granados wrote: > > The new ctl_table_size element will hold the size of the ctl_table > > arrays contained in the ctl_table_header. This value should eventually > > be passed by the callers to the sysctl register infrastructure. And > > while this commit introduces the variable, it does not set nor use it > > because that requires case by case considerations for each caller. > > > > It provides two important things: (1) A place to put the > > result of the ctl_table array calculation when it gets introduced for > > each caller. And (2) the size that will be used as the additional > > stopping criteria in the list_for_each_table_entry macro (to be added > > when all the callers are migrated) > > > > Signed-off-by: Joel Granados > > --- > > include/linux/sysctl.h | 14 ++++++++++++-- > > 1 file changed, 12 insertions(+), 2 deletions(-) > > > > diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h > > index 59d451f455bf..33252ad58ebe 100644 > > --- a/include/linux/sysctl.h > > +++ b/include/linux/sysctl.h > > @@ -159,12 +159,22 @@ struct ctl_node { > > struct ctl_table_header *header; > > }; > > > > -/* struct ctl_table_header is used to maintain dynamic lists of > > - struct ctl_table trees. */ > > +/** > > + * struct ctl_table_header - maintains dynamic lists of struct ctl_table trees > > + * @ctl_table: pointer to the first element in ctl_table array > > + * @ctl_table_size: number of elements pointed by @ctl_table > > + * @used: The entry will never be touched when equal to 0. > > + * @count: Upped every time something is added to @inodes and downed every time > > + * something is removed from inodes > > + * @nreg: When nreg drops to 0 the ctl_table_header will be unregistered. > > + * @rcu: Delays the freeing of the inode. Introduced with "unfuck proc_sysctl ->d_compare()" > > + * > > + */ > > Hi Joel, > > Please consider also adding kernel doc entries for the other fields of > struct ctl_table_header. According to ./scripts/kernel-doc -none > they are: > > unregistering > ctl_table_arg > root > set > parent > node > inodes Sorry, I now realise that I made the same comment on v1. And I didn't see your response to that until after I wrote the above. > > > > struct ctl_table_header { > > union { > > struct { > > struct ctl_table *ctl_table; > > + int ctl_table_size; > > int used; > > int count; > > int nreg; > > -- > > 2.30.2 > >