From patchwork Thu Nov 2 02:56:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Zhijian X-Patchwork-Id: 13443345 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 5D902C4332F for ; Thu, 2 Nov 2023 02:57:35 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 006ED8E0014; Wed, 1 Nov 2023 22:57:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id ED2AD8E0009; Wed, 1 Nov 2023 22:57:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D4C178E0014; Wed, 1 Nov 2023 22:57:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id C5CB28E0009 for ; Wed, 1 Nov 2023 22:57:34 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 9B052120DD8 for ; Thu, 2 Nov 2023 02:57:34 +0000 (UTC) X-FDA: 81411503628.10.2EF635D Received: from esa11.hc1455-7.c3s2.iphmx.com (esa11.hc1455-7.c3s2.iphmx.com [207.54.90.137]) by imf28.hostedemail.com (Postfix) with ESMTP id 48E83C0021 for ; Thu, 2 Nov 2023 02:57:31 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=fujitsu.com; spf=pass (imf28.hostedemail.com: domain of lizhijian@fujitsu.com designates 207.54.90.137 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=1698893851; 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:in-reply-to:references:references; bh=fyXx7gHaeU0peW35MzmJZM4uRNKPnG2WG4mOi77pRtg=; b=7PeyKo9voDItng3L+n473+HOlgFtMiBFs+YoOXzMeDLwJH9Gf3WyAmLCfpmtUANB4Dr2Kr KB1mS6OSuDkwNzEBURWq4kJx7QDiKS8tNxoxfv+8D2JZjTt9uwxSaR4EvuX87O2YNFZpFr 2Ae5QM4Ls9h5rZWOvk8PyzLz0XvngDU= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=fujitsu.com; spf=pass (imf28.hostedemail.com: domain of lizhijian@fujitsu.com designates 207.54.90.137 as permitted sender) smtp.mailfrom=lizhijian@fujitsu.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698893851; a=rsa-sha256; cv=none; b=iX4Qdg1dKPT1iNr6vA5nzH72mGWFJsOdbL+eeMx20ODAbMbIHW7+f14z6A3VeAek7hy0cw vQZr9RutyThDNuXbwBWTiMFrQ8EvzOVuxfK97UfX7xlPtLrZ7QfldtiIn9UaZd7cwWGYdh jxa+pvP7+dQC44caMRstaU68R0lUb8M= X-IronPort-AV: E=McAfee;i="6600,9927,10881"; a="117752854" X-IronPort-AV: E=Sophos;i="6.03,270,1694703600"; d="scan'208";a="117752854" Received: from unknown (HELO oym-r3.gw.nic.fujitsu.com) ([210.162.30.91]) by esa11.hc1455-7.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2023 11:56:57 +0900 Received: from oym-m3.gw.nic.fujitsu.com (oym-nat-oym-m3.gw.nic.fujitsu.com [192.168.87.60]) by oym-r3.gw.nic.fujitsu.com (Postfix) with ESMTP id 9DBF0CA247 for ; Thu, 2 Nov 2023 11:56:55 +0900 (JST) Received: from kws-ab4.gw.nic.fujitsu.com (kws-ab4.gw.nic.fujitsu.com [192.51.206.22]) by oym-m3.gw.nic.fujitsu.com (Postfix) with ESMTP id C1667D94A2 for ; Thu, 2 Nov 2023 11:56:54 +0900 (JST) Received: from edo.cn.fujitsu.com (edo.cn.fujitsu.com [10.167.33.5]) by kws-ab4.gw.nic.fujitsu.com (Postfix) with ESMTP id 60DF2E5E60 for ; Thu, 2 Nov 2023 11:56:54 +0900 (JST) Received: from localhost.localdomain (unknown [10.167.226.45]) by edo.cn.fujitsu.com (Postfix) with ESMTP id D80EF1A0071; Thu, 2 Nov 2023 10:56:53 +0800 (CST) From: Li Zhijian To: Andrew Morton , Greg Kroah-Hartman , rafael@kernel.org, linux-mm@kvack.org Cc: ying.huang@intel.com, y-goto@fujitsu.com, linux-kernel@vger.kernel.org, Li Zhijian Subject: [PATCH RFC 2/4] mm/vmstat: Move pgdemote_* to per-node stats Date: Thu, 2 Nov 2023 10:56:46 +0800 Message-Id: <20231102025648.1285477-3-lizhijian@fujitsu.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20231102025648.1285477-1-lizhijian@fujitsu.com> References: <20231102025648.1285477-1-lizhijian@fujitsu.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-TM-AS-Product-Ver: IMSS-9.1.0.1417-9.0.0.1002-27972.004 X-TM-AS-User-Approved-Sender: Yes X-TMASE-Version: IMSS-9.1.0.1417-9.0.1002-27972.004 X-TMASE-Result: 10--0.846700-10.000000 X-TMASE-MatchedRID: 5rkJ48FE5MzOAp9H1IibggihQ5NZCXsS/OuUJVcMZhs6FHRWx2FGsL8F Hrw7frluf146W0iUu2vXgVbKoEEGVoYXQ9brtx4rngIgpj8eDcAZ1CdBJOsoY8RB0bsfrpPIcSq bxBgG0w5WoX0SFtPDB2Ve53KQDkILphM7H89s7DKCcrz/r6s9wQi97CyytPpdWBbwXBagd4Bbqn 8KVqy/D6rems9Kg9kizvTBn3+4zZZbjBuldNvkMkoq97WSHdFjfupJaud1uZCfRs6uIbkFVw== X-TMASE-SNAP-Result: 1.821001.0001-0-1-22:0,33:0,34:0-0 X-Rspam-User: X-Stat-Signature: jpc6zr84f499q54wqb3x6gni4nkcc59i X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 48E83C0021 X-HE-Tag: 1698893851-916178 X-HE-Meta: U2FsdGVkX1/X0p2MxP/q0/b4SFSs80moszraqRokXNrHPDqTn0ogLF+OKEb3N61SoaE6ps0Fdz12px2xmEXOVSLNjv1NOTnqZj1jFhs/m10sJZviQOugVqf3gp9xtQjcwIXoleM2COWkrxIt+UmHN7aar2+K0nTgDpkItunpNkxr5QC+lu2ZxLFRRhzSJpt4bJBFm6AZcgvC5Gh5aMa1nre41Dbdo/OwsnoNKi0cPbfM8iv77MWAdK9v48oVaspHnlW5fLqVienHdJ5T2kQCTcFwo2qKk4YHk6N8mwghkxIUZHlXnNgK4zX2u8+Mx/pyqzW3AU3+b3eUgeVXcOMLgspaglg+zyiQcvCOo/AspiZVzSqPN2JNvQAiPQizHOzgvjaZeV6KiXTa09RkjRFS7ZiOa+IoNyVC1VSrZw7jzoqlxPVhLG4UsxE/3fRDD5mPZayLhqAmsy6HrG9jkvjBlSBEO9H3jfmucmtvd5l61ziJWiNtfOkglgRC4QPc3a2abs1cktbeVYEP+AhhM8f1YZd9XsPG8s0IrsjKxV1MprqCh1lukMN7y9a3mGNe7BDYcEEVYoSRw9xmm2OQOzhyLpO7NaRPSB3BmYY/7wLRpuwtUCZTRStsSES4N5RmWnL6wDCKx+Wrkm1TnUfxxchaFt8yHcGmk+fFcT+LWLwrD6O2QPDEiZUBrfhb1qDmJa2I7lIXR8X0DsrsHpVM3Niaioe75WPypNL4LMLvLuNA5GGSA13ACThK+PSph89YbSF5E309YHnETf1ZDTNY6mXd7Svx2EdWqy6bBKylA3nF58Kruy0lIYd3Ah9WlkFNOTOsDzsP+AwKWioM/K7nZP9sbGrnIOP2d3W/jhN5D7Y03GMq+fmX5NOKbihi02BxxkDYh9nxMtquT2aCB/NwrHCV8TCJYv7kXGvkIrlg6Ev7XBAL4W6QdrcZAgBqwAs635Do1AmBUPq8cSLLP8Xho5A MwJMNoSh Q+/GsbzE9puwnUnhmq5RjDISVapAdQ1QArQJAyd7A8eECrndt6Q9lrh8TV36m+6VPJJ4+sHxs3F9grNfvBeJ+8MTMANujgNyryMYfMt2H5aSxmVeqYNbVTKhTSjPpHkxaN6tG0EufT5fu99M71eXdIrNCAZYvoGm7wb5DgBIUQ9pRmYriGPDY4lvLTlJQYKX4jOON/6Bb0PpQ0+C5rUMqSbmixA== 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 is a prepare to improve the demotion profiling in the later patches. Per-node demotion stats help users to quickly identify which node is in hige stree, and take some special operations if needed. Signed-off-by: Li Zhijian Acked-by: "Huang, Ying" --- include/linux/mmzone.h | 4 ++++ include/linux/vm_event_item.h | 3 --- mm/vmscan.c | 3 ++- mm/vmstat.c | 6 +++--- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 4106fbc5b4b3..ad0309eea850 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -206,6 +206,10 @@ enum node_stat_item { #ifdef CONFIG_NUMA_BALANCING PGPROMOTE_SUCCESS, /* promote successfully */ PGPROMOTE_CANDIDATE, /* candidate pages to promote */ + /* PGDEMOTE_*: pages demoted */ + PGDEMOTE_KSWAPD, + PGDEMOTE_DIRECT, + PGDEMOTE_KHUGEPAGED, #endif NR_VM_NODE_STAT_ITEMS }; diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h index 8abfa1240040..d1b847502f09 100644 --- a/include/linux/vm_event_item.h +++ b/include/linux/vm_event_item.h @@ -41,9 +41,6 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, PGSTEAL_KSWAPD, PGSTEAL_DIRECT, PGSTEAL_KHUGEPAGED, - PGDEMOTE_KSWAPD, - PGDEMOTE_DIRECT, - PGDEMOTE_KHUGEPAGED, PGSCAN_KSWAPD, PGSCAN_DIRECT, PGSCAN_KHUGEPAGED, diff --git a/mm/vmscan.c b/mm/vmscan.c index 6f13394b112e..2f1fb4ec3235 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1678,7 +1678,8 @@ static unsigned int demote_folio_list(struct list_head *demote_folios, (unsigned long)&mtc, MIGRATE_ASYNC, MR_DEMOTION, &nr_succeeded); - __count_vm_events(PGDEMOTE_KSWAPD + reclaimer_offset(), nr_succeeded); + mod_node_page_state(NODE_DATA(target_nid), + PGDEMOTE_KSWAPD + reclaimer_offset(), nr_succeeded); return nr_succeeded; } diff --git a/mm/vmstat.c b/mm/vmstat.c index 00e81e99c6ee..f141c48c39e4 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1244,6 +1244,9 @@ const char * const vmstat_text[] = { #ifdef CONFIG_NUMA_BALANCING "pgpromote_success", "pgpromote_candidate", + "pgdemote_kswapd", + "pgdemote_direct", + "pgdemote_khugepaged", #endif /* enum writeback_stat_item counters */ @@ -1275,9 +1278,6 @@ const char * const vmstat_text[] = { "pgsteal_kswapd", "pgsteal_direct", "pgsteal_khugepaged", - "pgdemote_kswapd", - "pgdemote_direct", - "pgdemote_khugepaged", "pgscan_kswapd", "pgscan_direct", "pgscan_khugepaged",