From patchwork Mon Jun 6 04:53:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 12869963 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 97A2BC433EF for ; Mon, 6 Jun 2022 04:54:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id ADD128D0003; Mon, 6 Jun 2022 00:54:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A87188D0002; Mon, 6 Jun 2022 00:54:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 929258D0003; Mon, 6 Jun 2022 00:54:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 8288F8D0002 for ; Mon, 6 Jun 2022 00:54:32 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 4EE525A3 for ; Mon, 6 Jun 2022 04:54:32 +0000 (UTC) X-FDA: 79546595184.23.9AD61A0 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by imf28.hostedemail.com (Postfix) with ESMTP id 83157C004E for ; Mon, 6 Jun 2022 04:53:48 +0000 (UTC) Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 25611ZES023526; Mon, 6 Jun 2022 04:54:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : in-reply-to : references : date : message-id : mime-version : content-type; s=pp1; bh=AK8VTiHmZxVWgxKU+PEg8p6oOO/RT8TA0ohFC90Evak=; b=hsROOd57sQ8HZ3p9Ln6kgn2UM2hoFhqBSyPKyLVZ75B9qrxT4AF1earP2/q1jLz3T/EY 7PLuwF/BOdeY4A6qnA25xL7Fp0xcZ29aS0upUsvufgCk+AQhlLjP0bigQSngah0by9Vr 1drJNWOjbf2C6GU248wI7DLlA6M/v1WB0EhY4+r7J0qLN/ju6R+kSFLcM2YvjkXbdxOL EvAMA/t3qIN3Rw6VNKGWjMSpU8ujYBpTBQIpVgnoaBymzrAqU6D7b14Dgi3o2vYieucu dt21+K0YbsdylPR0dseQwZLoKTRbL51Ndtgi+YeiP21HjV5vW//XOJAFt+YrJy0jZnrY Pg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3gg206s6wg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Jun 2022 04:54:08 +0000 Received: from m0098414.ppops.net (m0098414.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2564nroK014495; Mon, 6 Jun 2022 04:54:08 GMT Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3gg206s6w7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Jun 2022 04:54:08 +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 2564oAW5024146; Mon, 6 Jun 2022 04:54:07 GMT Received: from b01cxnp23034.gho.pok.ibm.com (b01cxnp23034.gho.pok.ibm.com [9.57.198.29]) by ppma03wdc.us.ibm.com with ESMTP id 3gfy19b9c6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Jun 2022 04:54:07 +0000 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2564s7JM25100606 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Jun 2022 04:54:07 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EE9BC124058; Mon, 6 Jun 2022 04:54:06 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 650C6124053; Mon, 6 Jun 2022 04:53:59 +0000 (GMT) Received: from skywalker.linux.ibm.com (unknown [9.43.87.254]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 6 Jun 2022 04:53:59 +0000 (GMT) X-Mailer: emacs 29.0.50 (via feedmail 11-beta-1 I) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: Wei Xu , 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 Subject: [PATCH] mm/demotion: Add sysfs ABI documentation In-Reply-To: <20220603134237.131362-1-aneesh.kumar@linux.ibm.com> References: <20220603134237.131362-1-aneesh.kumar@linux.ibm.com> Date: Mon, 06 Jun 2022 10:23:56 +0530 Message-ID: <87r1428k9n.fsf@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: APa9aTVJURlGYUqnOxoSaN0iZv8cQcAQ X-Proofpoint-GUID: Kgl80yoV0xVh-NuSz9ALzJJ-2uXVBDmi X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-06_01,2022-06-03_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxscore=0 suspectscore=0 impostorscore=0 bulkscore=0 mlxlogscore=999 lowpriorityscore=0 spamscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2204290000 definitions=main-2206060023 X-Rspamd-Queue-Id: 83157C004E X-Stat-Signature: xfwkqjemcxss9fbe6n1io5gyz1f753qs X-Rspam-User: Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=hsROOd57; spf=pass (imf28.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.158.5 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com X-Rspamd-Server: rspam08 X-HE-Tag: 1654491228-543998 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: From dd986c5aab4f6ccf41cc8d2dde5d9702a17adb6f Mon Sep 17 00:00:00 2001 From: "Aneesh Kumar K.V" Date: Mon, 6 Jun 2022 10:14:17 +0530 Subject: [PATCH] mm/demotion: Add sysfs ABI documentation Add sysfs ABI documentation. Suggested-by: Wei Xu Signed-off-by: Aneesh Kumar K.V --- .../ABI/testing/sysfs-kernel-mm-memory-tiers | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers diff --git a/Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers b/Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers new file mode 100644 index 000000000000..41b0d1756ddb --- /dev/null +++ b/Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers @@ -0,0 +1,81 @@ +What: /sys/devices/system/memtier/ +Date: Jun 2022 +Contact: Linux memory management mailing list +Description: Interface for tiered memory + + This is the directory containing the information about memory tiers. + + Each memory tier has its own subdirectory. + + The order of memory tiers is determined by their rank values, not by + their memtier device names. A higher rank value means a higher tier. + +What: /sys/devices/system/memtier/default_tier +Date: Jun 2022 +Contact: Linux memory management mailing list +Description: Interface for tiered memory + + The default memory tier to which memory would get added via hotplug + if the NUMA node is not part of any memory tier. + +What: /sys/devices/system/memtier/max_tier +Date: Jun 2022 +Contact: Linux memory management mailing list +Description: Interface for tiered memory + + The max memory tier device ID we can create. Users can create memory + tiers in range [0 - max_tier) + +What: /sys/devices/system/memtier/memtierN/ +Date: Jun 2022 +Contact: Linux memory management mailing list +Description: Interface for tiered memory + + This is the directory containing the information about a particular + memory tier, memtierN, where N is the memtier device ID (e.g. 0, 1). + + The memtier device ID number itself is just an identifier and has no + special meaning, i.e. memtier device ID numbers do not determine the + order of memory tiers. + +What: /sys/devices/system/memtier/memtierN/rank +Date: Jun 2022 +Contact: Linux memory management mailing list +Description: Interface for tiered memory + + + When read, list the "rank" value associated with memtierN. + + "Rank" is an opaque value. Its absolute value doesn't have any + special meaning. But the rank values of different memtiers can be + compared with each other to determine the memory tier order. + + For example, if we have 3 memtiers: memtier0, memtier1, memiter2, and + their rank values are 100, 10, 50, then the memory tier order is: + memtier0 -> memtier2 -> memtier1, where memtier0 is the highest tier + and memtier1 is the lowest tier. + + The rank value of each memtier should be unique. + +What: /sys/devices/system/memtier/memtierN/nodelist +Date: Jun 2022 +Contact: Linux memory management mailing list +Description: Interface for tiered memory + + + When read, list the memory nodes in the specified tier. + +What: /sys/devices/system/node/nodeN/memtier +Date: Jun 2022 +Contact: Linux memory management mailing list +Description: Interface for tiered memory + + When read, list the device ID of the memory tier that the node belongs + to. Its value is empty for a CPU-only NUMA node. + + When written, the kernel moves the node into the specified memory + tier if the move is allowed. The tier assignments of all other + nodes are not affected. + + When written with the special string "none" the specific node is removed + from participating in memory demotion.