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 CEC3AC433EF for ; Tue, 26 Apr 2022 07:55:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 606936B0081; Tue, 26 Apr 2022 03:55:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 58DF86B0082; Tue, 26 Apr 2022 03:55:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 409226B0083; Tue, 26 Apr 2022 03:55:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id 2F60A6B0081 for ; Tue, 26 Apr 2022 03:55:44 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id EA72E120A4A for ; Tue, 26 Apr 2022 07:55:43 +0000 (UTC) X-FDA: 79398270966.13.F30C97A Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by imf17.hostedemail.com (Postfix) with ESMTP id 486A440041 for ; Tue, 26 Apr 2022 07:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650959743; x=1682495743; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=qGTVGpOWIBsbz827s0W0H9uEW9OJVBxXGTBDbcXs9XE=; b=G8cxFSPAJqjc9ZK4y0BXvGFMEHd+20z6wyuUyVgfzgaWzUQCW0YKYYJw OkvS8EquJbWj2maekVg8p4KfK2E+em3yGDso/rz4ZC2uh7y1Bc2wg04+4 QX2hdQ0A+TQmRbeRGyKK8KhhAthGzntxp4CN1WO+r8gGLLfn3kV2pQk2J bLBsb9FygOmew0gnqwuMPDgpx6tz4ze+iDRUwUVJsOtSMSeVIrxDPpYQq 2SDvio05PjAzPabu6CaR6b3DWHgNNgEextWRd5D8XpuPVTZzrfH5trRH/ l7ytKsnN4WhMWC6Wtz/9GNfxJQCPqJ0g8MbGPME5BxDzfC/BMv0WIjAto Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10328"; a="265294611" X-IronPort-AV: E=Sophos;i="5.90,290,1643702400"; d="scan'208";a="265294611" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2022 00:55:41 -0700 X-IronPort-AV: E=Sophos;i="5.90,290,1643702400"; d="scan'208";a="579747841" Received: from yyu16-mobl.ccr.corp.intel.com ([10.254.212.128]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2022 00:55:38 -0700 Message-ID: <085260285e48093f48d889994aaa500a78577bf2.camel@intel.com> Subject: Re: [PATCH v3 0/7] mm: demotion: Introduce new node state N_DEMOTION_TARGETS From: "ying.huang@intel.com" To: 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, aneesh.kumar@linux.ibm.com, shy828301@gmail.com, weixugc@google.com, gthelen@google.com, dan.j.williams@intel.com Date: Tue, 26 Apr 2022 15:55:36 +0800 In-Reply-To: References: <20220422195516.10769-1-jvgediya@linux.ibm.com> <4b986b46afb2fe888c127d8758221d0f0d3ec55f.camel@intel.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-Queue-Id: 486A440041 X-Stat-Signature: y5wk7amrocoz63odntw7trgyzcwxzbsc Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=G8cxFSPA; dmarc=pass (policy=none) header.from=intel.com; spf=none (imf17.hostedemail.com: domain of ying.huang@intel.com has no SPF policy when checking 134.134.136.65) smtp.mailfrom=ying.huang@intel.com X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1650959736-288111 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 16:45 +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. > > $ cat /sys/bus/nd/devices/dax0.0/target_node > 2 > $ > # cd /sys/bus/dax/drivers/ > :/sys/bus/dax/drivers# ls > device_dax kmem > :/sys/bus/dax/drivers# cd device_dax/ > :/sys/bus/dax/drivers/device_dax# echo dax0.0 > unbind > :/sys/bus/dax/drivers/device_dax# echo dax0.0 > ../kmem/new_id > :/sys/bus/dax/drivers/device_dax# numactl -H > available: 3 nodes (0-2) > node 0 cpus: 0 1 2 3 4 5 6 7 > node 0 size: 14272 MB > node 0 free: 13380 MB > node 1 cpus: > node 1 size: 2028 MB > node 1 free: 1961 MB > node 2 cpus: > node 2 size: 0 MB > node 2 free: 0 MB > node distances: > node 0 1 2 >   0: 10 40 80 >   1: 40 10 80 >   2: 80 80 10 > This looks like a virtual machine, not a real machine. That's unfortunate. I am looking forward to a real issue, not a theoritical possible issue. > 2) Once this new node brought online, without N_DEMOTION_TARGETS > patch series, 1 is demotion target for 0 and 2 is demotion target > for 1. > > With this patch series applied, > 1) No demotion target for either 0 or 1 before dax device is online > 2) 2 is demotion target for both 0 and 1 after dax device is online. > So with your change, if a node hasn't N_DEMOTION_TARGETS, it will become a top-level demotion source even if it hasn't N_CPU? If so, I cannot clear N_DEMOTION_TARGETS for a node in middle or bottom level? Best Regards, Huang, Ying > > [snip]