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 19676C433F5 for ; Wed, 27 Apr 2022 01:29:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6BB446B0073; Tue, 26 Apr 2022 21:29:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 66A1A6B0075; Tue, 26 Apr 2022 21:29:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 558B96B0078; Tue, 26 Apr 2022 21:29:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.27]) by kanga.kvack.org (Postfix) with ESMTP id 476C76B0073 for ; Tue, 26 Apr 2022 21:29:21 -0400 (EDT) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 156DA27FBD for ; Wed, 27 Apr 2022 01:29:21 +0000 (UTC) X-FDA: 79400926122.22.56EDAD2 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by imf07.hostedemail.com (Postfix) with ESMTP id 4F4FB40050 for ; Wed, 27 Apr 2022 01:29:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1651022960; x=1682558960; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=/GHGU2iD7h5xBEXZ/qNOmaQtzHNcVbqfxoSX5VFlcw8=; b=SuT7VvB9PWNia5T69fU+tNtwMHPQn6lbMrBIj7HM3JflArWVtKG/c/9M xDC8CCgbk6cdjHIaeCIyOXGxk7XPqS/QmStRAfgveM5n5PAsO23vTwEHY 6jf3VD4B0AQOglgjrH7GrXUbnsoXu8+1eA84IliZWjXhegiuw0p5xPfkD 1J6Es1u0KJmtXG19gOp8thWrpPskkO+Kj+8LMkSoPYnBaRSU1/mfYLBGo aiC6Evyb03vhMv9lXYiuo4Hxfx3Af3ccl67VTO0HJ8FheHmHDeAv0kE5E iN3qHms6QN0SdoF5Fw87Hd2vjQ9cwuTqkhLbtMrzKPObihl1P4ZIGD1wr w==; X-IronPort-AV: E=McAfee;i="6400,9594,10329"; a="253156727" X-IronPort-AV: E=Sophos;i="5.90,292,1643702400"; d="scan'208";a="253156727" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2022 18:29:18 -0700 X-IronPort-AV: E=Sophos;i="5.90,292,1643702400"; d="scan'208";a="730541249" Received: from mhuan11-mobl8.ccr.corp.intel.com ([10.254.213.180]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2022 18:29:15 -0700 Message-ID: <0b2fd48049e8f59fb132f260df9e2a84b58e4577.camel@intel.com> Subject: Re: [PATCH v3 0/7] mm: demotion: Introduce new node state N_DEMOTION_TARGETS From: "ying.huang@intel.com" To: Aneesh Kumar K V , Jonathan Cameron , Jagdish Gediya Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, baolin.wang@linux.alibaba.com, dave.hansen@linux.intel.com, shy828301@gmail.com, weixugc@google.com, gthelen@google.com, dan.j.williams@intel.com Date: Wed, 27 Apr 2022 09:29:12 +0800 In-Reply-To: <8a8d14ca-0976-41cc-02cb-dd1680fa37ef@linux.ibm.com> References: <20220422195516.10769-1-jvgediya@linux.ibm.com> <4b986b46afb2fe888c127d8758221d0f0d3ec55f.camel@intel.com> <20220425145735.000007ca@Huawei.com> <8a8d14ca-0976-41cc-02cb-dd1680fa37ef@linux.ibm.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 4F4FB40050 X-Stat-Signature: mf7nnu3edf9oek8qkpo1gnxnqy3i6oqu Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=SuT7VvB9; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf07.hostedemail.com: domain of ying.huang@intel.com has no SPF policy when checking 134.134.136.20) smtp.mailfrom=ying.huang@intel.com X-Rspam-User: X-HE-Tag: 1651022958-444882 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 Mon, 2022-04-25 at 20:14 +0530, Aneesh Kumar K V wrote: > On 4/25/22 7:27 PM, Jonathan Cameron wrote: > > On Mon, 25 Apr 2022 16:45:38 +0530 > > Jagdish Gediya wrote: > > > > > On Sun, Apr 24, 2022 at 11:19:53AM +0800, ying.huang@intel.com wrote: > > > > On Sat, 2022-04-23 at 01:25 +0530, Jagdish Gediya wrote: > > > > > Some systems(e.g. PowerVM) can have both DRAM(fast memory) only > > > > > NUMA node which are N_MEMORY and slow memory(persistent memory) > > > > > only NUMA node which are also N_MEMORY. As the current demotion > > > > > target finding algorithm works based on N_MEMORY and best distance, > > > > > it will choose DRAM only NUMA node as demotion target instead of > > > > > persistent memory node on such systems. If DRAM only NUMA node is > > > > > filled with demoted pages then at some point new allocations can > > > > > start falling to persistent memory, so basically cold pages are in > > > > > fast memor (due to demotion) and new pages are in slow memory, this > > > > > is why persistent memory nodes should be utilized for demotion and > > > > > dram node should be avoided for demotion so that they can be used > > > > > for new allocations. > > > > > > > > > > Current implementation can work fine on the system where the memory > > > > > only numa nodes are possible only for persistent/slow memory but it > > > > > is not suitable for the like of systems mentioned above. > > > > > > > > Can you share the NUMA topology information of your machine? And the > > > > demotion order before and after your change? > > > > > > > > Whether it's good to use the PMEM nodes as the demotion targets of the > > > > DRAM-only node too? > > > > > > $ numactl -H > > > available: 2 nodes (0-1) > > > node 0 cpus: 0 1 2 3 4 5 6 7 > > > node 0 size: 14272 MB > > > node 0 free: 13392 MB > > > node 1 cpus: > > > node 1 size: 2028 MB > > > node 1 free: 1971 MB > > > node distances: > > > node 0 1 > > >    0: 10 40 > > >    1: 40 10 > > > > > > 1) without N_DEMOTION_TARGETS patch series, 1 is demotion target > > >     for 0 even when 1 is DRAM node and there is no demotion targets for 1. > > > > I'm not convinced the distinction between DRAM and persistent memory is > > valid. There will definitely be systems with a large pool > > of remote DRAM (and potentially no NV memory) where the right choice > > is to demote to that DRAM pool. > > > > Basing the decision on whether the memory is from kmem or > > normal DRAM doesn't provide sufficient information to make the decision. > > > > Hence the suggestion for the ability to override this from userspace. > Now, for example, we could build a system with memory from the remote > machine (memory inception in case of power which will mostly be plugged > in as regular hotpluggable memory ) and a slow CXL memory or OpenCAPI > memory. > > In the former case, we won't consider that for demotion with this series > because that is not instantiated via dax kmem. So yes definitely we > would need the ability to override this from userspace so that we could > put these remote memory NUMA nodes as demotion targets if we want. > > > Is there a driver for the device (memory from the remote machine)? If so, we can adjust demotion order for it in the driver. In general, I think that we can adjust demotion order inside kernel from various information sources. In addition to ACPI SLIT, we also have HMAT, kmem driver, other drivers, etc. > > Best Regards, Huang, Ying