Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

memory tier, sysfs: rename attribute "nodes" to "nodelist"

In sysfs, we use attribute name "cpumap" or "cpus" for cpu mask and
"cpulist" or "cpus_list" for cpu list. For example, in my system,

$ cat /sys/devices/system/node/node0/cpumap
f,ffffffff
$ cat /sys/devices/system/cpu/cpu2/topology/core_cpus
0,00100004
$ cat cat /sys/devices/system/node/node0/cpulist
0-35
$ cat /sys/devices/system/cpu/cpu2/topology/core_cpus_list
2,20

It looks reasonable to use "nodemap" for node mask and "nodelist" for
node list. So, rename the attribute to follow the naming convention.

Link: https://lkml.kernel.org/r/20221020015122.290097-1-ying.huang@intel.com
Fixes: 9832fb87834e2b ("mm/demotion: expose memory tier details via sysfs")
Signed-off-by: "Huang, Ying" <ying.huang@intel.com>
Acked-by: Wei Xu <weixugc@google.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Reviewed-by: Yang Shi <shy828301@gmail.com>
Reviewed-by: Davidlohr Bueso <dave@stgolabs.net>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Bharata B Rao <bharata@amd.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Hesham Almatary <hesham.almatary@huawei.com>
Cc: Jagdish Gediya <jvgediya.oss@gmail.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Tim Chen <tim.c.chen@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Huang Ying and committed by
Andrew Morton
27d676a1 b214fadf

+6 -6
+2 -2
Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers
··· 10 10 11 11 12 12 What: /sys/devices/virtual/memory_tiering/memory_tierN/ 13 - /sys/devices/virtual/memory_tiering/memory_tierN/nodes 13 + /sys/devices/virtual/memory_tiering/memory_tierN/nodelist 14 14 Date: August 2022 15 15 Contact: Linux memory management mailing list <linux-mm@kvack.org> 16 16 Description: Directory with details of a specific memory tier ··· 21 21 A smaller value of N implies a higher (faster) memory tier in the 22 22 hierarchy. 23 23 24 - nodes: NUMA nodes that are part of this memory tier. 24 + nodelist: NUMA nodes that are part of this memory tier. 25 25
+4 -4
mm/memory-tiers.c
··· 131 131 kfree(tier); 132 132 } 133 133 134 - static ssize_t nodes_show(struct device *dev, 135 - struct device_attribute *attr, char *buf) 134 + static ssize_t nodelist_show(struct device *dev, 135 + struct device_attribute *attr, char *buf) 136 136 { 137 137 int ret; 138 138 nodemask_t nmask; ··· 143 143 mutex_unlock(&memory_tier_lock); 144 144 return ret; 145 145 } 146 - static DEVICE_ATTR_RO(nodes); 146 + static DEVICE_ATTR_RO(nodelist); 147 147 148 148 static struct attribute *memtier_dev_attrs[] = { 149 - &dev_attr_nodes.attr, 149 + &dev_attr_nodelist.attr, 150 150 NULL 151 151 }; 152 152