Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp983635pxb; Fri, 22 Apr 2022 15:58:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6mTT8VzLuklqcliNleN91biKLk2QhBMfA8dW7ZhUWP/ZlXjfuqsFP/2Wil2iveCXA3hhr X-Received: by 2002:a17:902:9a0a:b0:158:a22a:5448 with SMTP id v10-20020a1709029a0a00b00158a22a5448mr6928952plp.20.1650668282431; Fri, 22 Apr 2022 15:58:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650668282; cv=none; d=google.com; s=arc-20160816; b=Wq352am+qFW2bhtvdZUUxa+KlCcsE4ypwilrG6uAsjptGK/wjv4wj5C1eYvnznXzn5 Ss8FhfIFwwHVVZcXmg4ja3F0Y5kQk6ZxLkmWDC8SyF2PfUQpdFmONZqXnmlJ9wnvnSsI 6uzjx/IOSYAjxgizUNKA6+uEIcyPmjwZN9C7+auuLjT/GCcsdxGkr8baD4XckwHLsBfN /l40adtPWlV/jZbSk+za8nRiyEJkApuUj6LtyyWiMXXvA4Dqu5ZggcZDZI6m8ra9Qyru HIwkTGYvPvP1i2rcUi09rsgWZ33BRwV7nSg00wNG+WiObDoE86+OpJJ2UjA4lNmXy90r /fNg== 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=04STmEqe5u5BMaOs7DSkgySzGj61M92rE1OARfFQvtE=; b=PkNnxZTa3R5N39j/iljqol7v1S22bp333I9buQNdF/lfTCxN4e2VoYFGkwzLTEpxOB KWMTL4UQLaHgFS/d3AoVD5MHxiJC6ZGC1LdWhQ3ABbbRNxEP4yMv85SkLn2hxPNi2HGF 2I35FZSiOSy3KZN4spqcPVdeQ7hRC9y5cf9XKVawuEuo9+6d3L7NojcJ8+GVXx4ccgmu B4Fte06pPYUFMqUCcGH52plcd8qcYUmNPAbMst77gU87kz8VI3DHHQNmwnMrEYn+D94g hG3oyudyKOIb6L46Ui8vQIMXrWr/K32j3TR59z9K+s7/sob781uQQ5tH9D8ZUpkwYb08 R7cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="G2MGAsS/"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id i2-20020a63e442000000b0039924bcb6a9si9764175pgk.172.2022.04.22.15.58.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 15:58:02 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b="G2MGAsS/"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 9D3501773E2; Fri, 22 Apr 2022 15:03:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231472AbiDVWGI (ORCPT + 99 others); Fri, 22 Apr 2022 18:06:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231617AbiDVWFw (ORCPT ); Fri, 22 Apr 2022 18:05:52 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30F89156110 for ; Fri, 22 Apr 2022 13:49:11 -0700 (PDT) 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 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 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 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