linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC] memory tier, sysfs: rename attribute "nodes" to "nodes_list"
@ 2022-10-18  5:25 Huang Ying
  2022-10-18  6:27 ` Wei Xu
  0 siblings, 1 reply; 3+ messages in thread
From: Huang Ying @ 2022-10-18  5:25 UTC (permalink / raw)
  To: linux-mm
  Cc: linux-kernel, Andrew Morton, Huang Ying, Aneesh Kumar K . V,
	Alistair Popple, Bharata B Rao, Dan Williams, Dave Hansen,
	Davidlohr Bueso, Hesham Almatary, Jagdish Gediya,
	Johannes Weiner, Jonathan Cameron, Michal Hocko, Tim Chen,
	Wei Xu, Yang Shi

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

 $ cat /sys/devices/system/cpu/cpu2/topology/core_cpus
 0,00100004
 $ cat /sys/devices/system/cpu/cpu2/topology/core_cpus_list
 2,20

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

Signed-off-by: "Huang, Ying" <ying.huang@intel.com>
Cc: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
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: Davidlohr Bueso <dave@stgolabs.net>
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>
Cc: Wei Xu <weixugc@google.com>
Cc: Yang Shi <shy828301@gmail.com>
---
 Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers | 4 ++--
 mm/memory-tiers.c                                      | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers b/Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers
index 45985e411f13..af07e166f559 100644
--- a/Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers
+++ b/Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers
@@ -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/nodes_list
 Date:		August 2022
 Contact:	Linux memory management mailing list <linux-mm@kvack.org>
 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.
+		nodes_list: NUMA nodes that are part of this memory tier.
 
diff --git a/mm/memory-tiers.c b/mm/memory-tiers.c
index f116b7b6333e..8dbfe9ec87d5 100644
--- a/mm/memory-tiers.c
+++ b/mm/memory-tiers.c
@@ -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 nodes_list_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(nodes_list);
 
 static struct attribute *memtier_dev_attrs[] = {
-	&dev_attr_nodes.attr,
+	&dev_attr_nodes_list.attr,
 	NULL
 };
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RFC] memory tier, sysfs: rename attribute "nodes" to "nodes_list"
  2022-10-18  5:25 [RFC] memory tier, sysfs: rename attribute "nodes" to "nodes_list" Huang Ying
@ 2022-10-18  6:27 ` Wei Xu
  2022-10-18  8:39   ` Huang, Ying
  0 siblings, 1 reply; 3+ messages in thread
From: Wei Xu @ 2022-10-18  6:27 UTC (permalink / raw)
  To: Huang Ying
  Cc: linux-mm, linux-kernel, Andrew Morton, Aneesh Kumar K . V,
	Alistair Popple, Bharata B Rao, Dan Williams, Dave Hansen,
	Davidlohr Bueso, Hesham Almatary, Jagdish Gediya,
	Johannes Weiner, Jonathan Cameron, Michal Hocko, Tim Chen,
	Yang Shi

How about "nodelist", instead of "nodes_list"?  It is more concise and
follows the convention of:

/sys/devices/system/nodes/node0/cpulist

Wei

On Mon, Oct 17, 2022 at 10:26 PM Huang Ying <ying.huang@intel.com> wrote:
>
> In sysfs, we use attribute name "cpus" for cpu mask and "cpus_list"
> for cpu list.  For example, in my system,
>
>  $ cat /sys/devices/system/cpu/cpu2/topology/core_cpus
>  0,00100004
>  $ cat /sys/devices/system/cpu/cpu2/topology/core_cpus_list
>  2,20
>
> It looks reasonable to use "nodes" for node mask and "nodes_list" for
> node list.  So, rename the attribute to follow the naming convention.
>
> Signed-off-by: "Huang, Ying" <ying.huang@intel.com>
> Cc: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
> 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: Davidlohr Bueso <dave@stgolabs.net>
> 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>
> Cc: Wei Xu <weixugc@google.com>
> Cc: Yang Shi <shy828301@gmail.com>
> ---
>  Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers | 4 ++--
>  mm/memory-tiers.c                                      | 8 ++++----
>  2 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers b/Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers
> index 45985e411f13..af07e166f559 100644
> --- a/Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers
> +++ b/Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers
> @@ -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/nodes_list
>  Date:          August 2022
>  Contact:       Linux memory management mailing list <linux-mm@kvack.org>
>  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.
> +               nodes_list: NUMA nodes that are part of this memory tier.
>
> diff --git a/mm/memory-tiers.c b/mm/memory-tiers.c
> index f116b7b6333e..8dbfe9ec87d5 100644
> --- a/mm/memory-tiers.c
> +++ b/mm/memory-tiers.c
> @@ -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 nodes_list_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(nodes_list);
>
>  static struct attribute *memtier_dev_attrs[] = {
> -       &dev_attr_nodes.attr,
> +       &dev_attr_nodes_list.attr,
>         NULL
>  };
>
> --
> 2.35.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC] memory tier, sysfs: rename attribute "nodes" to "nodes_list"
  2022-10-18  6:27 ` Wei Xu
@ 2022-10-18  8:39   ` Huang, Ying
  0 siblings, 0 replies; 3+ messages in thread
From: Huang, Ying @ 2022-10-18  8:39 UTC (permalink / raw)
  To: Wei Xu
  Cc: linux-mm, linux-kernel, Andrew Morton, Aneesh Kumar K . V,
	Alistair Popple, Bharata B Rao, Dan Williams, Dave Hansen,
	Davidlohr Bueso, Hesham Almatary, Jagdish Gediya,
	Johannes Weiner, Jonathan Cameron, Michal Hocko, Tim Chen,
	Yang Shi

Wei Xu <weixugc@google.com> writes:

> How about "nodelist", instead of "nodes_list"?  It is more concise and
> follows the convention of:
>
> /sys/devices/system/nodes/node0/cpulist

Sounds good to me.

It seems that cpumap/cpulist is another pair of mask/list.

/sys/devices/system/node/node0/cpumap
/sys/devices/system/node/node0/cpulist

/sys/devices/system/cpu/cpu0/cache/index1/shared_cpu_map
/sys/devices/system/cpu/cpu0/cache/index1/shared_cpu_list

Best Regards,
Huang, Ying

> On Mon, Oct 17, 2022 at 10:26 PM Huang Ying <ying.huang@intel.com> wrote:
>>
>> In sysfs, we use attribute name "cpus" for cpu mask and "cpus_list"
>> for cpu list.  For example, in my system,
>>
>>  $ cat /sys/devices/system/cpu/cpu2/topology/core_cpus
>>  0,00100004
>>  $ cat /sys/devices/system/cpu/cpu2/topology/core_cpus_list
>>  2,20
>>
>> It looks reasonable to use "nodes" for node mask and "nodes_list" for
>> node list.  So, rename the attribute to follow the naming convention.
>>
>> Signed-off-by: "Huang, Ying" <ying.huang@intel.com>
>> Cc: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
>> 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: Davidlohr Bueso <dave@stgolabs.net>
>> 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>
>> Cc: Wei Xu <weixugc@google.com>
>> Cc: Yang Shi <shy828301@gmail.com>
>> ---
>>  Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers | 4 ++--
>>  mm/memory-tiers.c                                      | 8 ++++----
>>  2 files changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers b/Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers
>> index 45985e411f13..af07e166f559 100644
>> --- a/Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers
>> +++ b/Documentation/ABI/testing/sysfs-kernel-mm-memory-tiers
>> @@ -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/nodes_list
>>  Date:          August 2022
>>  Contact:       Linux memory management mailing list <linux-mm@kvack.org>
>>  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.
>> +               nodes_list: NUMA nodes that are part of this memory tier.
>>
>> diff --git a/mm/memory-tiers.c b/mm/memory-tiers.c
>> index f116b7b6333e..8dbfe9ec87d5 100644
>> --- a/mm/memory-tiers.c
>> +++ b/mm/memory-tiers.c
>> @@ -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 nodes_list_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(nodes_list);
>>
>>  static struct attribute *memtier_dev_attrs[] = {
>> -       &dev_attr_nodes.attr,
>> +       &dev_attr_nodes_list.attr,
>>         NULL
>>  };
>>
>> --
>> 2.35.1
>>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-10-18  8:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-18  5:25 [RFC] memory tier, sysfs: rename attribute "nodes" to "nodes_list" Huang Ying
2022-10-18  6:27 ` Wei Xu
2022-10-18  8:39   ` Huang, Ying

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).