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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 76077C74A5B for ; Tue, 21 Mar 2023 18:10:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230346AbjCUSKj (ORCPT ); Tue, 21 Mar 2023 14:10:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229993AbjCUSKg (ORCPT ); Tue, 21 Mar 2023 14:10:36 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BF7B5098D; Tue, 21 Mar 2023 11:10:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=rNKm/FBXON69zfkdwg//RKhKlf2JyDi+UDBM9ckgKRg=; b=47A0euJJt653yC1Zr//T2LCZsF VxQD/qUkuk7KqkLXEAgfcALylKhcWlwO4HBPhsCKu/BcK9QPry6z8D9EwWJlvt1KSjNZ2IMYnf2Fw zW9B0BkVxuDhRN8UB35h5Hb0f3pPhvstn1MG1O+YLauv/OG5eRauTYaaUCXDjyLXp6QFpA8gLy8BQ IJ0PTCRe/EsN4o1M02BlARQWDgIlUJEe6bOTJfmHC9oepaKIgA5/vDFFXPbJqRpG3+dVhGl7iP57U 7eJp7J/v+Ix2UOwnnLO02xKpPle9MhYkuxE0cM1vxRKWv3A2zkxq0xTNT2dfHvMgZhBziM7eTN/Ee Ty+FZILQ==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pegRG-00DJjO-00; Tue, 21 Mar 2023 18:10:26 +0000 Date: Tue, 21 Mar 2023 11:10:25 -0700 From: Luis Chamberlain To: Matthew Wilcox Cc: Yangtao Li , Alexander Viro , Christian Brauner , Andrew Morton , Kees Cook , Iurii Zaikin , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] fs/drop_caches: move drop_caches sysctls into its own file Message-ID: References: <20230321130908.6972-1-frank.li@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Luis Chamberlain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 21, 2023 at 05:19:18PM +0000, Matthew Wilcox wrote: > On Tue, Mar 21, 2023 at 09:56:03AM -0700, Luis Chamberlain wrote: > > On Tue, Mar 21, 2023 at 04:42:32PM +0000, Matthew Wilcox wrote: > > > On Tue, Mar 21, 2023 at 09:09:07PM +0800, Yangtao Li wrote: > > > > +static struct ctl_table drop_caches_table[] = { > > > > + { > > > > + .procname = "drop_caches", > > > > + .data = &sysctl_drop_caches, > > > > + .maxlen = sizeof(int), > > > > + .mode = 0200, > > > > + .proc_handler = drop_caches_sysctl_handler, > > > > + .extra1 = SYSCTL_ONE, > > > > + .extra2 = SYSCTL_FOUR, > > > > + }, > > > > + {} > > > > +}; > > > > > > Could we avoid doing this until we no longer need an entire zero entry > > > after the last one? > > > > That may be 2-3 kernel release from now. The way to use ARRAY_SIZE() > > really is to deprecate the crap APIs that allow messy directory sysctl > > structures. > > I'm OK with waiting another year to commence this cleanup. We've lived > with the giant tables for decades already. Better to get the new API > right than split the tables now, then have to touch all the places > again. We can do that sure. Luis