From mboxrd@z Thu Jan 1 00:00:00 1970 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 B04E7C433F5 for ; Fri, 22 Apr 2022 19:56:05 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3C1EB6B0081; Fri, 22 Apr 2022 15:56:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 348296B0082; Fri, 22 Apr 2022 15:56:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 173E76B0083; Fri, 22 Apr 2022 15:56:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id 05DE86B0081 for ; Fri, 22 Apr 2022 15:56:05 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id CF66724C99 for ; Fri, 22 Apr 2022 19:56:04 +0000 (UTC) X-FDA: 79385571048.23.BA3709E Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf07.hostedemail.com (Postfix) with ESMTP id 69D6240029 for ; Fri, 22 Apr 2022 19:56:03 +0000 (UTC) Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 23MHnjdp025864; Fri, 22 Apr 2022 19:56:02 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=04STmEqe5u5BMaOs7DSkgySzGj61M92rE1OARfFQvtE=; b=G2MGAsS/y0h79mO20XiIlN3WLTv4vYWfnqSXUlZz8xzFAH1ADXqIytGZD1+djCU534DZ QlUjl4iVKSc3FneFqHocBmAhA/1qbVov9/GtgYC/G0u2FLQzciupNvMxDfSF3GFvLHma vcz9qFXa/5FYiHBlMgQRsyG69zIfWJsa3ERwBsvN8ROSFAqcIqqlyMFiIUDgiwCVFV2w sEgrpDh/ee0YXvbmCah4o0XuYoUxz62sG/PxZsVhIBuZMQ5iG3TiWO/5OaSczV/1lxjx xnpAo5n/9aHK0zS/g+0fpHpZ3efYt5ocCpmPIVaIiHMadhnhcde8AI3vlp79JZD23urX 7Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3fkm5q9unv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Apr 2022 19:56:02 +0000 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 23MJZHwP035931; Fri, 22 Apr 2022 19:56:02 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 3fkm5q9unb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Apr 2022 19:56:01 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 23MJjMko020138; Fri, 22 Apr 2022 19:55:59 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma04ams.nl.ibm.com with ESMTP id 3ffne99tgn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 22 Apr 2022 19:55:59 +0000 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 23MJtuBg37749180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 22 Apr 2022 19:55:56 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 28D5F11C04C; Fri, 22 Apr 2022 19:55:56 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F3C0811C04A; Fri, 22 Apr 2022 19:55:52 +0000 (GMT) Received: from li-6e1fa1cc-351b-11b2-a85c-b897023bb5f3.ibm.com.com (unknown [9.43.112.230]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 22 Apr 2022 19:55:52 +0000 (GMT) From: Jagdish Gediya To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org Cc: baolin.wang@linux.alibaba.com, dave.hansen@linux.intel.com, ying.huang@intel.com, aneesh.kumar@linux.ibm.com, shy828301@gmail.com, weixugc@google.com, gthelen@google.com, dan.j.williams@intel.com, Jagdish Gediya Subject: [PATCH v3 7/7] docs: numa: Add documentation for demotion Date: Sat, 23 Apr 2022 01:25:16 +0530 Message-Id: <20220422195516.10769-8-jvgediya@linux.ibm.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220422195516.10769-1-jvgediya@linux.ibm.com> References: <20220422195516.10769-1-jvgediya@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: eLaW0tlhh9_-kMbPEf1AAeNqm613K_JR X-Proofpoint-GUID: 8XX4G7vY-17mP6Mx995RZH3Xu56D4qqO X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-04-22_06,2022-04-22_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 spamscore=0 clxscore=1011 bulkscore=0 phishscore=0 priorityscore=1501 lowpriorityscore=0 malwarescore=0 mlxscore=0 suspectscore=0 mlxlogscore=987 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204220083 Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b="G2MGAsS/"; spf=pass (imf07.hostedemail.com: domain of jvgediya@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=jvgediya@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com X-Rspam-User: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 69D6240029 X-Stat-Signature: 8xurd4n1tppcheutyi4xai3h3aasbpup X-HE-Tag: 1650657363-474641 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: Add documentation for demotion mentioning about why is it required and all the sysfs interfaces available related to demotion. Signed-off-by: Jagdish Gediya --- Documentation/admin-guide/mm/index.rst | 1 + .../admin-guide/mm/numa_demotion.rst | 57 +++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 Documentation/admin-guide/mm/numa_demotion.rst diff --git a/Documentation/admin-guide/mm/index.rst b/Documentation/admin-guide/mm/index.rst index c21b5823f126..4bd0ed3de9c5 100644 --- a/Documentation/admin-guide/mm/index.rst +++ b/Documentation/admin-guide/mm/index.rst @@ -34,6 +34,7 @@ the Linux memory management. memory-hotplug nommu-mmap numa_memory_policy + numa_demotion numaperf pagemap soft-dirty diff --git a/Documentation/admin-guide/mm/numa_demotion.rst b/Documentation/admin-guide/mm/numa_demotion.rst new file mode 100644 index 000000000000..252be9dc0517 --- /dev/null +++ b/Documentation/admin-guide/mm/numa_demotion.rst @@ -0,0 +1,57 @@ +.. SPDX-License-Identifier: GPL-2.0 + +================== +NUMA Demotion +================== + +What is demotion required? +============================ + +With the advent of various new memory types, Systems have multiple +types of memory, e.g. DRAM and PMEM (persistent memory). The memory +subsystem of such systems can be called memory tiering system, +because the performance of the different types of memory are usually +different. + +In a system with some DRAM and some persistent memory, once DRAM +fills up, reclaim will start and some of the DRAM contents will be +thrown out to swap even if there is space in persistent memory. +Allocations will, at some point, start falling over to the slower +persistent memory. + +Instead of page being discarded during reclaim, it can be moved to +persistent memory. Allowing page migration during reclaim enables +these systems to migrate pages from fast tiers to slow tiers when +the fast tier is under pressure. + +SYSFS interface +====================== + +Enable/Disable demotion +------------------------ + +By default demotion is disabled, it can be enabled/disabled using below +sysfs interface, + +echo 0/1 or false/true > /sys/kernel/mm/numa/demotion_enabled + +Read system demotion targets +----------------------------- +cat /sys/devices/system/node/demotion_targets + +Kernel shows node_states[N_DEMOTION_TARGETS] when this command +is run. + +Override default demotion targets +--------------------------------- +echo > /sys/devices/system/node/demotion_targets + +If nodelist is valid and subset of N_MEMORY then +node_states[N_DEMOTION_TARGETS] is set to this new nodelist, and +kernel builds the new demotion list based on it. + +Read per node demotion targets +------------------------------- +cat /sys/devices/system/node/nodeX/demotion_targets + +It shows per node demotion targets configured by kernel. -- 2.35.1