Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp370658iof; Mon, 6 Jun 2022 05:13:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwfRVkmwCOegVrXya7r3U37bFQ5z7dNDf84xz90iA/h7swHEW6QqVhJe0A6Z9JntZfqJWWk X-Received: by 2002:a17:902:ecc1:b0:167:74c3:55b1 with SMTP id a1-20020a170902ecc100b0016774c355b1mr7418792plh.108.1654517582318; Mon, 06 Jun 2022 05:13:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1654517582; cv=pass; d=google.com; s=arc-20160816; b=pUQWNhIz6I9LQsSsWTGEf/+phSGwS60o2SPkMgMauodSjHktbeB2Axwcn48S8mIXaC obmh6AzftKf91YWJMtVZ2ultpxGOlsCAXUYoyYKXL65S3/Dm5oySdLWUiww+SiuD2DLP 9r8IX143a7jmhHY45gm7c1gwtICWFHIp7h2AYd/4Qvna3f1K9lzfGRx73xuJE79polsO FLexmtwo75/8rOvtspl0AsD8TnoeNLCVvabZ6GgvBxfhhHor4DC8QYKAdLRJ5ETaz8lm Kfe0z52CQYIGGXAV73GR9kd2bVRDfXHZshigTWFH2rvP3Y9yMgLDt8R33I7Sf8sfXMh2 Eqxw== 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=OVQO3rtktdKzWbKTUZnVmP93MIwQ2gdQCMb14CNFrL8=; b=vBaPf8HRo31h6qpx5wlgmyifHUGySeSIxAZAxRy2SK+/RerpjK7NpBLVeFJcMZecn5 00KSAm0BxT+CcZW+c0LscbGHoYCK7xl5C4M7kizPHi2FayZFFX4ONBwoaK7ifzS8plZG c2ugeQPTuAAKXfWQ3e1p1LpOD3dUX9dMhTeNdrRy+2PU0hYH0ivMtb/sLDN86+1Cc6F/ R1uzVG8JSNMIUWgyEZZobPkuECGMNAfjCvoA3yB8sP3I8n3LhewoGGDMGFR/k4PxMv5h csPX/B0NsxjoLw2W6sYacg9ej5vkx7yVvo0ZAOvaJ1M2FdTmO+wCa9ofUDoismaDzvyo gf6A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=3nvO4giO; 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 a1-20020aa795a1000000b0051be4655281si11255624pfk.39.2022.06.06.05.13.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 05:13:02 -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=3nvO4giO; 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 787F826125; Mon, 6 Jun 2022 05:10:28 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236503AbiFFMKW (ORCPT + 99 others); Mon, 6 Jun 2022 08:10:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236497AbiFFMKV (ORCPT ); Mon, 6 Jun 2022 08:10:21 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2041.outbound.protection.outlook.com [40.107.102.41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB8ED245A8 for ; Mon, 6 Jun 2022 05:10:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QaXjs3zDDA90WSrHC+mrWB+u4Jyd1uCT1+PUOAmZPxy/YzojYxA1Sjl6Bo3jSnLrgJZDF+0X4LeZObqxhxr9OR2/4D1PSaIJaLckUBtdQRFtrNWxufzfsOy5dBlX15m2LSbDAAnHrcH+3HWzHmmd71s4uc7Fw4Dxx+XR5R3R5R17udFzL0QqYbwlFb/Jh92eRzFvxZ0/JBnkQkOMvIGOZsUlThxTz9CknQ7Ac+Y452hg2g0abtlRMeM8T/T1DTGApoYzfNzju01T4tklu1/E5gsE4Vp5u0MxC6WeqnsRt145sMME6LxssB1OyKKLVe8nep90ZYY0kSdfTyYPXyWC9w== 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=OVQO3rtktdKzWbKTUZnVmP93MIwQ2gdQCMb14CNFrL8=; b=hHFyZtKp4CdVUdn0LFC0v0El7kWco3T4qUtem2qGIggyIre/xsWh6b/A/92L2MK6fG2+pzRKQZR9l5Og3x5H2RtoKvdFjxbxlNVjxXN0zWI/SgY1H4Frxw1hmSZz68/f7sZwKY5ZWGHRU8IT03O0KkIUzJarfZR0ixc9chLPMJjIRFGYxb1MFWtE5iu5cRKT0/DzIyehm9vuL1imdhdQNWTJVB9hk7v3wyrx7PHELFZyVXSUOkG3ZNtl0PcYHPw4Gzlbi2Ne49kBmEVCmX2JBBzUOWDDmvsz0l0nqpcnsmaZFMcK5fcJnkuZoP4mv+HjrNaBxS461uRAmKMkKJREYA== 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=OVQO3rtktdKzWbKTUZnVmP93MIwQ2gdQCMb14CNFrL8=; b=3nvO4giOnX3kJpugf8twc2eaIm4fjTkGRDukNDhoUf46UMBydF4IisG8JXMI+vFOEfvLVWLkgLvyVQQe4MhxguFXWxUnwXRbHz1ZJFlewntvIImA+kqOp0De3O8zPUJR4XNholehplRAX5ImohgzJrzVyL5bd7TmQnvWtiKPqQU= 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 MWHPR12MB1934.namprd12.prod.outlook.com (2603:10b6:300:109::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.12; Mon, 6 Jun 2022 12:10:15 +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.5314.015; Mon, 6 Jun 2022 12:10:15 +0000 Message-ID: Date: Mon, 6 Jun 2022 17:39:56 +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> <87fski80sx.fsf@linux.ibm.com> From: Bharata B Rao In-Reply-To: <87fski80sx.fsf@linux.ibm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PN3PR01CA0012.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:95::21) 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: bdb47771-ebd4-412a-ebba-08da47b583a9 X-MS-TrafficTypeDiagnostic: MWHPR12MB1934: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: hZETCl4g/N7tmyarj1WLcYAg8EwEw8cVji5q+w66y2orgg8za4R9Ylxx/v5f3v4z7BXeIGPAXMtsKxL8XHWWl8vc77Ma2buZS70ynZd9b7GGwaW8bFAO8H+rB/HalBAM3PGEldBNZOteId6K7LTgEpT5catRwdn9eK0Cpa1wIghm4oar2WOzuxmCp773SrM00rOeV/my6v1Ndj3ZGyXVvQZqbTu4WVpBVe0Y30cZNECsNrwYaZBw/ZfKQugipnqitHccDuQd5ORjM8uQXdMx1S+4KgTYRtsZTlkJlphyfYOxD3uJcN2I2FebpCkJFmRBtM1owu8wrobKdwa5ezCI5IXFbaygdKE3bC3FC/DIAXZE6MoCDLCxvNyDgjpWqJrqoLZNO3JOO0hiwkOotGqzwbl+ZtiBh2YCBsUfFmqTbIkbyiE/jJ2fsLydWFaL43khTp+3zavxR4vDFe94KfSecFt8LHwmKMbEKOY47PqRuwQo7MszZ5ETQhmgZEPcxx/jJCAdBrbcPJzLGg+ctqcvl3kr+bnxbE7MgSCUKm91xNhF6LENzFDTsGfE2wHRZ5tBqhNH50pQJphV0MmS2eduEcOAZSoSP77pwNytszXOCn/+cMDT+JxX2+cd+f9bgCa9yh2/cfj3Gtp76rPoyxYmTpMneoSkDde/W7xh+Zb0KDUPXeQv6RplMQVwfJUgww87+cHnDs8QFcPfau7BG3KEbaJYVHouA9ds8dy5T9GpPq0= 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)(66476007)(6666004)(66946007)(36756003)(31686004)(53546011)(8936002)(66556008)(4326008)(8676002)(83380400001)(26005)(508600001)(54906003)(38100700002)(6512007)(316002)(6486002)(7416002)(31696002)(186003)(2906002)(6506007)(2616005)(86362001)(5660300002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?eWdTV2I0RWxKSVM4azBoY0lTZmIyUTV4ak1wVFVTYm5KekUwZm1MeHYydVBo?= =?utf-8?B?cVBpUWJVTUZzcFdkVVM0U0dIL05tdnFneC9Sb1ZreFlJYWdCa3lmUDQ4ZHY5?= =?utf-8?B?d2RJNm1wT1NJMEJDMURiek5GY2NYTGRSVndhUTZnTWRHQkp2NEg3blg2THZv?= =?utf-8?B?V1UrcXB4cDd5S0Vpd2R0TWp3a0kzc3poSEZka1lhT2ZF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0laZlNlZmhkR1M2NkRVNE9KTzE4Q3M1MG5uYWptWEduaHo0ZVJOa3VQeE1G?= =?utf-8?B?d2kxY2pqUCtRRFkrYzZKNWh1SC95aVVlVkUvRHlBWThpL3oyS2dPdXYzV2FB?= =?utf-8?B?bGZoWTBpSFF2dWFsSS9oL0ViZ2FveGY0T0VOUGFsZWFQLzFxOWRJbE9DZ25T?= =?utf-8?B?OVUrK0FZL2c4VEx3Y3ZOSG5TVHZ2MTJub0VldndFVmdJVlp1eXRFUG1wcllr?= =?utf-8?B?aVE0YmpmVjhKbmVoTnM5QXNFMkxvTDlkVklxQi8wN0hXRUZGd2JqWnJpdEVY?= =?utf-8?B?OTM2NS9vZEJRM25YR1BvVTZWUWRjUlJNWGJvc2xHOStENmY5aGRjQT09?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: bdb47771-ebd4-412a-ebba-08da47b583a9 X-MS-Exchange-CrossTenant-AuthSource: IA1PR12MB6434.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2022 12:10:15.2606 (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: QCWaJDdoUePOUcktbuxfyNdFdex56ReyhO/cVIJxE9Xkc9EAnoWerpcjb8ZomGTiS5CUhWOck1mpS6AuD24npg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1934 X-Spam-Status: No, score=-4.9 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 6/6/2022 5:24 PM, Aneesh Kumar K.V wrote: > Aneesh Kumar K V writes: >> > Can you try this change? > > diff --git a/drivers/dax/kmem.c b/drivers/dax/kmem.c > index 7a11c387fbbc..905609260dda 100644 > --- a/drivers/dax/kmem.c > +++ b/drivers/dax/kmem.c > @@ -94,6 +94,17 @@ static int dev_dax_kmem_probe(struct dev_dax *dev_dax) > goto err_reg_mgid; > data->mgid = rc; > > + /* > + * This get called before the node is brought online. That > + * is because depending on the value of mhp_default_online_type > + * the kernel will online the memory along with hotplug > + * operation. Add the new memory tier before we try to bring > + * memory blocks online. Otherwise new node will get added to > + * the default memory tier via hotplug callbacks. > + */ > +#ifdef CONFIG_TIERED_MEMORY > + node_set_memory_tier(numa_node, MEMORY_TIER_PMEM); > +#endif > for (i = 0; i < dev_dax->nr_range; i++) { > struct resource *res; > struct range range; > @@ -148,9 +159,6 @@ 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 > return 0; > > err_request_mem: Yes, this fixes the issue for me. Thanks. Regards, Bharata.