Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5742797ioo; Wed, 1 Jun 2022 11:35:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwq+mk/HwBX0Ai91oJul5cyoQfOkS25sP6vOhh6Bx+b1FbL4i828rHxhun+lILLPOkubzcF X-Received: by 2002:a17:903:40ce:b0:164:248:1464 with SMTP id t14-20020a17090340ce00b0016402481464mr802756pld.16.1654108505059; Wed, 01 Jun 2022 11:35:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654108505; cv=none; d=google.com; s=arc-20160816; b=vBjKy99YXhkKZmY0rG3MxhK28C13NCF9b22LHZdVkE8QdHl8osc5QdTkglDhgNShh1 dXIgIiKPonAnnnE3S7EgaFfC77sQfwMXaO3O95otfme+Y1+a13a7Zuyuij8t0E2uHrGt zVEK/CxKLZZ9+J8CvD4Ya1au+zEc5GcMrh/ZzzxfYCZ468UWp2Fwbf2PIKh8QHl/nTrT FwqZCA7r3FzhjIDZawDlhM2I5iHcoUdmsCMff1MRQgp7FznqldaAiG/u4z+HnZpnE3i/ 5f9ZG5ppdgiI/gxWokhepZ9cAulCOujIp5k3MuUYHNMnz98j88qh9PN9Y7L94MypfYIH aJaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=gd/mAvxg6Bz73rNeoqmbmUJ9MdEG/m90e3ZyXInA21E=; b=X0C/+lO4D/kSw9LdWUHyLK2AbMOmuo4qr+5Ab4RyL1cNkN8G/DSjXjNeKRWqSG0Sz0 GGWt9Gxu5T57Ye2SfnRAHbIfIwM5AmprDXIv/CcPNp27ie2Vc8oepErok/mRZZaVhle7 eAY8haqCRp0PQYUad+LpORrvRZMOnjStHSwXAvBQLosKcMsBumsl/yLO9KUTIYWxeDwp NzisW2ie70VlHAZX+xBNVwHrthSHMsYvaHqkYBdj3cKkmR2X7Pqe2PvL/SSoluz4Oz7Q SSIgKMV1bNoLgNTER4pSfU49INFG53Vw3pMGm8L1cC1ll2yPaLlFl9yFTGDDilAfMHSs RFlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=HuCaI40s; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id m1-20020a655641000000b003fba3d286f7si3130400pgs.306.2022.06.01.11.35.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 11:35:05 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=HuCaI40s; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 90A4640A3D; Wed, 1 Jun 2022 11:34:25 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353346AbiFANuh (ORCPT + 99 others); Wed, 1 Jun 2022 09:50:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353343AbiFANuc (ORCPT ); Wed, 1 Jun 2022 09:50:32 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F8186EC76 for ; Wed, 1 Jun 2022 06:50:31 -0700 (PDT) Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 251DmiCu019891; Wed, 1 Jun 2022 13:50:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=gd/mAvxg6Bz73rNeoqmbmUJ9MdEG/m90e3ZyXInA21E=; b=HuCaI40sOIxSa+JS5iZQzl7UwNGR6mCyN7RZxYMEQnmDzcFMEBCogcVRz7Rmr2lOvv01 BXNutyF3dyN3VyJv5ku8qC16xNkc3zfclzwBu4bFNgdYWdpXlVuVutpem16CmGDWUnkW hG+AiyjQlt1IJfBGHOSPR2bFCLXYEG5HnrmAjpCpYEQQ8GyKEdAQQsJb4OsIF+VpkLin 2K1sFleb1crK2wIMybe03Q1i9eAfpGxIh2ffd3Vla37R6nSwPn5LIaVootE8qDPG+WQd P3iujfEli1PdI1p11K+tki+Bo3K2mRemYIyKkiYLtV94gc1fh63mnrJavYDhCilEsHIE xA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ge4uq6asq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 01 Jun 2022 13:50:11 +0000 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 251DFg5K023790; Wed, 1 Jun 2022 13:50:10 GMT Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3ge4uq6art-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 01 Jun 2022 13:50:10 +0000 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 251DbiiQ022897; Wed, 1 Jun 2022 13:50:08 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma03fra.de.ibm.com with ESMTP id 3gbc97vah7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 01 Jun 2022 13:50:08 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 251Do5dH20513098 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 1 Jun 2022 13:50:05 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AF598AE045; Wed, 1 Jun 2022 13:50:05 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A5B4FAE04D; Wed, 1 Jun 2022 13:49:59 +0000 (GMT) Received: from [9.43.5.42] (unknown [9.43.5.42]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 1 Jun 2022 13:49:59 +0000 (GMT) Message-ID: <8e651a1e-d189-3e8a-438f-298f21402bd2@linux.ibm.com> Date: Wed, 1 Jun 2022 19:19:58 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [RFC PATCH v4 4/7] mm/demotion/dax/kmem: Set node's memory tier to MEMORY_TIER_PMEM Content-Language: en-US To: Bharata B Rao , linux-mm@kvack.org, akpm@linux-foundation.org Cc: Huang Ying , Greg Thelen , Yang Shi , Davidlohr Bueso , Tim C Chen , Brice Goglin , Michal Hocko , Linux Kernel Mailing List , Hesham Almatary , Dave Hansen , Jonathan Cameron , Alistair Popple , Dan Williams , Feng Tang , Jagdish Gediya , Baolin Wang , David Rientjes References: <20220527122528.129445-1-aneesh.kumar@linux.ibm.com> <20220527122528.129445-5-aneesh.kumar@linux.ibm.com> <5706f5e9-0609-98c9-a0cd-7d96336d73dd@amd.com> From: Aneesh Kumar K V In-Reply-To: <5706f5e9-0609-98c9-a0cd-7d96336d73dd@amd.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: Jz76fgsrFINs26AyXgYS2-7RW_TmK5u- X-Proofpoint-GUID: 6T5w-AvgdYptZO8KVBG9aa4vAB8s5fo1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-01_04,2022-06-01_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxlogscore=999 adultscore=0 mlxscore=0 suspectscore=0 spamscore=0 impostorscore=0 malwarescore=0 bulkscore=0 lowpriorityscore=0 clxscore=1011 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206010062 X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 6/1/22 11:59 AM, Bharata B Rao wrote: > On 5/27/2022 5:55 PM, Aneesh Kumar K.V wrote: >> From: Jagdish Gediya >> >> By default, all nodes are assigned to DEFAULT_MEMORY_TIER which >> is memory tier 1 which is designated for nodes with DRAM, so it >> is not the right tier for dax devices. >> >> Set dax kmem device node's tier to MEMORY_TIER_PMEM, In future, >> support should be added to distinguish the dax-devices which should >> not be MEMORY_TIER_PMEM and right memory tier should be set for them. >> >> Signed-off-by: Jagdish Gediya >> Signed-off-by: Aneesh Kumar K.V >> --- >> drivers/dax/kmem.c | 4 ++++ >> mm/migrate.c | 2 ++ >> 2 files changed, 6 insertions(+) >> >> diff --git a/drivers/dax/kmem.c b/drivers/dax/kmem.c >> index a37622060fff..991782aa2448 100644 >> --- a/drivers/dax/kmem.c >> +++ b/drivers/dax/kmem.c >> @@ -11,6 +11,7 @@ >> #include >> #include >> #include >> +#include >> #include "dax-private.h" >> #include "bus.h" >> >> @@ -147,6 +148,9 @@ static int dev_dax_kmem_probe(struct dev_dax *dev_dax) >> >> dev_set_drvdata(dev, data); >> >> +#ifdef CONFIG_TIERED_MEMORY >> + node_set_memory_tier(numa_node, MEMORY_TIER_PMEM); >> +#endif > > I was experimenting with this patchset and found this behaviour. > Here's what I did: > > Boot a KVM guest with vNVDIMM device which ends up with device_dax > driver by default. > > Use it as RAM by binding it to dax kmem driver. It now appears as > RAM with a new NUMA node that is put to memtier1 (the existing tier > where DRAM already exists) > That should have placed it in memtier2. > I can move it to memtier2 (MEMORY_RANK_PMEM) manually, but isn't > that expected to happen automatically when a node with dax kmem > device comes up? > This can happen if we have added the same NUMA node to memtier1 before dax kmem driver initialized the pmem memory. Can you check before the above node_set_memory_tier_rank() whether the specific NUMA node is already part of any memory tier? Thank you for testing the patchset. -aneesh