Skip to contentSkip to conversation

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

PATCH Applied Huang Ying 6 participants 6 messages Oct 20, 2022 – Oct 24, 2022

Subsystems (3)
lore
Share & tools
lore

Huang Ying

author
#0 lore raw

PATCH 1/1 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.

Cc Aneesh Kumar K.V <[email protected]>
Cc Alistair Popple <[email protected]>
Cc Bharata B Rao <[email protected]>
Cc Dan Williams <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Davidlohr Bueso <[email protected]>
Cc Hesham Almatary <[email protected]>
Cc Jagdish Gediya <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Tim Chen <[email protected]>
Cc Wei Xu <[email protected]>
Cc Yang Shi <[email protected]>
---
 Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers | 4 ++--
 mm/memory-tiers.c                                      | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers +2 -2
index 45985e411f13..721a05b90109 100644
@@ -10,7 +10,7 @@ Description:	A collection of all the memory tiers allocated.
 
 
 What:		/sys/devices/virtual/memory_tiering/memory_tierN/
-		/sys/devices/virtual/memory_tiering/memory_tierN/nodes
+		/sys/devices/virtual/memory_tiering/memory_tierN/nodelist
 Date:		August 2022
 Contact:	Linux memory management mailing list <[email protected]>
 Description:	Directory with details of a specific memory tier
@@ -21,5 +21,5 @@ Description:	Directory with details of a specific memory tier
 		A smaller value of N implies a higher (faster) memory tier in the
 		hierarchy.
 
-		nodes: NUMA nodes that are part of this memory tier.
+		nodelist: NUMA nodes that are part of this memory tier.
 
mm/memory-tiers.c +4 -4
index f116b7b6333e..fa8c9d07f9ce 100644
@@ -131,8 +131,8 @@ static void memory_tier_device_release(struct device *dev)
 	kfree(tier);
 }
 
-static ssize_t nodes_show(struct device *dev,
-			  struct device_attribute *attr, char *buf)
+static ssize_t nodelist_show(struct device *dev,
+			     struct device_attribute *attr, char *buf)
 {
 	int ret;
 	nodemask_t nmask;
@@ -143,10 +143,10 @@ static ssize_t nodes_show(struct device *dev,
 	mutex_unlock(&memory_tier_lock);
 	return ret;
 }
-static DEVICE_ATTR_RO(nodes);
+static DEVICE_ATTR_RO(nodelist);
 
 static struct attribute *memtier_dev_attrs[] = {
-	&dev_attr_nodes.attr,
+	&dev_attr_nodelist.attr,
 	NULL
 };
 
Signature · 1 line
2.35.1
Acked-by on v1 1/1
#1 lore raw
Quoted 87 lines · Huang Ying

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.

Cc Aneesh Kumar K.V <[email protected]>
Cc Alistair Popple <[email protected]>
Cc Bharata B Rao <[email protected]>
Cc Dan Williams <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Davidlohr Bueso <[email protected]>
Cc Hesham Almatary <[email protected]>
Cc Jagdish Gediya <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Tim Chen <[email protected]>
Cc Wei Xu <[email protected]>
Cc Yang Shi <[email protected]>
---
 Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers | 4 ++--
 mm/memory-tiers.c                                      | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers +2 -2
index 45985e411f13..721a05b90109 100644
@@ -10,7 +10,7 @@ Description:  A collection of all the memory tiers allocated.
 
 
 What:          /sys/devices/virtual/memory_tiering/memory_tierN/
-               /sys/devices/virtual/memory_tiering/memory_tierN/nodes
+               /sys/devices/virtual/memory_tiering/memory_tierN/nodelist
 Date:          August 2022
 Contact:       Linux memory management mailing list <[email protected]>
 Description:   Directory with details of a specific memory tier
@@ -21,5 +21,5 @@ Description:  Directory with details of a specific memory tier
                A smaller value of N implies a higher (faster) memory tier in the
                hierarchy.
 
-               nodes: NUMA nodes that are part of this memory tier.
+               nodelist: NUMA nodes that are part of this memory tier.
 
mm/memory-tiers.c +4 -5
index f116b7b6333e..fa8c9d07f9ce 100644
@@ -131,8 +131,8 @@ static void memory_tier_device_release(struct device *dev)
        kfree(tier);
 }
 
-static ssize_t nodes_show(struct device *dev,
-                         struct device_attribute *attr, char *buf)
+static ssize_t nodelist_show(struct device *dev,
+                            struct device_attribute *attr, char *buf)
 {
        int ret;
        nodemask_t nmask;
@@ -143,10 +143,10 @@ static ssize_t nodes_show(struct device *dev,
        mutex_unlock(&memory_tier_lock);
        return ret;
 }
-static DEVICE_ATTR_RO(nodes);
+static DEVICE_ATTR_RO(nodelist);
 
 static struct attribute *memtier_dev_attrs[] = {
-       &dev_attr_nodes.attr,
+       &dev_attr_nodelist.attr,
        NULL
 };
 
--

2.35.1

Reviewed-by on v1 1/1
#2 lore raw
In reply to Huang Ying
Quoted 12 lines · Huang Ying

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
Quoted 3 lines

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

Quoted 70 lines
Cc Aneesh Kumar K.V <[email protected]>
Cc Alistair Popple <[email protected]>
Cc Bharata B Rao <[email protected]>
Cc Dan Williams <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Davidlohr Bueso <[email protected]>
Cc Hesham Almatary <[email protected]>
Cc Jagdish Gediya <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Tim Chen <[email protected]>
Cc Wei Xu <[email protected]>
Cc Yang Shi <[email protected]>
---
 Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers | 4 ++--
 mm/memory-tiers.c                                      | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers +2 -2
index 45985e411f13..721a05b90109 100644
@@ -10,7 +10,7 @@ Description:	A collection of all the memory tiers allocated.
 
 
 What:		/sys/devices/virtual/memory_tiering/memory_tierN/
-		/sys/devices/virtual/memory_tiering/memory_tierN/nodes
+		/sys/devices/virtual/memory_tiering/memory_tierN/nodelist
 Date:		August 2022
 Contact:	Linux memory management mailing list <[email protected]>
 Description:	Directory with details of a specific memory tier
@@ -21,5 +21,5 @@ Description:	Directory with details of a specific memory tier
 		A smaller value of N implies a higher (faster) memory tier in the
 		hierarchy.
 
-		nodes: NUMA nodes that are part of this memory tier.
+		nodelist: NUMA nodes that are part of this memory tier.
 
mm/memory-tiers.c +4 -4
index f116b7b6333e..fa8c9d07f9ce 100644
@@ -131,8 +131,8 @@ static void memory_tier_device_release(struct device *dev)
 	kfree(tier);
 }
 
-static ssize_t nodes_show(struct device *dev,
-			  struct device_attribute *attr, char *buf)
+static ssize_t nodelist_show(struct device *dev,
+			     struct device_attribute *attr, char *buf)
 {
 	int ret;
 	nodemask_t nmask;
@@ -143,10 +143,10 @@ static ssize_t nodes_show(struct device *dev,
 	mutex_unlock(&memory_tier_lock);
 	return ret;
 }
-static DEVICE_ATTR_RO(nodes);
+static DEVICE_ATTR_RO(nodelist);
 
 static struct attribute *memtier_dev_attrs[] = {
-	&dev_attr_nodes.attr,
+	&dev_attr_nodelist.attr,
 	NULL
 };
 
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#3 lore raw
In reply to Huang Ying
Quoted 31 lines · Huang Ying

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.

Cc Aneesh Kumar K.V <[email protected]>
Cc Alistair Popple <[email protected]>
Cc Bharata B Rao <[email protected]>
Cc Dan Williams <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Davidlohr Bueso <[email protected]>
Cc Hesham Almatary <[email protected]>
Cc Jagdish Gediya <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Tim Chen <[email protected]>
Cc Wei Xu <[email protected]>
Cc Yang Shi <[email protected]>
Quoted 4 lines
---
 Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers | 4 ++--
 mm/memory-tiers.c                                      | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)
Quoted 52 lines
Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers +2 -2
index 45985e411f13..721a05b90109 100644
@@ -10,7 +10,7 @@ Description:  A collection of all the memory tiers allocated.
 
 
 What:          /sys/devices/virtual/memory_tiering/memory_tierN/
-               /sys/devices/virtual/memory_tiering/memory_tierN/nodes
+               /sys/devices/virtual/memory_tiering/memory_tierN/nodelist
 Date:          August 2022
 Contact:       Linux memory management mailing list <[email protected]>
 Description:   Directory with details of a specific memory tier
@@ -21,5 +21,5 @@ Description:  Directory with details of a specific memory tier
                A smaller value of N implies a higher (faster) memory tier in the
                hierarchy.
 
-               nodes: NUMA nodes that are part of this memory tier.
+               nodelist: NUMA nodes that are part of this memory tier.
 
mm/memory-tiers.c +4 -5
index f116b7b6333e..fa8c9d07f9ce 100644
@@ -131,8 +131,8 @@ static void memory_tier_device_release(struct device *dev)
        kfree(tier);
 }
 
-static ssize_t nodes_show(struct device *dev,
-                         struct device_attribute *attr, char *buf)
+static ssize_t nodelist_show(struct device *dev,
+                            struct device_attribute *attr, char *buf)
 {
        int ret;
        nodemask_t nmask;
@@ -143,10 +143,10 @@ static ssize_t nodes_show(struct device *dev,
        mutex_unlock(&memory_tier_lock);
        return ret;
 }
-static DEVICE_ATTR_RO(nodes);
+static DEVICE_ATTR_RO(nodelist);
 
 static struct attribute *memtier_dev_attrs[] = {
-       &dev_attr_nodes.attr,
+       &dev_attr_nodelist.attr,
        NULL
 };
 
--

2.35.1

maintainer
#4 lore raw
In reply to Huang Ying
Quoted 12 lines · On Thu, 20 Oct 2022 09:51:22 +0800 Huang Ying <[email protected]> wrote:

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
Quoted 2 lines

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

I'll add

Fixes 9832fb87834e2b ("mm/demotion: expose memory tier details via sysfs")

to this to reduce the risk that someone will backport 9832fb87834e2b but will miss this alteration.

Reviewed-by on v1 1/1
#5 lore raw
In reply to Huang Ying
Quoted 15 lines · Huang Ying

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.

Quoted 15 lines
Cc Aneesh Kumar K.V <[email protected]>
Cc Alistair Popple <[email protected]>
Cc Bharata B Rao <[email protected]>
Cc Dan Williams <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Davidlohr Bueso <[email protected]>
Cc Hesham Almatary <[email protected]>
Cc Jagdish Gediya <[email protected]>
Cc Johannes Weiner <[email protected]>
Cc Jonathan Cameron <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Tim Chen <[email protected]>
Cc Wei Xu <[email protected]>
Cc Yang Shi <[email protected]>