Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp3759163ioa; Tue, 26 Apr 2022 09:24:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzEOE5udmeWR4sh7bOulvXqIMwEM5safguWWEg6O7PXLP+RsjnSWVK91xkGul2Lkd8zIIq8 X-Received: by 2002:a05:6402:298b:b0:41d:675f:8b44 with SMTP id eq11-20020a056402298b00b0041d675f8b44mr25607277edb.377.1650990265210; Tue, 26 Apr 2022 09:24:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650990265; cv=none; d=google.com; s=arc-20160816; b=WkeGk5Q1fntTLwrcsLqrc6QcxRv9YKjxVqUQ7H5pM9fYbE64R3/sZUlgrO42Fe+aDi nHJCJoMZqvoltf5oTdOG+QuKj5v0bG8IEYESD8AbvqIl1fVfNal0YEz5VNgQErGGMjYk +iDQ+gdfZWWFJGGyAUkQ3od9beaPjkIJvyag9mpXKHztM60OJ/l8WFi2v3H4xvvabynn Vu+vrNrcUFs4n1dLs/hm/Vfp+ngDw61nASYAkOYVy5y1tVpcSoPqWdp+tNSVzuJvVrEY dsATck0XADNQqPMAnSSYc1XI7ogRT0jK6OuAhzk0qa4c3YLWPSiTyI2/LB2SOlaigXr/ 81PA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=PLvACZ1BKXRW8KfQSkjx1eatfFwnsi0i2UW85DL/QaE=; b=TrvIfizKWhTmxOu6KmrdgBWPCrVAErq8bJoo7yAufjBKFDkv1o+QjPaN9lV67Inigz Iv9Wyp3ruAbjULA13PJwez8AVBeZicScLkZpvfCU8HyqWF23Q2k7EzM2xWmmGrIWnSwH v653PK3Yu/Fho8qUajmw9EQH7p5vdDxMp6ChxwLZGjj4n0kry/0bdazQeEgZWVl1X12P 2tOxRtoIpX1B+IpObMUf+2j/2WYXgP1l32/zQBlw12St7teHEekdL49LD+4tpeFGJaZb EKzPBvYpmKujrq+5EmGtCpLYg7ymQB8pXIWfR2lt5ZOwmnTOdeuEUb/l211un2lMcPq4 KR8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eZ8IqjlK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id eb6-20020a0564020d0600b00423f62ce403si18727636edb.571.2022.04.26.09.23.59; Tue, 26 Apr 2022 09:24:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eZ8IqjlK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345156AbiDZJxi (ORCPT + 99 others); Tue, 26 Apr 2022 05:53:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347924AbiDZJxZ (ORCPT ); Tue, 26 Apr 2022 05:53:25 -0400 Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F6DB1DA74 for ; Tue, 26 Apr 2022 02:10:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1650964217; x=1682500217; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=mhc1LkdFmJv5cdHaRlQmMd4IHZo0mxKiF8Rnx8DSyb4=; b=eZ8IqjlK0n/cMo5eTyfPPZyo+Ehdp88vjoREeFbvHjmtfzmh2rcv2L1O q5ogC0ClkccvRpv1OqVR14+UHP1rwXPvdbGLXQpV9PHKv9pkUrFZh34cy znorVHM81AwvgcPgl2NyHdNd6I6XCOYAz3cJf66MNGH3gADhv9lBHzfF9 xZvlBlVcvINvdDNiQLfWGPA+kYESZvdtJ4u5mDfGOCJ3KSPJqabIiR3PS 0UPsAdWPBZEHcoohcEv5lnIp8ho3GMeZuLwfJltqowVYxaGlKqmDH2WD2 yI2EsP92p1+fSDTCH/qyB6lcib+yE1DAjOJWO8Z6gZ7pNQuBV/B9pE+J/ g==; X-IronPort-AV: E=McAfee;i="6400,9594,10328"; a="246073676" X-IronPort-AV: E=Sophos;i="5.90,290,1643702400"; d="scan'208";a="246073676" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2022 02:10:10 -0700 X-IronPort-AV: E=Sophos;i="5.90,290,1643702400"; d="scan'208";a="532564643" Received: from yyu16-mobl.ccr.corp.intel.com ([10.254.212.128]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2022 02:10:07 -0700 Message-ID: <8cd54998029dd59dc2f6a04b698f75df021294c2.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 , 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: Tue, 26 Apr 2022 17:10:04 +0800 In-Reply-To: <63b0c4ab-861c-3d07-4912-e6cd842d0bfd@linux.ibm.com> References: <20220422195516.10769-1-jvgediya@linux.ibm.com> <4b986b46afb2fe888c127d8758221d0f0d3ec55f.camel@intel.com> <085260285e48093f48d889994aaa500a78577bf2.camel@intel.com> <63b0c4ab-861c-3d07-4912-e6cd842d0bfd@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-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2022-04-26 at 14:37 +0530, Aneesh Kumar K V wrote: > On 4/26/22 1:25 PM, ying.huang@intel.com wrote: > > 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. > > > > This is the source of confusion i guess. A large class of ppc64 systems > are virtualized. The firmware include a hypervisor (PowerVM) and end > user creates guest (aka LPAR) on them. That is the way end user will use > this system. There is no baremetal access on this (There is an openpower > variant, but all new systems built by IBM these days do have PowerVM on > them). > > > So this is not a theoretical possibility. > Now I get it. Thanks for detailed explanation. Best Regards, Huang, Ying