From patchwork Tue Oct 27 06:32:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, Ying" X-Patchwork-Id: 11859479 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 08263921 for ; Tue, 27 Oct 2020 06:33:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C75D32080A for ; Tue, 27 Oct 2020 06:33:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C75D32080A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 239C36B0071; Tue, 27 Oct 2020 02:33:14 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 1C34B6B0072; Tue, 27 Oct 2020 02:33:14 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 015D56B0073; Tue, 27 Oct 2020 02:33:13 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0018.hostedemail.com [216.40.44.18]) by kanga.kvack.org (Postfix) with ESMTP id C6CF66B0071 for ; Tue, 27 Oct 2020 02:33:13 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 6C6FF181AC9C6 for ; Tue, 27 Oct 2020 06:33:13 +0000 (UTC) X-FDA: 77416738266.17.beef06_06081122727a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id 53377180D0180 for ; Tue, 27 Oct 2020 06:33:13 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,ying.huang@intel.com,,RULES_HIT:30034:30054:30064,0,RBL:134.134.136.100:@intel.com:.lbl8.mailshell.net-64.95.201.95 62.18.0.100;04yf4y1nfwncc4iujeeo8eprx8cafocs5ettbueyudazf5b7yaeqgoqhk1n18e6.pooazf3z4mici9ndqtdykgiwod3grpqp9zf6usr8std66dqh6o83fuzgd8i4d3k.q-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:ft,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: beef06_06081122727a X-Filterd-Recvd-Size: 3760 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by imf07.hostedemail.com (Postfix) with ESMTP for ; Tue, 27 Oct 2020 06:33:11 +0000 (UTC) IronPort-SDR: OTwwbY+/bxZqq19/xOMCbkJtLKXHXxsolZq5JZHwVTRVB4EzFhlooU3Pq0aAdIvILEh8VW8cXG AGQeuF2p06tQ== X-IronPort-AV: E=McAfee;i="6000,8403,9786"; a="232221188" X-IronPort-AV: E=Sophos;i="5.77,422,1596524400"; d="scan'208";a="232221188" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2020 23:33:11 -0700 IronPort-SDR: c0pcvM5smIdBXL0iR+fyD6KRHnY1dCAnnMR719911lEylQPFFcxj/JP+EWrpU+/3OMPFWDldCE jSeNVGzsMwog== X-IronPort-AV: E=Sophos;i="5.77,422,1596524400"; d="scan'208";a="535666749" Received: from lzhengha-mobl.ccr.corp.intel.com (HELO yhuang-mobile.ccr.corp.intel.com) ([10.254.213.46]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Oct 2020 23:33:10 -0700 From: Huang Ying To: Peter Zijlstra Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Huang Ying Subject: [RFC -V4 6/6] autonuma, memory tiering: Add page promotion counter Date: Tue, 27 Oct 2020 14:32:17 +0800 Message-Id: <20201027063217.211096-7-ying.huang@intel.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201027063217.211096-1-ying.huang@intel.com> References: <20201027063217.211096-1-ying.huang@intel.com> MIME-Version: 1.0 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: To distinguish the number of promotion from the original inter-socket NUMA balancing migration. The counter is per-node (target node). This is to identify imbalance among NUMA nodes. Signed-off-by: "Huang, Ying" --- include/linux/mmzone.h | 1 + mm/migrate.c | 10 +++++++++- mm/vmstat.c | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index c10efdc92b17..b384489897b7 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -209,6 +209,7 @@ enum node_stat_item { #endif #ifdef CONFIG_NUMA_BALANCING PGPROMOTE_CANDIDATE, /* candidate pages to promote */ + PGPROMOTE_SUCCESS, /* promote successfully */ #endif NR_VM_NODE_STAT_ITEMS }; diff --git a/mm/migrate.c b/mm/migrate.c index d8d80b111a6a..0f4106b6c4fe 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2161,8 +2161,13 @@ int migrate_misplaced_page(struct page *page, struct vm_area_struct *vma, putback_lru_page(page); } isolated = 0; - } else + } else { count_vm_numa_event(NUMA_PAGE_MIGRATE); + if (sysctl_numa_balancing_mode & NUMA_BALANCING_MEMORY_TIERING && + !node_is_toptier(page_to_nid(page)) && node_is_toptier(node)) + mod_node_page_state(NODE_DATA(node), PGPROMOTE_SUCCESS, + nr_succeeded); + } BUG_ON(!list_empty(&migratepages)); return isolated; @@ -2287,6 +2292,9 @@ int migrate_misplaced_transhuge_page(struct mm_struct *mm, mod_node_page_state(page_pgdat(page), NR_ISOLATED_ANON + page_lru, -HPAGE_PMD_NR); + if (!node_is_toptier(page_to_nid(page)) && node_is_toptier(node)) + mod_node_page_state(NODE_DATA(node), PGPROMOTE_SUCCESS, + HPAGE_PMD_NR); return isolated; out_fail: diff --git a/mm/vmstat.c b/mm/vmstat.c index 2e60cc0232ef..ba5f6f987711 100644 --- a/mm/vmstat.c +++ b/mm/vmstat.c @@ -1217,6 +1217,7 @@ const char * const vmstat_text[] = { #endif #ifdef CONFIG_NUMA_BALANCING "pgpromote_candidate", + "pgpromote_success", #endif /* enum writeback_stat_item counters */