Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp6235688ioo; Thu, 2 Jun 2022 01:53:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzt07Md/38Ta/H2vMzb4uA79xNTwf5vZZyvEyCkEudPxVxhwwa24txF+8G78MGsY648qyK9 X-Received: by 2002:a17:907:3c81:b0:6e6:cf3e:6e14 with SMTP id gl1-20020a1709073c8100b006e6cf3e6e14mr3253763ejc.181.1654159985536; Thu, 02 Jun 2022 01:53:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1654159985; cv=pass; d=google.com; s=arc-20160816; b=YD42D/8ILsBrstX8NUj4zCaxKvHtaZnOhJpZFqv3O2lCsgdlWf0ylM6KkZuXZsKRj+ F77QjxuMCmMhjEY7CZZh55tvipz5U9ejS5zi2noghicZcmKzDoqJ7FEwVO/VYA0FHX6w 7Gi1cvNxH+xNBsDz69W4is8lCJKSxNXmY4tZrhQmXS2HOIrdd7MVq7ltxkMECJYDoo1X 05A5FnciFx6iDupHemvNLH4XG3hTS3HxRew/DxfGwTx7IYGqW+wAq0i5pocuSXkAUtiF mjVo+0hvJ3oMZcT3/4ePqDfiJB5PSDI2aU/B+UeSbqUd//9yWr7WjDi6pW68PmKz8xPG OGgg== 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=Xapo2MgDRMlrt8kPkr8wHqiJ9bNam503z464QV3jyaM=; b=SnW3LIS21Wp6Y1hEo7IdkNy2UjbynQkH60eprHXrd8fUGB6kiBJfshC9IA+SsYWG5u zI1SLwboRDZfIznYSP2nbg3tN8iJdVYW981HLHENI4EYc7myeJA0mByJTNBGRIG5W5GB ENOQ7tJvYxfpw1fA5SzuGP1EMr2FEPtk8wWRRljCqx325S9tgHCFiKwXB4fpJnjFRdK7 n2QkzCV6OXF56n8YNvw4ZJoimEZULFpKM4t9BAcBXr3GXavkRTGRLP/d/sRpGS076hUH FaHlZcbYgTWXpcu9Y8IAgGQlODZXoQ+WAum3CDpbBSsdAPy330+KnAv/i9lvI/ynopsJ Z9MQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=jXMgbK5M; 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:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hu9-20020a170907a08900b0070b8869192asi563097ejc.451.2022.06.02.01.52.39; Thu, 02 Jun 2022 01:53:05 -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=@amd.com header.s=selector1 header.b=jXMgbK5M; 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:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231259AbiFBGgr (ORCPT + 99 others); Thu, 2 Jun 2022 02:36:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231253AbiFBGgo (ORCPT ); Thu, 2 Jun 2022 02:36:44 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2081.outbound.protection.outlook.com [40.107.244.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3A8D21DA1F for ; Wed, 1 Jun 2022 23:36:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T64xZhjGtq/0iXrfD2yVJZ6VlwUI1ljmQ1Vc3jfAVwAQ95O3Db6KOn9S8CATjpJzoqnzlgBGqcs8A/03Uty1kCSNMF7ldKWfggvJtl2sP+PTZ73PmvxJvKG8CcRJz++whnQOokkN/r0BJPUvO2Pul6PBs1jBSgFGXooVIHFNbRyYX7NJLAFxI6nyhFyfMxZCLe1MJpEeH7/PGfI1xJfaMBC74xcKaBXKX9mnsOH5qVfHiP2jrcA1Ft7VxVcO6iYYwSeiR5PNJe1RBxXw41/EcwofMIf8AQ/leasTBRZghmDA7xVzioYcrDr+EybTYmtd7V579mvjBvxw+ffRO4ZXtw== 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=Xapo2MgDRMlrt8kPkr8wHqiJ9bNam503z464QV3jyaM=; b=kVZ7GChvNp7rRBwOsiXsYBunkajyGP2R07KPv+TIjLoAPO7Jirw9770mJkNfIT6JcuFp+bD6ZzygrcakGLWd5OAvEioEAkpvObpDPas7sVzsEj29NtKw0ZLwIJMaV4bBS1ThdBeIxzuTy9zqw3ubICbOivw+vNuJK/cELlTKJos8QPo0L1ztCezWLr+kwZsf8LbDHTxUCVMD1TkZa2aM7tfz8sOHciE4/ZGmr/7zzABG+U/bhx3r7sgt6mGXn0xbe3rkG1sv3k1xGBdPSzmdSjXYYebfkfO6tWqzPtcybWXENpTJYyXiak6hhPADRzBowkUroAQi79daw8XOLDRT6g== 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=Xapo2MgDRMlrt8kPkr8wHqiJ9bNam503z464QV3jyaM=; b=jXMgbK5MWw6vJaGXWiYEqmbfIP0ru1OFNJxZMF2Fm5QxrQcJ1/zIMjiTKeZCREfCc3h4W5Vn+CSQChvAgy4AkkvgoHmGKLMtblMmOrnfj5cdMaG5M2kak8tnE5uJUIEaaeGJFhfZ8G1JRjtWid7KaY2qWT/mTKIJUqWspr/6pMw= 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 MW3PR12MB4345.namprd12.prod.outlook.com (2603:10b6:303:59::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.12; Thu, 2 Jun 2022 06:36:38 +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; Thu, 2 Jun 2022 06:36:38 +0000 Message-ID: Date: Thu, 2 Jun 2022 12:06:25 +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> <5706f5e9-0609-98c9-a0cd-7d96336d73dd@amd.com> <8e651a1e-d189-3e8a-438f-298f21402bd2@linux.ibm.com> From: Bharata B Rao In-Reply-To: <8e651a1e-d189-3e8a-438f-298f21402bd2@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PN2PR01CA0189.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:e8::10) 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: 91c72394-bfde-4a8a-cab9-08da44623eeb X-MS-TrafficTypeDiagnostic: MW3PR12MB4345: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: RWb/yzLFB/BDX80nlYr2gcGwoAMkNOcoM7fHl5agOVQD35unQCrtvY+yx8smScyo8lp1m5EZ0AgWDzsMYXQfgo2TiAy5zzmzLhH6U0j6KGPZ0TwrvIIPPQiAgFYKwa4H/UA9b4Nhpuiu2LRjGh8gSwAjVYR/NJHpbC+N3CeOKRdN6Ln1r1OwgSI/q+H7t5a4unidfjm8JyfKPNe62bbEBoiorNnWaeIsD1LPGNE4HGe9ccHsgvM24pxXcswYsTytDxVfxUG4IA5N1dN3Dh2jgTWT9c74/nL1FmLVhz3LWhiSrzQ76tb4h1khaB5XqeMJH9V0ypeACmPYBdGNArLkP5SRnitULbAVgKbJp2P/wfyLknrZjd2uIJ3ysipmCkBO5hN0PAJtnc75NgXBh7In+hwXBrJG51OKcZ8dVyp/JO5H/6ujjzEljejXvAZmF1iAD6uCVvPz720IZcUqo3EcQ9VYIckkqQHdK1QGr4x/os+zDiDdIu10vZteMAQbOt+GzfgxTUgl9+gmiIfMgf63dfJRb2OmHAghrDrC3APgZ4RH/cPsjwOm4zk1rY4ZyLauuyIe39D0oa18PuoMDexqGOHHI7i32FKR5M3I5hE9kpGsoqTbFs4cMSoWy7Q6Gh4q2VDNqSrJPjSSn883nnFwXhbfn6wgUZjI/KMQv/M4zDW3fItBsEa6zmS6yYnubDdtZuoyr4cI97T9Xp3L9A5rgumYe1GGI41WGqbEE9Di1Bc= 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)(26005)(8936002)(6512007)(53546011)(186003)(66476007)(66556008)(316002)(36756003)(31686004)(8676002)(4326008)(66946007)(6506007)(508600001)(6486002)(7416002)(38100700002)(2906002)(5660300002)(54906003)(86362001)(6666004)(2616005)(31696002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aEREK2cxaWI4aEMrRytPc0lIY1J0V1NpMkZvcE4yUnhFNkE4UXpWeDhHQm82?= =?utf-8?B?cFNFMGRQeERIUi9ORi8vSTBLdHVhUVFuSWtKMGNTYnYvaEtURDZCb0xtVEMv?= =?utf-8?B?OGdZVmVEaHNFTjRuMTdydXlSQlhWQTNUcFNWR2hWMktGSmZDeHRBRVBQbE1H?= =?utf-8?B?ZzRVWEIybU1KUFJ6RjVKekdVSXFtaktYanQvb0E2QWRuT1RTZWxyY2p3YS9k?= =?utf-8?B?aFliQ1FDWlUydnBuSmdXYWVpSWlUd202T2w5cW1xMGdIQkhEQjB6MllicEhX?= =?utf-8?B?bVNFRUpMdW1TZy8yRTdoM285ZlBPKzB5SjAyWTRyQlVaWUdsZV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WNmd3g3WlF3WWdLRGU5YXNidVZZWDFzV2M5dTE1L2RJWmpYdUtV?= =?utf-8?B?UUtqVk9sRjA4TzRlU3lvZWV1TnlqRktyNXllMnlxOHk0SUg4cmhYcCsrazNG?= =?utf-8?B?SGJkMlZNSmR1eDAxMXFhRjh1cGs2Mi90UFlpTkE0c3g0bGU1OExtV1pMU2d2?= =?utf-8?B?M2wxUEQwajlsTkhkS2VSaDF3TG0xcVdMRHhGaDB5NEdVWnhETjIzUT09?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 91c72394-bfde-4a8a-cab9-08da44623eeb X-MS-Exchange-CrossTenant-AuthSource: IA1PR12MB6434.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jun 2022 06:36:38.2438 (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: +zxnS492TuVJNLRzFvSX9PjgvBLTpfpL4nsVG/9yvcZnczqi2+zTtJnRq/f/bIwFHsYXsu9k9p/VWmqikAuQlQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW3PR12MB4345 X-Spam-Status: No, score=-3.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 6/1/2022 7:19 PM, Aneesh Kumar K V wrote: > On 6/1/22 11:59 AM, Bharata B Rao wrote: >> 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? When we reach node_set_memory_tier_rank(), node1 (that has the pmem device) is already part of memtier1 whose nodelist shows 0-1. Regards, Bharata.