Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp5746986ioo; Wed, 1 Jun 2022 11:40:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXoARnCR53yEbgBW77ENH5/4JZShFIjdTUcVAY5xs2975UP/56QIb3EB9Nos/3I9nz/iIO X-Received: by 2002:a17:903:2345:b0:161:fdb8:3d8e with SMTP id c5-20020a170903234500b00161fdb83d8emr859715plh.10.1654108857727; Wed, 01 Jun 2022 11:40:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1654108857; cv=pass; d=google.com; s=arc-20160816; b=TnlXq013WV7hMHtTJ3Y+HhZa5tkXvA6RfuWXw1h8hHg6FRmHwjVw1++Jto8fB6jwqU peLBh6P28ZACse0ZcKoGWXq+mo4nk4RROv/NEeN+YxoyS1YUqYBbG7gYQXY1arT0483m dSpaiDIYJVGA0NBT/YqRYXhcIx3g1lVfv3+nTUY1SlCBG5LKWWMHbTFg61OFa1ijkzta fbZSzwiVG70SWMRcHIKB1fFrLY8pksl9bitl5b/NT3ZNEFWNMVmFpGk8OiTULlcQcxbV 0jK9d8tjP6pnc/eN9x3slnfQjO2t8bgwKjF4glZBEVX2uUHpSr083+8j1ok+w4jmea5W Wj9A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=ML8jmW9d37g8/b70sCqGqz2BtW+/ii1GO7pFtspW7Vs=; b=GReISVwvawAgQDjWK2FYsANuqIB+K1bvdKpQhQc57Aktpsrk1ha7PNvSkyLsn6yL2L k3a7AihEP/cjEZOK3avmZ9QtmigrrFmK1Hsn7RD98DRIZmsSAW3ATcd+WPZ2tRNT09yp hq3IqzBsBEE4SZfjphU5kd4//I500RbH6d/ijpoEc2kRowuouXALWceSK7Es+KtcV0NG av4J2/UudYAChcA6CnXsE8tNhmK1rsB9PTrMceRTkJGlCdCVsDHXtJXBUdQAks0R1W+t sihymX3s49Bo2PT5v1BGJPbyshKHLLfhRqIsIq4Bxv7NomRk0DvJYE4cALpHI6ResQGL xV1A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=4CZSO9nu; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id w19-20020a63fb53000000b003fbb3d6043csi2977851pgj.597.2022.06.01.11.40.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Jun 2022 11:40:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=4CZSO9nu; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0C72C6EB1E; Wed, 1 Jun 2022 11:37:26 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348202AbiFAGaJ (ORCPT + 99 others); Wed, 1 Jun 2022 02:30:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239265AbiFAGaH (ORCPT ); Wed, 1 Jun 2022 02:30:07 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2041.outbound.protection.outlook.com [40.107.223.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A7545F8F8 for ; Tue, 31 May 2022 23:30:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LtakC3/PLTmCpTnmGpSbsJHnpDEzT3BjmcpIfe4diFN2Py2FO32xEbucP4EpIOZZnh1zrKd9pJ9Tp7XVHkliDo2CuYIs5AcVPfE+GALeuleIWku6KWWbQTGfxd5NUllgQOaY+fNjcd6xZSPzN6krMbn044JXP0KwdLSop0qZprWzAHPG8sadlb4lKtFTdG79AxyMXyT7ig1+awdd53xEBie4XDob5YSR9b0mwgLyJe2bOpFmFaf/z652JJsBZA115z+GEuQTcjHqKJCccxwOhVSqmc+yOFgSl1tBQBtzq65212Susu1RPQlmMRKFVn2Skjq0yAMW8SrfWK30gv0R4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ML8jmW9d37g8/b70sCqGqz2BtW+/ii1GO7pFtspW7Vs=; b=Q2Yl3GbBp50wV3+pwxwua6Z899Rvm2Mx6UVYxra1AX3RcD/qPzQ343WCCLSezTUiFyitPzP3X+qIsxX4CjPnxr5EsK11++59caLiM7HPzePC4is81sw2IRDLgQyayF16EpiP0KoKahdAAlrRE2B93ICvJeZFFWYzvpuplSLww2ZVIHvn7OeIIRR+sWKECAm+3sFuebLOHu4P7m44utOB2wstMyZi6qMiC4Ymv1sqsNDm1UdWMFYngpoRM7RVRYtdfxsvwW9CKkcqPNE3IuSub/mlTijkud7V07mgr08ynWewAVTTg1HS2Q0q9tmWbLjEb3LIjbrA03KgcTvMJGkPQQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ML8jmW9d37g8/b70sCqGqz2BtW+/ii1GO7pFtspW7Vs=; b=4CZSO9nu6I2ADoB7wpzH+uhWIO6yviGn2oMe8Qymail8784h6n2cerICgPFw6Q5OiqxOWuc/oXzGQodwnkN1UI0+uMW0gp7IpfZZVuSiNQkBMCpup3lX5obcxYSlzNm7Je8nPaQ2c90gzSJhyay8kbGupjdTb7WWx+Qu+/uyKzc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from IA1PR12MB6434.namprd12.prod.outlook.com (2603:10b6:208:3ae::10) by PH7PR12MB5654.namprd12.prod.outlook.com (2603:10b6:510:137::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.12; Wed, 1 Jun 2022 06:30:03 +0000 Received: from IA1PR12MB6434.namprd12.prod.outlook.com ([fe80::d978:617e:55a3:cfd]) by IA1PR12MB6434.namprd12.prod.outlook.com ([fe80::d978:617e:55a3:cfd%5]) with mapi id 15.20.5293.019; Wed, 1 Jun 2022 06:30:03 +0000 Message-ID: <5706f5e9-0609-98c9-a0cd-7d96336d73dd@amd.com> Date: Wed, 1 Jun 2022 11:59:49 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.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: "Aneesh Kumar K.V" , 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> From: Bharata B Rao In-Reply-To: <20220527122528.129445-5-aneesh.kumar@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PN3PR01CA0126.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:96::16) To IA1PR12MB6434.namprd12.prod.outlook.com (2603:10b6:208:3ae::10) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f2ff1d18-c109-45ed-815d-08da4398291d X-MS-TrafficTypeDiagnostic: PH7PR12MB5654:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: m/MmQ+30g3EJqsiMleHPhEm80mJ6jnh4nFRg0xArTeEb4XQ7MulAPe6Wb5OLeqRecMoFvG/HdrMJr+TaAvAyOowLQuTEpZmT8p1DqU23/wkqL94HQno2u9rk9M7K0ngfjY52VLfbz9vjtYxuLnBF5vH4OE2KN+jkjBAkEnWh712+ZYKzcwMmtFBysLVvt8Cd+0p3/jMVTSewEknutzRidIdC9YKzFWN6tkLrvMYwM3R6ZrLHwEqvzfnB6qSKmc6Q2242Vyiuikc9jr4r3BTY4cy8EGATT+opi1QDb4q55FyIvh784i050He5H1m1mI03cqNqKLTpO878dAddGqtZEZca1qRE3kFlIfDAczcDOpgM0raZgSHl59esHPyeIv3fEpk4ktfDVm9c7ltdZjC2UGbF92qOsGzU9EVGfF/NC64Jegw2Km0SXbadrV1KIyF9WTROscxZbNCDkr8jVXeXhmvTNdeiJD+kOfCT8MNooHIyWexq6Y9PXUIGv6MciE26ZMUS+lKWCFcHSXm9MN469EyrFXkJHpI+mmd6HQEWm6kI2nHwRUXsSukYmUs0nDcPYo7ZltQytuu3t+aBKEbDM39tJiRnjpTpXWWdRp48B0lfLdrkVT6sJ5ImzlN4C1y6Wle6Ev5hEYgtEDShUH6FYqaJ5SN9d8XzPDlJ+d/gqqC5ldbcHEYQWQRL1qNO8CmqFH4L3q2yQhhTuzjQmx7M1gVQnHH+n7343egrpDx10cE= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:IA1PR12MB6434.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(5660300002)(6666004)(6512007)(7416002)(26005)(53546011)(6506007)(316002)(54906003)(66556008)(66476007)(66946007)(86362001)(6486002)(4326008)(8676002)(8936002)(38100700002)(508600001)(31696002)(31686004)(36756003)(2616005)(2906002)(186003)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?SW9RNUV3ZUVUSjZRK3BhMnNFbUYzNkVLMTVQOWlkQUhPR2M4ODBpZ2xzUEFJ?= =?utf-8?B?Ym96YUNSU1VvRXNrRGRsK3VpdVgrcEt3czhQL3ZwOEw2L2V6TEZFb3pnV29a?= =?utf-8?B?SEN4UzJQOHNhRlByVnVBQ1hJNTJIZnJ2VG9nd0pLM3ZJQUIrZ1ViaVFpcnAr?= =?utf-8?B?ekV1L01Ia3l6QW5jTGZ5VThaOTVTUWhsVWtlU0dUK3IrTnJVd3g3WWJEQVda?= =?utf-8?B?S09ROVZrb1FCVmVUWk9YOER4M29SWkQ3TDFGdkp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eXFlSTI5aGJGNGgzN2JibUt3SHZwVEEwNUxVQStEV0NNanhTUWJq?= =?utf-8?B?SGZ0WkxmcXo0L2l3QTJzMnVjN0d1T0NkSjFGM0ZUWkMxeDZXdHRybTFpVm4w?= =?utf-8?B?bmxQeFZjeWRBajFjUG5oMFpBSUc5SUFKc2kxMURNTEJwQlBNWlBOUlRXU1Jk?= =?utf-8?B?TDF6aW8wek5MbWdWcU1qa2ZhTlVONzFxUy9uTFJRRm11SjIxbkNmQnhNYTc2?= =?utf-8?B?d1p1TDVjcUdrektoZWhOclJOWVM3T2lITVhvSzRRcGt2Mkd0cUxXUT09?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: f2ff1d18-c109-45ed-815d-08da4398291d X-MS-Exchange-CrossTenant-AuthSource: IA1PR12MB6434.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jun 2022 06:30:03.3374 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7jkpFpjCUXon/dUrlg3OPmA0OrGz0TIxzPzwU5rCqlhxWkmdQIfjZ8dtH6Y6c6NeDAr1LxkGZxLqZgIuu9vR3w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB5654 X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 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) 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? Regards, Bharata.