From patchwork Fri Dec 29 02:26:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Zhijian X-Patchwork-Id: 13506281 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 04F2AC3DA6E for ; Fri, 29 Dec 2023 02:27:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7DFBA6B010A; Thu, 28 Dec 2023 21:27:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 768086B010B; Thu, 28 Dec 2023 21:27:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 608D36B010C; Thu, 28 Dec 2023 21:27:04 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 4A5836B010A for ; Thu, 28 Dec 2023 21:27:04 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 1F0AD1A021E for ; Fri, 29 Dec 2023 02:27:04 +0000 (UTC) X-FDA: 81618268368.21.F174432 Received: from esa7.hc1455-7.c3s2.iphmx.com (esa7.hc1455-7.c3s2.iphmx.com [139.138.61.252]) by imf07.hostedemail.com (Postfix) with ESMTP id DD79140002 for ; Fri, 29 Dec 2023 02:27:00 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=fujitsu.com; spf=pass (imf07.hostedemail.com: domain of lizhijian@fujitsu.com designates 139.138.61.252 as permitted sender) smtp.mailfrom=lizhijian@fujitsu.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1703816821; a=rsa-sha256; cv=none; b=cbOtfKfLM5Iiq8EJtjZohg4h90/fGV52uwOhvv/BPjKPE+zhQ64HmMe2YKhGDPpK743qRt aA7+rJZ7KMj0dj48fNU8GvO/yBQeuPEFY3fqUZSi0AJuY5DCzvH4SKBnKg6QGVFzWy1W/m J8DQrDxO8z3WvkV1JgzsIOGMTWpI2VU= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=fujitsu.com; spf=pass (imf07.hostedemail.com: domain of lizhijian@fujitsu.com designates 139.138.61.252 as permitted sender) smtp.mailfrom=lizhijian@fujitsu.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1703816821; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references; bh=HSllxhd8P00x0geBN23CeurFWPCy6NyLiZP64sVvGWI=; b=Osv+05E6LJ/usOrnF+v+sr7WHK6/nx8365wE5PTPN/WfqZnnVHlJW/T9ajIx8a36TWY5s2 1bPPhCsT1FsHC7L8pmVxh6BGombRtmZx1SOlXnSi45dwyF0ccp7xSrP7OQl1r6ZYI4E3B1 iWEA0mUTyNH0c8JpKow4ka07el6PFZc= X-IronPort-AV: E=McAfee;i="6600,9927,10937"; a="123662295" X-IronPort-AV: E=Sophos;i="6.04,313,1695654000"; d="scan'208";a="123662295" Received: from unknown (HELO oym-r1.gw.nic.fujitsu.com) ([210.162.30.89]) by esa7.hc1455-7.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Dec 2023 11:26:58 +0900 Received: from oym-m4.gw.nic.fujitsu.com (oym-nat-oym-m4.gw.nic.fujitsu.com [192.168.87.61]) by oym-r1.gw.nic.fujitsu.com (Postfix) with ESMTP id 3E430CC163 for ; Fri, 29 Dec 2023 11:26:56 +0900 (JST) Received: from kws-ab3.gw.nic.fujitsu.com (kws-ab3.gw.nic.fujitsu.com [192.51.206.21]) by oym-m4.gw.nic.fujitsu.com (Postfix) with ESMTP id 6499715367 for ; Fri, 29 Dec 2023 11:26:55 +0900 (JST) Received: from edo.cn.fujitsu.com (edo.cn.fujitsu.com [10.167.33.5]) by kws-ab3.gw.nic.fujitsu.com (Postfix) with ESMTP id EBF90200932D2 for ; Fri, 29 Dec 2023 11:26:54 +0900 (JST) Received: from localhost.localdomain (unknown [10.167.226.45]) by edo.cn.fujitsu.com (Postfix) with ESMTP id 18BAE1A0070; Fri, 29 Dec 2023 10:26:54 +0800 (CST) From: Li Zhijian To: Andrew Morton , linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, Li Zhijian , "Huang, Ying" , Greg Kroah-Hartman , "Rafael J. Wysocki" Subject: [mm-stable PATCH] mm/vmstat: move pgdemote_* out of CONFIG_NUMA_BALANCING Date: Fri, 29 Dec 2023 10:26:51 +0800 Message-Id: <20231229022651.3229174-1-lizhijian@fujitsu.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSS-9.1.0.1417-9.0.0.1002-28086.004 X-TM-AS-User-Approved-Sender: Yes X-TMASE-Version: IMSS-9.1.0.1417-9.0.1002-28086.004 X-TMASE-Result: 10--3.874500-10.000000 X-TMASE-MatchedRID: /2NGPvLZz+PuNO1zKrjbZsYv//yaWh0DTfK5j0EZbyur1gUu9f1F/y15 IFUNL+ETjx5X3FdI4UDmn3xyPJAJoh2P280ZiGmR6ws6Flw3FGL4uJ1REX4MHaoDeu6wu7bqVLI YaOq4J57i8zVgXoAltsIJ+4gwXrEt33fj+sMArfOUZ3IP5ATaHyuexXizJzH6Q2tDQwgndFdyOi EaC6l63HHSca9kH+Hc4v4kbnD0TDUyyKlhPQDMHvIq4+5SWozMEBTOngsK2iG4DAVZT3EBUxFlt GxCTkwFQHVA+r1vGdZmQDEDCMiuswfP8fSSIvISoYC0cwOOST0= X-TMASE-SNAP-Result: 1.821001.0001-0-1-22:0,33:0,34:0-0 X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: DD79140002 X-Stat-Signature: 33sd15jej9cj7dyqdshncr9hqemj39xk X-Rspam-User: X-HE-Tag: 1703816820-724125 X-HE-Meta: U2FsdGVkX18dQNlZcEHfSLbm4UQgKN0Yt2U7aIboMM5o+fpBPArEMnSdCj56fKY9lWqS5zgcPJwdJvVTl8hzG5ocWMfpFw8uQuZClExpe5pGwwXLkeNz6urbcICpHHqXh9yaHIf63s9No2r0lxrHoolO/ujQMtTG+IDxVSPwupx6BV4HQn4SyslCAv1EQ5nxSt51xVXrbAMQmvMCVwilc9sw4T/p7xkPFwzkI7TnX7p5zPPt7xWq4wKvhhB5BF9+OERiXiXeo/3VaOR8M7kY6hE05Vj/qXDrVhcMWO77SFA1d0CKPFY/YlDqKIRTfZkD3WZsdnLKcdKd2UGgU4ziscW+B9dpPewmisH3bVZYlmK2S4KZAK2OEkNMoPaTt/c9R3mt1zDuPxgfn3CZfRpH8h7poIwv2/jGsC3vQlO9ytLswibqEJWhT5PRSPqDuOn66nJw3+EMvFm/fH3QJI55EH92WCroUEKkBy1J2U5lrxeJy0JbX2p60sfxwTDdlRRJsIXxOxHPR8ke7WZHh1XiQIASmVE1wZ7vuVl4qL8wTBIOtdacnvdZKEVdYyMXR9sl0qAEd5n1V/L5gdMctrJr0PA4Yi6GKKC+QkKZ80lpSKSrznd/qg3oPy76TLSf6I8P8zriAEuogZRu5hKQ82ftcMLK2fnOKqExQZH5vDiY7rAs31Jg+T+Oxo86v+aEl3jzygPrP+TWcTG06vbqhsy2JWG59ibyvS2JxUgNciu0O/R5bCI/CmU6/GsAxrk+EU79WnJtboEqfM+CJOLERp+mthk4F3KHFoW0o8ETdbyrCKBVwoJo+JXzSDFyz5GFIX+GPsaaQePmAll8GreHi23opV+6JyNzm7I/sGskEnYMe9fUI6qZfDMtzJm2LhUTvyT6XF+D8bUsazP2sSyvpyJ3IjX5knT0nOqDoMcqeeUYUlWbWGa9deWiy2l6mQitoh/IKkaYVzZ8x7Lbj0qgKkM JLf3tPKP WqUqfXd82JXUYP+SKsEPOiUjK7BDsUIaTC3fXydaSoUmDiKsTAp10zesOfLNp9oIh+MMIO7jgPTg9kDZlBnqN9HMrGrbbGu8PMOE7Qo6F+5SW1UfDuYvgUeX7RvdkoXoW1QVveswqMd9SGuWuzYUcsa/OlxjN8bgsdoK70CCwUph0b8TC9oGgy5JFRC8l8PEwBwFW97KYTk2oS7D4p3XQEufoJdgCdNVxb3gJheRzzbjCn4eJpbHMjsABg7BF3wMRs2S8l8XJ4TVg98npuxFAdIeVDxf0QapErLUWZ4w1P4EzgYQ8bXNl/lbd02AclwB1l87+F3v7i4u1CGQf/nIIyvJxOpQtuD5GPl4ep3bEYKDcxzLqi9sD9RcAqxdb7B7dZdDfZMWwgkMBn5C8pSaj7B2geT2c6V0cQSqV 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: Demotion can work well without CONFIG_NUMA_BALANCING. But the commit 23e9f0138963 ("mm/vmstat: move pgdemote_* to per-node stats") wrongly hid it behind CONFIG_NUMA_BALANCING. Fix it by moving them out of CONFIG_NUMA_BALANCING. Fixes: 23e9f0138963 ("mm/vmstat: move pgdemote_* to per-node stats") Signed-off-by: Li Zhijian Cc: "Huang, Ying" Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Cc: Andrew Morton --- include/linux/mmzone.h | 2 +- mm/vmscan.c | 5 +---- mm/vmstat.c | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 28665e1b8475..c18c53353b50 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -207,11 +207,11 @@ enum node_stat_item { #ifdef CONFIG_NUMA_BALANCING PGPROMOTE_SUCCESS, /* promote successfully */ PGPROMOTE_CANDIDATE, /* candidate pages to promote */ +#endif /* PGDEMOTE_*: pages demoted */ PGDEMOTE_KSWAPD, PGDEMOTE_DIRECT, PGDEMOTE_KHUGEPAGED, -#endif NR_VM_NODE_STAT_ITEMS }; diff --git a/mm/vmscan.c b/mm/vmscan.c index d3d401dcfaa4..12d302f67a54 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -409,12 +409,10 @@ void drop_slab(void) static int reclaimer_offset(void) { -#ifdef CONFIG_NUMA_BALANCING BUILD_BUG_ON(PGSTEAL_DIRECT - PGSTEAL_KSWAPD != PGDEMOTE_DIRECT - PGDEMOTE_KSWAPD); BUILD_BUG_ON(PGSTEAL_KHUGEPAGED - PGSTEAL_KSWAPD != PGDEMOTE_KHUGEPAGED - PGDEMOTE_KSWAPD); -#endif BUILD_BUG_ON(PGSTEAL_DIRECT - PGSTEAL_KSWAPD != PGSCAN_DIRECT - PGSCAN_KSWAPD); BUILD_BUG_ON(PGSTEAL_KHUGEPAGED - PGSTEAL_KSWAPD != @@ -978,10 +976,9 @@ static unsigned int demote_folio_list(struct list_head *demote_folios, migrate_pages(demote_folios, alloc_demote_folio, NULL, (unsigned long)&mtc, MIGRATE_ASYNC, MR_DEMOTION, &nr_succeeded); -#ifdef CONFIG_NUMA_BALANCING + mod_node_page_state(pgdat, PGDEMOTE_KSWAPD + reclaimer_offset(), nr_succeeded); -#endif return nr_succeeded; } diff --git a/mm/vmstat.c b/mm/vmstat.c index cfd8d8256f8e..1437ca2f28c5 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1248,10 +1248,10 @@ const char * const vmstat_text[] = { #ifdef CONFIG_NUMA_BALANCING "pgpromote_success", "pgpromote_candidate", +#endif "pgdemote_kswapd", "pgdemote_direct", "pgdemote_khugepaged", -#endif /* enum writeback_stat_item counters */ "nr_dirty_threshold",