- show-memory-section-to-node-relationship-in-sysfs.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     mm: show memory section to node relationship in sysfs
has been removed from the -mm tree.  Its filename was
     show-memory-section-to-node-relationship-in-sysfs.patch

This patch was dropped because an updated version will be merged

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: mm: show memory section to node relationship in sysfs
From: Gary Hade <garyhade@xxxxxxxxxx>

Show memory section to node relationship in sysfs

Add /sys/devices/system/memory/memoryX/node files to show
the node on which each memory section resides.

Signed-off-by: Gary Hade <garyhade@xxxxxxxxxx>
Cc: Yasunori Goto <y-goto@xxxxxxxxxxxxxx>
Cc: Badari Pulavarty <pbadari@xxxxxxxxxx>
Cc: Mel Gorman <mel@xxxxxxxxx>
Cc: Chris McDermott <lcm@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 Documentation/memory-hotplug.txt |    1 -
 drivers/base/memory.c            |   20 ++++++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff -puN Documentation/memory-hotplug.txt~show-memory-section-to-node-relationship-in-sysfs Documentation/memory-hotplug.txt
--- a/Documentation/memory-hotplug.txt~show-memory-section-to-node-relationship-in-sysfs
+++ a/Documentation/memory-hotplug.txt
@@ -365,7 +365,6 @@ node if necessary.
   - allowing memory hot-add to ZONE_MOVABLE. maybe we need some switch like
     sysctl or new control file.
   - showing memory section and physical device relationship.
-  - showing memory section and node relationship (maybe good for NUMA)
   - showing memory section is under ZONE_MOVABLE or not
   - test and make it better memory offlining.
   - support HugeTLB page migration and offlining.
diff -puN drivers/base/memory.c~show-memory-section-to-node-relationship-in-sysfs drivers/base/memory.c
--- a/drivers/base/memory.c~show-memory-section-to-node-relationship-in-sysfs
+++ a/drivers/base/memory.c
@@ -150,6 +150,22 @@ static ssize_t show_mem_state(struct sys
 	return len;
 }
 
+/*
+ * node on which memory section resides
+ */
+static ssize_t show_mem_node(struct sys_device *dev,
+			struct sysdev_attribute *attr, char *buf)
+{
+	unsigned long start_pfn;
+	int ret;
+	struct memory_block *mem =
+		container_of(dev, struct memory_block, sysdev);
+
+	start_pfn = section_nr_to_pfn(mem->phys_index);
+	ret = pfn_to_nid(start_pfn);
+	return sprintf(buf, "%d\n", ret);
+}
+
 int memory_notify(unsigned long val, void *v)
 {
 	return blocking_notifier_call_chain(&memory_chain, val, v);
@@ -278,6 +294,7 @@ static SYSDEV_ATTR(phys_index, 0444, sho
 static SYSDEV_ATTR(state, 0644, show_mem_state, store_mem_state);
 static SYSDEV_ATTR(phys_device, 0444, show_phys_device, NULL);
 static SYSDEV_ATTR(removable, 0444, show_mem_removable, NULL);
+static SYSDEV_ATTR(node, 0444, show_mem_node, NULL);
 
 #define mem_create_simple_file(mem, attr_name)	\
 	sysdev_create_file(&mem->sysdev, &attr_##attr_name)
@@ -368,6 +385,8 @@ static int add_memory_block(unsigned lon
 		ret = mem_create_simple_file(mem, phys_device);
 	if (!ret)
 		ret = mem_create_simple_file(mem, removable);
+	if (!ret)
+		ret = mem_create_simple_file(mem, node);
 
 	return ret;
 }
@@ -413,6 +432,7 @@ int remove_memory_block(unsigned long no
 	mem_remove_simple_file(mem, state);
 	mem_remove_simple_file(mem, phys_device);
 	mem_remove_simple_file(mem, removable);
+	mem_remove_simple_file(mem, node);
 	unregister_memory(mem, section);
 
 	return 0;
_

Patches currently in -mm which might be from garyhade@xxxxxxxxxx are

x86_64-add-memory-hotremove-config-option.patch
show-memory-section-to-node-relationship-in-sysfs.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux