From mboxrd@z Thu Jan 1 00:00:00 1970 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 5A6E7C43334 for ; Mon, 6 Jun 2022 03:11:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D1F148D0003; Sun, 5 Jun 2022 23:11:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CA5708D0002; Sun, 5 Jun 2022 23:11:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B447B8D0003; Sun, 5 Jun 2022 23:11:35 -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 A043C8D0002 for ; Sun, 5 Jun 2022 23:11:35 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 6B14B206D3 for ; Mon, 6 Jun 2022 03:11:35 +0000 (UTC) X-FDA: 79546335750.05.DE54F7F Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by imf23.hostedemail.com (Postfix) with ESMTP id 46D2514002F for ; Mon, 6 Jun 2022 03:11:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1654485093; x=1686021093; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=I0QdHF0IW1vsI3ZsPfW1ZXjzy87HEMICXcGVm9Da8ds=; b=gFAdnPu+Man4NrIbHR0pI1tLS1Z4v2exvJCYDcO9OeiWjTYEplB4s183 2ERZb8pOMLEK+KroRiPgRtOlJvP3aVBAfxDYilEOkmm+eqwIWB9Rchw7l WOPtZQsEB1e7YT8/L0x4oe2b7qlrdtg4UuCGAmUdAhDu4sQmgM2N63oq9 Zc3CCSnw+WzL1KKBzEe/h2tNQEvzRMcPFU8oMJVgt4XbEXOmMrFI6Jlam mmWp5QKi/itNuzU9Vd11FUd9rqRfs4j8cyRJNqIkaAAeemmGF8bWZTKT0 1tXNeGzWlcW8v/PNWOdOcVUjrPvuSKHsmMuRPflo0F+Q7+mG/LW14Ihbv w==; X-IronPort-AV: E=McAfee;i="6400,9594,10369"; a="337379479" X-IronPort-AV: E=Sophos;i="5.91,280,1647327600"; d="scan'208";a="337379479" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2022 20:11:31 -0700 X-IronPort-AV: E=Sophos;i="5.91,280,1647327600"; d="scan'208";a="635369779" Received: from xingguom-mobl.ccr.corp.intel.com ([10.254.213.116]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jun 2022 20:11:26 -0700 Message-ID: <6e94b7e2a6192e4cacba1db3676b5b5cf9b98eac.camel@intel.com> Subject: Re: [PATCH v5 9/9] mm/demotion: Update node_is_toptier to work with memory tiers From: Ying Huang To: "Aneesh Kumar K.V" , linux-mm@kvack.org, akpm@linux-foundation.org Cc: Wei Xu , Greg Thelen , Yang Shi , Davidlohr Bueso , Tim C Chen , Brice Goglin , Michal Hocko , Linux Kernel Mailing List , Hesham Almatary , Dave Hansen , Jonathan Cameron , Alistair Popple , Dan Williams , Feng Tang , Jagdish Gediya , Baolin Wang , David Rientjes Date: Mon, 06 Jun 2022 11:11:23 +0800 In-Reply-To: <20220603134237.131362-10-aneesh.kumar@linux.ibm.com> References: <20220603134237.131362-1-aneesh.kumar@linux.ibm.com> <20220603134237.131362-10-aneesh.kumar@linux.ibm.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Stat-Signature: 6wtxo7rkppe76oupi3u1nfmid9s8kzdj X-Rspam-User: Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=gFAdnPu+; spf=none (imf23.hostedemail.com: domain of ying.huang@intel.com has no SPF policy when checking 134.134.136.31) smtp.mailfrom=ying.huang@intel.com; dmarc=pass (policy=none) header.from=intel.com X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 46D2514002F X-HE-Tag: 1654485065-846876 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: On Fri, 2022-06-03 at 19:12 +0530, Aneesh Kumar K.V wrote: > With memory tiers support we can have memory on NUMA nodes > in the top tier from which we want to avoid promotion tracking NUMA > faults. Update node_is_toptier to work with memory tiers. To > avoid taking locks, a nodemask is maintained for all demotion > targets. All NUMA nodes are by default top tier nodes and as > we add new lower memory tiers NUMA nodes get added to the > demotion targets thereby moving them out of the top tier. Check the usage of node_is_toptier(), - migrate_misplaced_page() node_is_toptier() is used to check whether migration is a promotion. We can avoid to use it. Just compare the rank of the nodes. - change_pte_range() and change_huge_pmd() node_is_toptier() is used to avoid scanning fast memory (DRAM) pages for promotion. So I think we should change the name to node_is_fast() as follows, static inline bool node_is_fast(int node) { return NODE_DATA(node)->mt_rank >= MEMORY_RANK_DRAM; } And, as above, I suggest to add memory tier ID and rank to struct pglist_data directly. Best Regards, Huang, Ying