Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp2837448pxb; Sun, 20 Feb 2022 01:59:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJwVWixXCYJOSpLhEB0EU84VADLmVvtWvy0JJe6ZEx08t4tkK9caD0SsQ4s4ktDvFoI3sYCQ X-Received: by 2002:a17:907:205a:b0:6ce:e4c5:4809 with SMTP id pg26-20020a170907205a00b006cee4c54809mr12918817ejb.116.1645351192363; Sun, 20 Feb 2022 01:59:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645351192; cv=none; d=google.com; s=arc-20160816; b=d72ihtrO8tA/cni79CXO/3+iZfiaAYV8GITADzJC+2hvykNVm99ZuZykp2GLGVA0Qt XNq8pOFp/FvrHOQeynqfMqkVKGTUY+adwvXKgTQXWIY2XnJ8G7gdMP0/3qAJaJUWppbW 7pMOETovJ0SCVT17CquOAhyitztYeRoHGQT2eWEmM82Q7lNAYNUHZTwiKFCteZ+ptaUf uVPi1JRfMdtswg5KC3btiwLLQ+dJdfWTQ8abE1ANQCPsifpjGSM+hXVBUPaM0R3b5gL4 brnnl9iN/WdYTERd/2yeyizBfWRupPxAdKo7CNGUOTJp6MeDrcmC6DgXeTdf5XKxs4Po 5fpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=8acTd6oPL58wYvBHXU5rDp2shCqL4VaPCEyCbpj6BMc=; b=DLvJ76prxPf00I539IKxLT90SCe4qDwxc+QEN7/3S1qc2mkAM0/+205RZJNgWGnDBA lwutUMA7vw+JWz74HPtdl0jrErupWGj6vdca2B0m8vwuuDLSQp/u58h++mRwJgATrkDs yPhu4TvURkyK36V2uirJq6LzNJuEa2AL33tE14vzclDkcEJruRCGxy4qNgv3GNBJpZ2Z UAWqdg+ZCLP2spfptcNdtcbjlOFMZ6uorMndvVBbQZ+Exh0LqgQdIYHBCDhjOtNz6cBc 8p6M15wKqMTRsLGEQYEvHSij9YxX19TxLq+lyHhIVIF66KeeTE1ACZ7uvNNNq764nh7f kOeg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bo18si1207639ejb.602.2022.02.20.01.59.29; Sun, 20 Feb 2022 01:59:52 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233329AbiBTGCh (ORCPT + 99 others); Sun, 20 Feb 2022 01:02:37 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:50568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242698AbiBTGCg (ORCPT ); Sun, 20 Feb 2022 01:02:36 -0500 Received: from smtpbgjp3.qq.com (smtpbgjp3.qq.com [54.92.39.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9A87F7D for ; Sat, 19 Feb 2022 22:02:11 -0800 (PST) X-QQ-mid: bizesmtp83t1645336917tfkame2n Received: from localhost.localdomain (unknown [180.102.102.45]) by bizesmtp.qq.com (ESMTP) with id ; Sun, 20 Feb 2022 14:01:51 +0800 (CST) X-QQ-SSF: 01400000002000B0F000B00A0000000 X-QQ-FEAT: 4LFlwc+MlXkQ8gqbBA0q6azNy4FS1Wp5//1Uq4m3wJCqupGWBCLm4SAGWY39E d+iIj+Wv2qwxluAPiItIHm2vHTu9tlW2cYh9/+NYMgheyjVewkcP5Ia8AQ6oKZPoBm8OCrn XGx+2RzTo0DYxdemrR2ynLPwTWRgT3E7ZwgvFoZUzkT8uKT5sm61ndzj4FVNF4ww1PlRxeW XjKH4OQRKd4bh6wTqC4MwRkMZOSBpycSD7ou4QzwsFSgPnPPgF43ILh/iij7P5hxrgiDKsG VfSYnxCDrK3098yCmiAhwujlQx8XSn2FdMIYs2o2auaA91PQr7gofumlnImAAAXWDShmI6n b3S9MB2w68SHzCsrEQ4wPaebW5diY714Dx+mjye X-QQ-GoodBg: 2 From: tangmeng To: akpm@linux-foundation.org, mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, nizhen@uniontech.com, zhanglianjie@uniontech.com, nixiaoming@huawei.com, tangmeng Subject: [PATCH 09/11] mm/filemap: move filemap sysctls to its own file Date: Sun, 20 Feb 2022 14:01:49 +0800 Message-Id: <20220220060149.14110-1-tangmeng@uniontech.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybgforeign:qybgforeign1 X-QQ-Bgrelay: 1 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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 kernel/sysctl.c is a kitchen sink where everyone leaves their dirty dishes, this makes it very difficult to maintain. To help with this maintenance let's start by moving sysctls to places where they actually belong. The proc sysctl maintainers do not want to know what sysctl knobs you wish to add for your own piece of code, we just care about the core logic. All filesystem syctls now get reviewed by fs folks. This commit follows the commit of fs, move the filemap sysctls to its own file, mm/filemap.c. Signed-off-by: tangmeng --- include/linux/mm.h | 2 -- kernel/sysctl.c | 8 -------- mm/filemap.c | 24 +++++++++++++++++++++++- 3 files changed, 23 insertions(+), 11 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 213cc569b192..c3c7cb58c847 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -39,8 +39,6 @@ struct anon_vma_chain; struct user_struct; struct pt_regs; -extern int sysctl_page_lock_unfairness; - void init_mm_internals(void); #ifndef CONFIG_NUMA /* Don't use mapnrs, do it properly */ diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 1a1504862f4f..b51b0b92fdc1 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -2261,14 +2261,6 @@ static struct ctl_table vm_table[] = { .proc_handler = percpu_pagelist_high_fraction_sysctl_handler, .extra1 = SYSCTL_ZERO, }, - { - .procname = "page_lock_unfairness", - .data = &sysctl_page_lock_unfairness, - .maxlen = sizeof(sysctl_page_lock_unfairness), - .mode = 0644, - .proc_handler = proc_dointvec_minmax, - .extra1 = SYSCTL_ZERO, - }, #ifdef CONFIG_MMU { .procname = "max_map_count", diff --git a/mm/filemap.c b/mm/filemap.c index ad8c39d90bf9..f264e7e12f59 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1235,7 +1235,29 @@ static inline bool folio_trylock_flag(struct folio *folio, int bit_nr, } /* How many times do we accept lock stealing from under a waiter? */ -int sysctl_page_lock_unfairness = 5; +static int sysctl_page_lock_unfairness = 5; + +#ifdef CONFIG_SYSCTL +static struct ctl_table vm_filemap_table[] = { + { + + .procname = "page_lock_unfairness", + .data = &sysctl_page_lock_unfairness, + .maxlen = sizeof(sysctl_page_lock_unfairness), + .mode = 0644, + .proc_handler = proc_dointvec_minmax, + .extra1 = SYSCTL_ZERO, + }, + { } +}; + +static __init int vm_filemap_sysctls_init(void) +{ + register_sysctl_init("vm", vm_filemap_table); + return 0; +} +late_initcall(vm_filemap_sysctls_init); +#endif /* CONFIG_SYSCTL */ static inline int folio_wait_bit_common(struct folio *folio, int bit_nr, int state, enum behavior behavior) -- 2.20.1