From patchwork Thu Feb 4 10:10:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Huang, Ying" X-Patchwork-Id: 12066735 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0678C433DB for ; Thu, 4 Feb 2021 10:12:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4057164F59 for ; Thu, 4 Feb 2021 10:12:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4057164F59 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 143A16B0075; Thu, 4 Feb 2021 05:12:09 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F8E86B0078; Thu, 4 Feb 2021 05:12:08 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E619E6B007B; Thu, 4 Feb 2021 05:12:08 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0203.hostedemail.com [216.40.44.203]) by kanga.kvack.org (Postfix) with ESMTP id C6A066B0075 for ; Thu, 4 Feb 2021 05:12:08 -0500 (EST) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 948FE181AEF21 for ; Thu, 4 Feb 2021 10:12:08 +0000 (UTC) X-FDA: 77780169936.05.curve44_2706d73275db Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id 6671218017BCD for ; Thu, 4 Feb 2021 10:12:08 +0000 (UTC) X-HE-Tag: curve44_2706d73275db X-Filterd-Recvd-Size: 4395 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Thu, 4 Feb 2021 10:12:07 +0000 (UTC) IronPort-SDR: 7X7xLMo3yvyHVQPMLD9u0JrUorzQ9qa0v8ShuA5GqAKmqXROlPYTKxJBy+T6Wfw8uOM3VqqDku Rp5WgWJiLwxg== X-IronPort-AV: E=McAfee;i="6000,8403,9884"; a="160969009" X-IronPort-AV: E=Sophos;i="5.79,400,1602572400"; d="scan'208";a="160969009" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2021 02:12:07 -0800 IronPort-SDR: iXKFfAUODQbiP17TynK/66aRPZZEhUX2EB1LJa4fxDX6XWUcK6ZZB5LMG36Dg2HBfK7Gl6HMON kOAczPLv4sIg== X-IronPort-AV: E=Sophos;i="5.79,400,1602572400"; d="scan'208";a="393093528" Received: from qwang9-mobl.ccr.corp.intel.com (HELO yhuang6-mobl1.ccr.corp.intel.com) ([10.254.213.123]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2021 02:12:04 -0800 From: Huang Ying To: Peter Zijlstra Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Huang Ying , Andrew Morton , Michal Hocko , Rik van Riel , Mel Gorman , Ingo Molnar , Dave Hansen , Dan Williams Subject: [RFC -V5 6/6] memory tiering: add page promotion counter Date: Thu, 4 Feb 2021 18:10:56 +0800 Message-Id: <20210204101056.89336-7-ying.huang@intel.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210204101056.89336-1-ying.huang@intel.com> References: <20210204101056.89336-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 the memory tiering promoted pages from that of the originally inter-socket NUMA balancing migrated pages. The counter is per-node (count in the target node). So this can be used to identify promotion imbalance among the NUMA nodes. Signed-off-by: "Huang, Ying" Cc: Andrew Morton Cc: Michal Hocko Cc: Rik van Riel Cc: Mel Gorman Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Dave Hansen Cc: Dan Williams Cc: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org --- 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 897331d5e57c..52c68f59f378 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 0982919f6798..eb2130b4ecb5 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2175,8 +2175,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; @@ -2301,6 +2306,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 0678da1db47a..3786d8773404 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 */