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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F2CE2C433EF for ; Fri, 12 Nov 2021 03:02:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8C6A660F4A for ; Fri, 12 Nov 2021 03:02:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8C6A660F4A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 1570B6B0074; Thu, 11 Nov 2021 22:02:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0E1C66B0078; Thu, 11 Nov 2021 22:02:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EE9546B007B; Thu, 11 Nov 2021 22:02:53 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0205.hostedemail.com [216.40.44.205]) by kanga.kvack.org (Postfix) with ESMTP id DC0E96B0074 for ; Thu, 11 Nov 2021 22:02:53 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 945328249980 for ; Fri, 12 Nov 2021 03:02:53 +0000 (UTC) X-FDA: 78798781026.17.0F686A2 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by imf25.hostedemail.com (Postfix) with ESMTP id BB131B0001A7 for ; Fri, 12 Nov 2021 03:02:38 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10165"; a="233308297" X-IronPort-AV: E=Sophos;i="5.87,227,1631602800"; d="scan'208";a="233308297" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2021 19:02:49 -0800 X-IronPort-AV: E=Sophos;i="5.87,227,1631602800"; d="scan'208";a="504707445" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.239.159.101]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Nov 2021 19:02:46 -0800 From: "Huang, Ying" To: Baolin Wang Cc: , , , , , , , , Subject: Re: [PATCH v3] mm: migrate: Support multiple target nodes demotion References: <87y25uks84.fsf@yhuang6-desk2.ccr.corp.intel.com> <8af6715f-c65b-b73b-f863-2c72ebc8544e@linux.alibaba.com> Date: Fri, 12 Nov 2021 11:02:44 +0800 In-Reply-To: <8af6715f-c65b-b73b-f863-2c72ebc8544e@linux.alibaba.com> (Baolin Wang's message of "Fri, 12 Nov 2021 10:58:42 +0800") Message-ID: <87tugikre3.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=ascii X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: BB131B0001A7 X-Stat-Signature: wckrxs3z4fih743ut7deb49q54ibdiey Authentication-Results: imf25.hostedemail.com; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=intel.com (policy=none); spf=none (imf25.hostedemail.com: domain of ying.huang@intel.com has no SPF policy when checking 192.55.52.115) smtp.mailfrom=ying.huang@intel.com X-HE-Tag: 1636686158-697623 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: Baolin Wang writes: > On 2021/11/12 10:44, Huang, Ying wrote: >> Baolin Wang writes: >> >>> We have some machines with multiple memory types like below, which >>> have one fast (DRAM) memory node and two slow (persistent memory) memory >>> nodes. According to current node demotion policy, if node 0 fills up, >>> its memory should be migrated to node 1, when node 1 fills up, its >>> memory will be migrated to node 2: node 0 -> node 1 -> node 2 ->stop. >>> >>> But this is not efficient and suitbale memory migration route >>> for our machine with multiple slow memory nodes. Since the distance >>> between node 0 to node 1 and node 0 to node 2 is equal, and memory >>> migration between slow memory nodes will increase persistent memory >>> bandwidth greatly, which will hurt the whole system's performance. >>> >>> Thus for this case, we can treat the slow memory node 1 and node 2 >>> as a whole slow memory region, and we should migrate memory from >>> node 0 to node 1 and node 2 if node 0 fills up. >>> >>> This patch changes the node_demotion data structure to support multiple >>> target nodes, and establishes the migration path to support multiple >>> target nodes with validating if the node distance is the best or not. >>> >>> available: 3 nodes (0-2) >>> node 0 cpus: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 >>> node 0 size: 62153 MB >>> node 0 free: 55135 MB >>> node 1 cpus: >>> node 1 size: 127007 MB >>> node 1 free: 126930 MB >>> node 2 cpus: >>> node 2 size: 126968 MB >>> node 2 free: 126878 MB >>> node distances: >>> node 0 1 2 >>> 0: 10 20 20 >>> 1: 20 10 20 >>> 2: 20 20 10 >>> >>> Signed-off-by: Baolin Wang > > snip > >>> /* >>> * 'next_pass' contains nodes which became migration >>> @@ -3192,6 +3281,14 @@ static int __init migrate_on_reclaim_init(void) >>> { >>> int ret; >>> + /* >>> + * Ignore allocation failure, if this kmalloc fails >>> + * at boot time, we are likely in bigger trouble. >>> + */ >>> + node_demotion = kmalloc_array(nr_node_ids, >>> + sizeof(struct demotion_nodes), >>> + GFP_KERNEL); >>> + >> I think we should WARN_ON() here. > > In this unlikey case, I think the mm core will print more information, > IMHO WARN_ON() will help little. Anyway no strong opinion on > this. Other than that, can I get your reviewed-by tag with this nit > fixed? Thanks. Yes. Please add my "reviewed-by" after changing this. Best Regards, Huang, Ying