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 E0ECBC433EF for ; Thu, 13 Jan 2022 13:13:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 554526B00A4; Thu, 13 Jan 2022 08:13:12 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 504136B00A6; Thu, 13 Jan 2022 08:13:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3A4816B00A8; Thu, 13 Jan 2022 08:13:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0019.hostedemail.com [216.40.44.19]) by kanga.kvack.org (Postfix) with ESMTP id 26C786B00A4 for ; Thu, 13 Jan 2022 08:13:12 -0500 (EST) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id D54A48A3DF for ; Thu, 13 Jan 2022 13:13:11 +0000 (UTC) X-FDA: 79025304582.12.97F1F1B Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by imf12.hostedemail.com (Postfix) with ESMTP id 055FB40008 for ; Thu, 13 Jan 2022 13:13:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642079591; x=1673615591; h=from:to:cc:subject:references:date:in-reply-to: message-id:mime-version; bh=P7SqfMIQavu0yrwD8s9MeLaVxZ3QPqiVCiYAzsTDB+A=; b=jRAblp68VO855wWgZloPfVkIFA6SQawpeNVYCsdfM91zhQpjI0yA7Cav hmMGHFcMeMXaMltMNC/ytkjoGcGUTJAZaH6VM9nrNLSIKHmbNTwVx2xRX baxFgCCCInjh1Aj4Ke8t3sBgV5UF/s0bmyW2iMU/THmQBAJC44jZzXq36 L7fMOp7q5mPuDuFMIm55gjXC75Tp3CJ8gO+8vaa6bsm7rjU/DuCqAth4g vWg2ef/e0XNcLmPEGzK9cXhm7WPi3yPeRSAgO6uAmIEDK1ZgRWa48zST2 MvdornA4sP7kOezwq+cUqqnD2696x51e3lgNUPfixyczxJ1eFtOFtVZf8 w==; X-IronPort-AV: E=McAfee;i="6200,9189,10225"; a="307348531" X-IronPort-AV: E=Sophos;i="5.88,286,1635231600"; d="scan'208";a="307348531" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2022 05:13:09 -0800 X-IronPort-AV: E=Sophos;i="5.88,286,1635231600"; d="scan'208";a="623844473" Received: from yhuang6-desk2.sh.intel.com (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.239.13.11]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2022 05:13:06 -0800 From: "Huang, Ying" To: Peter Zijlstra Cc: Mel Gorman , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Feng Tang , Andrew Morton , Michal Hocko , Rik van Riel , Mel Gorman , Dave Hansen , Yang Shi , Zi Yan , Wei Xu , osalvador , Shakeel Butt , Hasan Al Maruf Subject: Re: [PATCH -V10 RESEND 0/6] NUMA balancing: optimize memory placement for memory tiering system References: <20211207022757.2523359-1-ying.huang@intel.com> <87sftsumqd.fsf@yhuang6-desk2.ccr.corp.intel.com> <87o84fu9f3.fsf@yhuang6-desk2.ccr.corp.intel.com> Date: Thu, 13 Jan 2022 21:13:04 +0800 In-Reply-To: (Peter Zijlstra's message of "Thu, 13 Jan 2022 14:00:39 +0100") Message-ID: <878rvju6cf.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: rspam10 X-Rspamd-Queue-Id: 055FB40008 X-Stat-Signature: mctyj84wcc9qyf3eoneeeh4uq8pd5yxb Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=jRAblp68; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf12.hostedemail.com: domain of ying.huang@intel.com has no SPF policy when checking 134.134.136.100) smtp.mailfrom=ying.huang@intel.com X-HE-Tag: 1642079590-254168 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: Peter Zijlstra writes: > On Thu, Jan 13, 2022 at 08:06:40PM +0800, Huang, Ying wrote: >> Peter Zijlstra writes: >> > On Thu, Jan 13, 2022 at 03:19:06PM +0800, Huang, Ying wrote: >> >> Peter Zijlstra writes: >> >> > On Tue, Dec 07, 2021 at 10:27:51AM +0800, Huang Ying wrote: > >> >> >> After commit c221c0b0308f ("device-dax: "Hotplug" persistent memory >> >> >> for use like normal RAM"), the PMEM could be used as the >> >> >> cost-effective volatile memory in separate NUMA nodes. In a typical >> >> >> memory tiering system, there are CPUs, DRAM and PMEM in each physical >> >> >> NUMA node. The CPUs and the DRAM will be put in one logical node, >> >> >> while the PMEM will be put in another (faked) logical node. >> >> > >> >> > So what does a system like that actually look like, SLIT table wise, and >> >> > how does that affect init_numa_topology_type() ? >> >> >> >> The SLIT table is as follows, > > > >> >> node distances: >> >> node 0 1 2 3 >> >> 0: 10 21 17 28 >> >> 1: 21 10 28 17 >> >> 2: 17 28 10 28 >> >> 3: 28 17 28 10 >> >> >> >> init_numa_topology_type() set sched_numa_topology_type to NUMA_DIRECT. >> >> >> >> The node 0 and node 1 are onlined during boot. While the PMEM node, >> >> that is, node 2 and node 3 are onlined later. As in the following dmesg >> >> snippet. >> > >> > But how? sched_init_numa() scans the *whole* SLIT table to determine >> > nr_levels / sched_domains_numa_levels, even offline nodes. Therefore it >> > should find 4 distinct distance values and end up not selecting >> > NUMA_DIRECT. >> > >> > Similarly for the other types it uses for_each_online_node(), which >> > would include the pmem nodes once they've been onlined, but I'm thinking >> > we explicitly want to skip CPU-less nodes in that iteration. >> >> I used the debug patch as below, and get the log in dmesg as follows, >> >> [ 5.394577][ T1] sched_numa_topology_type: 0, levels: 4, max_distance: 28 >> >> I found that I forget another caller of init_numa_topology_type() run >> during hotplug. I will add another printk() to show it. Sorry about >> that. > > Can you try with this on? > > I'm suspecting there's a problem with init_numa_topology_type(); it will > never find the max distance due to the _online_ clause in the iteration, > since you said the pmem nodes are not online yet. > > --- > diff --git a/kernel/sched/topology.c b/kernel/sched/topology.c > index d201a7052a29..53ab9c63c185 100644 > --- a/kernel/sched/topology.c > +++ b/kernel/sched/topology.c > @@ -1756,6 +1756,8 @@ static void init_numa_topology_type(void) > return; > } > } > + > + WARN(1, "no NUMA type determined"); > } Sure. Will do this. Best Regards, Huang, Ying