Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2365912ioo; Sat, 28 May 2022 11:25:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwFmmmzS28rqaAUYjbPOKXgVqWHUNgXIPrHBTP1lV2sPxulng13xzMRC/8sdWDj0Rm4jo9b X-Received: by 2002:a17:90b:4a8c:b0:1df:c71d:5104 with SMTP id lp12-20020a17090b4a8c00b001dfc71d5104mr14553841pjb.216.1653762324259; Sat, 28 May 2022 11:25:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653762324; cv=none; d=google.com; s=arc-20160816; b=SpMKT17rtmeO8QPU9tn/c3EebbCM12j4+e2XUdJOjkKwoXDZ5UBi4eaF+iS2x0xLfA NIIHyBrmjswd+Z7iRxBjl52LY8/B2/tR7jQ560bCZ3kdxPtJIhIe2Rj3v7OLyhLWRGMD hXpM/bZHXWRNcz95r2g9poa/BXtUvZf1yzZSbaEc6PR1LhEQMeZzbk/i3opv9PfNOSHM 2808VddSnj7NvNSRqxeX75QAI9/i3JM5YrrAy7v+ddCujtph/p/8erPkL5UrCMgPfkEk 3Sh9QdvpS6NV2ASc6ocahaJa+w1STYLj7PAtyaX05z2yXe9znW9Jkcdr4H0WyAWwr/Ar rDVA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=NMpA+V1bfC+kM9xtdNjyw4XB6F+J5PWCsONsomp9VQ8=; b=oLGO7Sq5rvB9/uSry86SUfrM12S7fnj+5402IDkEN51KA9odAaApOI2t9KME0A9NPt ISTEgoO0piFCDbZ/DFs6FVrE9pvE5k2z0BgDyoBkGKshUsC5s7qWS2v+lJWjGjcD29P+ RCVNI7c0v/ohP+GAlmVtt1u7tN74XpK/z1FGckzk1Q0Uza4z7hdaeJLPwsyk9xeiW7Pl EsMaXr6s3/zgZQCk238O+MU8SPLRmG2VrnCz8cwia59RMm11ZPx7DEezJaw1WvzPL9I1 zdVxdtUcR33ySxIdEk1j+pL8U2hS5eXrScN4sY2Y+7yi5ewMvjWDNWw8fuNIWBqJiOmQ wEqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=EE1AFDe1; 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=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k7-20020a170902d58700b001615a62cf93si9226006plh.544.2022.05.28.11.25.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 11:25:24 -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=@ibm.com header.s=pp1 header.b=EE1AFDe1; 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=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 D1B6217A9B; Sat, 28 May 2022 11:25:09 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349510AbiE0Mkp (ORCPT + 99 others); Fri, 27 May 2022 08:40:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351588AbiE0Mjy (ORCPT ); Fri, 27 May 2022 08:39:54 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D1E37DE28 for ; Fri, 27 May 2022 05:27:11 -0700 (PDT) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24RBHqs5019718; Fri, 27 May 2022 12:26:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=NMpA+V1bfC+kM9xtdNjyw4XB6F+J5PWCsONsomp9VQ8=; b=EE1AFDe1Evh9tyLeFGCHNLsXmPPL77oD+sx3xBdle4X7G9UkEMdovydgO7Fam3450p4G oNwIiFqeS3lbJPrTIkv3gsovs24L2cKGplRMFLHAR5ni5vwl8DPx43QuQ0wDWSvG27Tk bixFwMvfwiVLOwRGlT9HsWne24ER8aJewnHgvatqM6PO3/fcoz3WeRUh9QTNJDLV5ooP AMYLVbhQLZN/4wgxAvspBzszq9sn5qRhHNV286djJyHSmeEoVLjNjg4wz4DPHhQ9QE94 CGOsfzwOSnQY7ulBzHHbRhR6WIW6hnereSlL7pSoFJaFj+u5l/zaAs2z3GiCy05BRuom Wg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3gawn7s575-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 May 2022 12:26:56 +0000 Received: from m0098416.ppops.net (m0098416.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 24RCJVpf008350; Fri, 27 May 2022 12:26:56 GMT Received: from ppma02wdc.us.ibm.com (aa.5b.37a9.ip4.static.sl-reverse.com [169.55.91.170]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3gawn7s56r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 May 2022 12:26:56 +0000 Received: from pps.filterd (ppma02wdc.us.ibm.com [127.0.0.1]) by ppma02wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 24RCKutu006361; Fri, 27 May 2022 12:26:55 GMT Received: from b01cxnp23033.gho.pok.ibm.com (b01cxnp23033.gho.pok.ibm.com [9.57.198.28]) by ppma02wdc.us.ibm.com with ESMTP id 3gagpkvfkp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 27 May 2022 12:26:55 +0000 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 24RCQsXl40763888 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 27 May 2022 12:26:54 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7E411AE05F; Fri, 27 May 2022 12:26:54 +0000 (GMT) Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1AF45AE05C; Fri, 27 May 2022 12:26:47 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.43.91.191]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 27 May 2022 12:26:46 +0000 (GMT) From: "Aneesh Kumar K.V" To: 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 , "Aneesh Kumar K . V" Subject: [RFC PATCH v4 4/7] mm/demotion/dax/kmem: Set node's memory tier to MEMORY_TIER_PMEM Date: Fri, 27 May 2022 17:55:25 +0530 Message-Id: <20220527122528.129445-5-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220527122528.129445-1-aneesh.kumar@linux.ibm.com> References: <20220527122528.129445-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: lxJz5G3F24fRPN59Z5UgaLwEjy0CZpHn X-Proofpoint-ORIG-GUID: 7gNicu8INe--vcQ4WVA43G3AVzmpzCDX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-27_03,2022-05-27_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 mlxscore=0 suspectscore=0 mlxlogscore=999 adultscore=0 lowpriorityscore=0 spamscore=0 malwarescore=0 impostorscore=0 phishscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2205270057 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 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 return 0; err_request_mem: diff --git a/mm/migrate.c b/mm/migrate.c index d819a64db5b1..59d8558dd2ee 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2418,6 +2418,8 @@ int node_set_memory_tier(int node, int tier) return ret; } +EXPORT_SYMBOL_GPL(node_set_memory_tier); + /** * next_demotion_node() - Get the next node in the demotion path -- 2.36.1