Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp4806553rwb; Mon, 31 Jul 2023 12:31:24 -0700 (PDT) X-Google-Smtp-Source: APBJJlFqeXe/nvtlnI0/RsplZ/aTTPpVsSoUkVRf10tFu3ei7fAa3UsR+VW4Q/EEducf7i/7t5aU X-Received: by 2002:a05:6a20:3206:b0:13b:b111:6d13 with SMTP id hl6-20020a056a20320600b0013bb1116d13mr9585561pzc.5.1690831883984; Mon, 31 Jul 2023 12:31:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690831883; cv=none; d=google.com; s=arc-20160816; b=m8sFS6M+Ds7O8vqk7KrufGZSv0FUFEzXmDtsTBSc90FUmmB/1wGHBFg3J8vnGPEm9+ ZfOwS8XZsqJmciTc1h0GetiFmnDwS1PUim9zc44sfnKUgF6qM+/3xJa52pvrnVuUOyuV gzlTK2bPpkfLXNqrK2WEkIAAExL5jm6dIV0YPwQloLZft1AxHpZoLviIWynoSjO2vzg3 /qQ3Sz8gR4DKlhWWHFypqUXA/37KTYw2nd9eGVHF02S43St5SiXf6NGrh7hCAo101tGa nsj/TVSeFMQ/6YHaYUqXgN8XbDaUl14rI+javUgc33xP2KV81dAtk1W7B+UZ60APHWF6 mM1A== 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=UXcRdKdmdLQARtynicm0YnCjYrF7XneoQkkjLSZuBtI=; fh=ZSnpN+KGcUa4W3WsFJ3piESg98J0ieUxtDNqUvrnhcs=; b=ZaV1DRuarq6AwMRGiGNvF4ztpko3qlmyk/CyGQRj2AYCEo/rm9W42TNgM0QSiLl+O4 6zefDZxBJ6kGiCjc10SN+b2P7Z4dr788lDhqm8a2C8kfjF6l+jrfM+YJ0n32aeEyOfAo N2eAjbjrM7t+WK4CpddCiUvafhD8VS4V6q3BeRhz/RMCO3AlE1rDYOYfW3ItiGAhNgbc b1OKfsWevIeGhLOvI6wIA4sfSEfc/2pLWSuGzjg/RomkwNIrd3Be7ojLj61Rap7G4oiR 8P8aEpaz/CTu+EDJoW3Ur4XNYTuuilacOqR1WwT24SgTyPZfM7ja7YH88K6bH+b40j3I +MrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=O1VpJucJ; 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 u3-20020a627903000000b00686f6b403fesi3406100pfc.214.2023.07.31.12.31.12; Mon, 31 Jul 2023 12:31:23 -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=O1VpJucJ; 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 S231913AbjGaSaj (ORCPT + 99 others); Mon, 31 Jul 2023 14:30:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231898AbjGaSag (ORCPT ); Mon, 31 Jul 2023 14:30:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94ECB1BC3; Mon, 31 Jul 2023 11:30:35 -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 DAE5061245; Mon, 31 Jul 2023 18:30:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 082BDC433C7; Mon, 31 Jul 2023 18:30:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690828234; bh=azdNP8cF85m7UDvgXMTAEEGyM/wWyMIGFgmuwIc8ul0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=O1VpJucJ8qJ4G6AE1OKV3xdN/xK/FDklzv/nwqYZajcZtRy+LSUQU50X+sHs9AxvB xsU2buC2SUK4CZR3jjYJZtrydR9Bbqd9WCPwdG5zMYEjJLfGD0nXQIDtdar/ei7qKh Q4AFqyXfVyBH57dywLI4uw0Frcitouu9e42wpiwCGypovk04FOzCfl60zxzFG2eyak ANZHJkor5YlN+5saTB/xwrXYhgw16Q93h89m9IIkWKyhNAHwsbqX1ZrfONEa6iuY6k btG9dsvLFpB0/w7f/xaTE6xEYGtgYWH7rF7vGs2JSC6YVtwrN6iixwxcTNdpmmdRV2 wiQHQ/+OXxCxw== Date: Mon, 31 Jul 2023 20:30:21 +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: <20230731071728.3493794-4-j.granados@samsung.com> 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 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 > struct ctl_table_header { > union { > struct { > struct ctl_table *ctl_table; > + int ctl_table_size; > int used; > int count; > int nreg; > -- > 2.30.2 >