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 426AAC761AF for ; Tue, 21 Mar 2023 14:37:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231229AbjCUOhT (ORCPT ); Tue, 21 Mar 2023 10:37:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229844AbjCUOhP (ORCPT ); Tue, 21 Mar 2023 10:37:15 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD2884DBFD; Tue, 21 Mar 2023 07:37:14 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id eh3so60503145edb.11; Tue, 21 Mar 2023 07:37:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679409433; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=iHEqN7BarmB0XfV9NF5gycuaqpBq0s3WoFUcLxi5+4k=; b=VGvMDHg7IAZVxzH2gfoNgMSOji5IfjSe5JCEZiAbT7Ro12HxXutcQs3nrUqMrmZaQa YTjVp2EgGLLiDw6JuPaXagf+kufzeJNwYYYLUs0fk7VA/aD/pax06JOC2gsjHDAXPntV cfNRwERJFhpsYBbF/Vwvjh6s34xtgWvWcko31v4S0Oeqwq2N2NzgoJ1Fye42plrr2Ypj nGtABjWvI/3YVwzxii7IzcVFIXGMfK9v4SXSrlFLf1g09Ka+U3qKrVzH5PffZpj3N+5v M/ZbS6B/UiQpB1a392GUZonq7hdTT+iANRtaXP+0pfqFy7Hi88K244RqT7o2MTOOdBxR bEeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679409433; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iHEqN7BarmB0XfV9NF5gycuaqpBq0s3WoFUcLxi5+4k=; b=FNhMuE8NoUGkJ37xEev8Kxn7OdjrKXArWu2zNlcwrP+OJRtwN9R2iuq+BRJ0WgJLb3 +SxD5ninrj7MfKlBidMCe+QZFFLq23HttZ/DYbktJEX4O+vCqZQNRyrb7E/QNImt0PYj uHbVhJdhS1/hLr4NZ1LIDmB23SBrLwc8glo82PhQTiE1vy4Cb9d3woFO8lPcF7TcMbDy v550RXWo+d89nKIEqwnfQfRglvKA8q00JVABA7FwIbjQC944birCinBFo0MSdDldAmMu uAsMMLSd/0Q7fXirkUOXgJxkCTFIBW74KTuk7Yw5fCAjvikWGA6wWWocpT1QwKqXK9+x 9FlA== X-Gm-Message-State: AO0yUKXE3dZh2B549QvAFveaVJWvJra6RCzWrmLVOxc96q4SVnTOnaHu ZNu2apl4kI9PgP3goZ0tTg== X-Google-Smtp-Source: AK7set/uV6swtI6Cha2IBxu6FSeT/CGJESekpZ8We0l6hTyn2lZuhQ5yhr67rv0UD8ZpLfE8F26Xvw== X-Received: by 2002:a17:906:2e8e:b0:933:44ef:e5b5 with SMTP id o14-20020a1709062e8e00b0093344efe5b5mr3716363eji.30.1679409432985; Tue, 21 Mar 2023 07:37:12 -0700 (PDT) Received: from p183 ([46.53.248.97]) by smtp.gmail.com with ESMTPSA id f3-20020a17090624c300b0092a59ee224csm5828944ejb.185.2023.03.21.07.37.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Mar 2023 07:37:12 -0700 (PDT) Date: Tue, 21 Mar 2023 17:37:10 +0300 From: Alexey Dobriyan To: brauner@kernel.org, frank.li@vivo.com Cc: mcgrof@kernel.org, Alexander Viro , 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: <226a6fc1-f6f4-4972-b76e-774094ffb821@p183> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > +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, > > + }, > > + {} > > +}; > > + > > +static int __init drop_cache_init(void) > > +{ > > + register_sysctl_init("vm", drop_caches_table); > > Does this belong under mm/ or fs/? > And is it intended to be moved into a completely separate file? > Feels abit wasteful for 20 lines of code... It is better to keep all sysctls in one preallocated structure for memory reasons: header = kzalloc(sizeof(struct ctl_table_header) + sizeof(struct ctl_node)*nr_entries, GFP_KERNEL_ACCOUNT);