From patchwork Mon Aug 26 12:04:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yukaixiong X-Patchwork-Id: 13777716 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27CA1C5321E for ; Mon, 26 Aug 2024 12:06:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0BD5F6B009A; Mon, 26 Aug 2024 08:06:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EC6F56B04D4; Mon, 26 Aug 2024 08:06:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A08656B04CC; Mon, 26 Aug 2024 08:06:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 53B756B04CD for ; Mon, 26 Aug 2024 08:06:03 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 0DEC9141007 for ; Mon, 26 Aug 2024 12:06:03 +0000 (UTC) X-FDA: 82494268206.23.6475587 Received: from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191]) by imf05.hostedemail.com (Postfix) with ESMTP id 949E510001F for ; Mon, 26 Aug 2024 12:06:00 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=none; spf=pass (imf05.hostedemail.com: domain of yukaixiong@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=yukaixiong@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724673847; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=13XtYRe9zckhNgCun1cwMBmkUU6oTzsYgFWtM1lgJ1A=; b=5O30/e4+V1DYCiYh7OH8xAyOBt89RP5hWs8bT2azKzw6BxWDzYmqHCKUSzZ8hGR3wh1QWC gOI4bp5+7E6jSmWv8BUcXUhidAgC5h3+zjlzNynYpmNSTcq28JIjz8RNhGVV1pQaYWLwHT SGowNi+BzjjreVdC3LPzwign5IVh0jY= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=none; spf=pass (imf05.hostedemail.com: domain of yukaixiong@huawei.com designates 45.249.212.191 as permitted sender) smtp.mailfrom=yukaixiong@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724673847; a=rsa-sha256; cv=none; b=nIHMMnERUD8HlQcQwGSzFILHwz/Aowy5UW84FVGFAm7zhJZmzHM7xoZIjG6LYnrDiPorjW ghDCkYGmfToHi+ZncKSk5ykai+biA5+bePB1DBVLKV+yTQ5eJZHoyvzSh+19Bj1YQ+j19N Grj+7myOz2/HQdToMVjseBFGpx51udc= Received: from mail.maildlp.com (unknown [172.19.163.17]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4WsqB46qZYz1j7Lb; Mon, 26 Aug 2024 20:05:16 +0800 (CST) Received: from kwepemh100016.china.huawei.com (unknown [7.202.181.102]) by mail.maildlp.com (Postfix) with ESMTPS id 8B0FF1A0188; Mon, 26 Aug 2024 20:05:25 +0800 (CST) Received: from huawei.com (10.175.113.32) by kwepemh100016.china.huawei.com (7.202.181.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.11; Mon, 26 Aug 2024 20:05:23 +0800 From: Kaixiong Yu To: , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Subject: [PATCH -next 02/15] mm: filemap: move sysctl to its own file Date: Mon, 26 Aug 2024 20:04:36 +0800 Message-ID: <20240826120449.1666461-3-yukaixiong@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20240826120449.1666461-1-yukaixiong@huawei.com> References: <20240826120449.1666461-1-yukaixiong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.113.32] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To kwepemh100016.china.huawei.com (7.202.181.102) X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 949E510001F X-Stat-Signature: ybcd74yroqm8ok96k68y8pm8hd9kodzk X-Rspam-User: X-HE-Tag: 1724673960-23590 X-HE-Meta: U2FsdGVkX18o28MrC0Af+2e4MHzn5O/iunaGYaRlT/rAIc3Ht/DmI0Iu/+G6zpuLMJxq+TRbdo3xpy49qZxpOynff77dBcNi6kf8+f5cn3NwYQ5Gy7mdIB2pV1xBvB//XNwZKgCMNKcTbtapGQR9CTwTIk4bkw3UpuRWLynksrIjK/WzLgBbTIDBidGFFr29x2vRnXUGP4ru9RHPFKn7j/JwIJ3aos6t3iT+lqXM0SZkPDIF9AikNV4oskSKNKa/yw1CSP5imCvmi1TSXb9c+luYcpuVKgdbPj2WpbFuy45vKg+LA0s5Dlb3IQqSIPBg0sAEagLNTpgxPpFuFvlOGQZVEqqP3U5Ss3tW8XsC22sS8u+elHGjp4MbCOwyHFi2wPy7QrGcCXJnO+Xora0NUVkFWvMFyejDxT3kSYqoeo2CU6e6DvWAUnFBeZaStEHeSksQUl5IWfuAujWJPlGtGsdISeZNwdeOssw7DDR//iysDbmAyRTtfMTb/6WeZhpwy/C/DBcbrkKDQn5t9TYmbAdqY+Iev9RvrhU68kadTSx+5ll9XBNeg6r622o1QqB2NCNLZ4JjHYmVrOWX27mgTcCOKEwk/ifpwNQPgB9HXm+iZPjROP/Gm9gY2g0/mpJf9V7FWkb757bo0zHOJQeUYc/Wca7PJ7E/WV6LND1m51/Qp295gxqwHSa9LjPVUGer21Ydjf/efSLmp+FMPwEgKao7XdcjE/SKLGmIIm6FMZ+m2PIi8VxMW987HdUEZvYUZIaycrVeGBu+DLijlEk624pIgZ1FeihYjbvtD2Hs3EKGBJOXVexT+1txV+F6iVsEHbOGSwFWJ6oDYu4ZaPBOojPujiini53uVXyxx0RVgKTQVLmzAxL+tg+RfQVk8VsYs0hXAtoy/T6FEO5ffmTALDq6seJNgcp5FAX1gCHphWrPKO8E5YhqrObuX2/eQTit/ij0Wb5G4czcS0V/p90 o4agdoX4 OG5qM9Le2pDbQrb1kW5CjVqfpMPelZkszYPkYwbZItZglKQby+vJHP0uvVCTiFCjMwhyDsdmR6krVF8LJ1Sh5sqSQGtR2/HprYfqQLQt5Rh9eMo1HX7NIYiF6AmyELkROwd2wOs7NHSS4Q/o9Na6g/4j5Ra2Tcff8wqmKrIzW0QkSQSmFNVQtgKyHVQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: This moves the filemap related sysctl to its own file, and removes the redundant external variable declaration. Signed-off-by: Kaixiong Yu --- include/linux/mm.h | 2 -- kernel/sysctl.c | 8 -------- mm/filemap.c | 18 +++++++++++++++--- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index fc111a0a5375..1db4cd7136ff 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -39,8 +39,6 @@ struct user_struct; struct pt_regs; struct folio_batch; -extern int sysctl_page_lock_unfairness; - void mm_core_init(void); void init_mm_internals(void); diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 726b866af57b..2a875b739054 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -2089,14 +2089,6 @@ static struct ctl_table vm_table[] = { .extra1 = SYSCTL_ONE, .extra2 = SYSCTL_FOUR, }, - { - .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 0f13126b43b0..72695ccacb86 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include "internal.h" @@ -1067,6 +1068,19 @@ static wait_queue_head_t *folio_waitqueue(struct folio *folio) return &folio_wait_table[hash_ptr(folio, PAGE_WAIT_TABLE_BITS)]; } +/* How many times do we accept lock stealing from under a waiter? */ +static int sysctl_page_lock_unfairness = 5; +static struct ctl_table filemap_sysctl_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, + } +}; + void __init pagecache_init(void) { int i; @@ -1075,6 +1089,7 @@ void __init pagecache_init(void) init_waitqueue_head(&folio_wait_table[i]); page_writeback_init(); + register_sysctl_init("vm", filemap_sysctl_table); } /* @@ -1222,9 +1237,6 @@ static inline bool folio_trylock_flag(struct folio *folio, int bit_nr, return true; } -/* How many times do we accept lock stealing from under a waiter? */ -int sysctl_page_lock_unfairness = 5; - static inline int folio_wait_bit_common(struct folio *folio, int bit_nr, int state, enum behavior behavior) {