From patchwork Tue Aug 30 04:42:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 12958752 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61B71ECAAD1 for ; Tue, 30 Aug 2022 04:42:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8B6C5940008; Tue, 30 Aug 2022 00:42:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 865E5940007; Tue, 30 Aug 2022 00:42:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6E01E940008; Tue, 30 Aug 2022 00:42:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 5C754940007 for ; Tue, 30 Aug 2022 00:42:38 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 2A412A01DC for ; Tue, 30 Aug 2022 04:42:38 +0000 (UTC) X-FDA: 79855013196.10.2ADBAE5 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf04.hostedemail.com (Postfix) with ESMTP id C6A9240013 for ; Tue, 30 Aug 2022 04:42:36 +0000 (UTC) Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27U4Km3m010039; Tue, 30 Aug 2022 04:42:22 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : mime-version : content-type : content-transfer-encoding; s=pp1; bh=cHcAyJQxcN5coWhjTOmFLDC9BLXPhcUenvryaCOl6DQ=; b=qJ5DPNX1FGK2JZTrttbMnRkNVAGWsH6wF7d9mOL/JspiVVTKz/BnfCYMmQqXTLp0wDbd JXo1dan0Zd/JDLLc0jTuc2hUrAnaFQB1GqIgSbr5ETkty67bm13meebI+Zd6eKpUSBQ2 6nbiOvIjuFNfBDaGbizm0WS43+k0aqZNndtW02jIaN8nTlU+FpDbAlJZs8c+qdYN2HdE bfCDy+7PHiXVJV9ej/TIBZM8Uev3kpgQjhE/31GxeqylfeAi+6uvbhTHnlgDIS72hE2z xVt2blRUPJKih8UE5JU+LN4q45CG8tNqx5aN7xT0uyONBUg5gQX06zs+5p9XO2pcXd4J jQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3j9ben0tes-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Aug 2022 04:42:22 +0000 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 27U4Mq82024987; Tue, 30 Aug 2022 04:42:21 GMT Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3j9ben0tdw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Aug 2022 04:42:21 +0000 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 27U4ZfZr012657; Tue, 30 Aug 2022 04:42:20 GMT Received: from b01cxnp23033.gho.pok.ibm.com (b01cxnp23033.gho.pok.ibm.com [9.57.198.28]) by ppma03wdc.us.ibm.com with ESMTP id 3j7aw99f2x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Aug 2022 04:42:20 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 27U4gJ5r64225778 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 30 Aug 2022 04:42:19 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 36685AC060; Tue, 30 Aug 2022 04:42:19 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7E211AC059; Tue, 30 Aug 2022 04:42:13 +0000 (GMT) Received: from skywalker.ibmuc.com (unknown [9.43.77.247]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Tue, 30 Aug 2022 04:42:13 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: Wei Xu , Huang Ying , Yang Shi , Davidlohr Bueso , Tim C Chen , Michal Hocko , Linux Kernel Mailing List , Hesham Almatary , Dave Hansen , Jonathan Cameron , Alistair Popple , Dan Williams , Johannes Weiner , jvgediya.oss@gmail.com, Bharata B Rao , "Aneesh Kumar K.V" Subject: [PATCH mm-unstable] mm/demotion: Fix build error with CONFIG_MIGRATION disabled Date: Tue, 30 Aug 2022 10:12:10 +0530 Message-Id: <20220830044210.17546-1-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: ms_3wKFoDG7SuOiU16agbwBvt1PyFDV7 X-Proofpoint-GUID: GhD6_EsfBXZGg-d9TgHR1S6yDgGilRXK X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-29_13,2022-08-25_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 impostorscore=0 mlxlogscore=999 spamscore=0 clxscore=1015 mlxscore=0 malwarescore=0 suspectscore=0 adultscore=0 phishscore=0 bulkscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208300021 ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=qJ5DPNX1; spf=pass (imf04.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661834557; a=rsa-sha256; cv=none; b=xCrod4j3qqxVb7l1uTSmp2P5SJ7wMbFQXvythyOaUJ4/PgvpxUoqkr7BekCjiUp1SMg4hU BMFfGRDOM2Naer/ljRJFLVwtZ+8aSVGmeJ4+zFYD3AbBRPZguQqrMXkazVurgtcH7NfV0R jd8yTYsLJvDYiaqKY0KYCDaFlFIyMmg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661834557; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=cHcAyJQxcN5coWhjTOmFLDC9BLXPhcUenvryaCOl6DQ=; b=Aq3+ufzCiSfe0Ys4irPKt8LZXcEejsX9kjXu+DOzjq8NzcPR3haCn018uXeVm9ECsmVsvz 07SSHq6bHJZQeO/YNEza/abu7zPV9YHsdP9djSwpPNHIkBBhfpNgzl7o+d5iFCvZU578Ol nzdERDJzAvAvSKHEQeWXPBA0he/mcYw= X-Stat-Signature: t1euahoyxiw17or937zs66fu5wznk4nh X-Rspam-User: Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=qJ5DPNX1; spf=pass (imf04.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: C6A9240013 X-HE-Tag: 1661834556-556296 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: mm/memory-tiers.c: In function ‘toptier_nodes_show’: mm/memory-tiers.c:647:49: error: ‘top_tier_adistance’ undeclared (first use in this function); did you mean ‘iov_iter_advance’? 647 | if (memtier->adistance_start >= top_tier_adistance) | ^~~~~~~~~~~~~~~~~~ | iov_iter_advance mm/memory-tiers.c:647:49: note: each undeclared identifier is reported only once for each function it appears in make[1]: *** [scripts/Makefile.build:249: mm/memory-tiers.o] Error 1 Fixes: mm/demotion: Expose memory tier details via sysfs Signed-off-by: Aneesh Kumar K.V --- mm/memory-tiers.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mm/memory-tiers.c b/mm/memory-tiers.c index d4648d4e4d54..b6c7e5987829 100644 --- a/mm/memory-tiers.c +++ b/mm/memory-tiers.c @@ -635,6 +635,7 @@ static int __meminit memtier_hotplug_callback(struct notifier_block *self, return notifier_from_errno(0); } +#ifdef CONFIG_MIGRATION static ssize_t toptier_nodes_show(struct device *dev, struct device_attribute *attr, char *buf) { @@ -654,6 +655,15 @@ static ssize_t toptier_nodes_show(struct device *dev, mutex_unlock(&memory_tier_lock); return ret; } +#else +static ssize_t toptier_nodes_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + nodemask_t top_tier_mask = node_states[N_MEMORY]; + + return sysfs_emit(buf, "%*pbl\n", nodemask_pr_args(&top_tier_mask)); +} +#endif static DEVICE_ATTR_RO(toptier_nodes); static struct attribute *memtier_subsys_attrs[] = {