[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0701302226380.23658@chino.kir.corp.google.com>
Date: Wed, 31 Jan 2007 07:18:33 -0800 (PST)
From: David Rientjes <rientjes@...gle.com>
To: Andrew Morton <akpm@...l.org>
cc: Andi Kleen <ak@...e.de>, Rohit Seth <rohitseth@...gle.com>,
linux-kernel@...r.kernel.org
Subject: [patch -mm 7/7] x86_64: export physnode mapping to userspace
Exports the physical NUMA node to fake NUMA node mapping to user-space via
sysfs. The information is now accessible via the 'physnode' file.
Cc: Andi Kleen <ak@...e.de>
Signed-off-by: Rohit Seth <rohitseth@...gle.com>
Signed-off-by: David Rientjes <rientjes@...gle.com>
---
drivers/base/node.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/drivers/base/node.c b/drivers/base/node.c
index 001e6f6..548d365 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -136,6 +136,13 @@ static ssize_t node_read_distance(struct sys_device * dev, char * buf)
}
static SYSDEV_ATTR(distance, S_IRUGO, node_read_distance, NULL);
+#ifdef CONFIG_NUMA_EMU
+static ssize_t node_read_physnode(struct sys_device *dev, char *buf)
+{
+ return sprintf(buf, "%d\n", get_phys_node(dev->id));
+}
+static SYSDEV_ATTR(physnode, S_IRUGO, node_read_physnode, NULL);
+#endif
/*
* register_node - Setup a driverfs device for a node.
@@ -156,6 +163,9 @@ int register_node(struct node *node, int num, struct node *parent)
sysdev_create_file(&node->sysdev, &attr_meminfo);
sysdev_create_file(&node->sysdev, &attr_numastat);
sysdev_create_file(&node->sysdev, &attr_distance);
+#ifdef CONFIG_NUMA_EMU
+ sysdev_create_file(&node->sysdev, &attr_physnode);
+#endif
}
return error;
}
@@ -173,6 +183,9 @@ void unregister_node(struct node *node)
sysdev_remove_file(&node->sysdev, &attr_meminfo);
sysdev_remove_file(&node->sysdev, &attr_numastat);
sysdev_remove_file(&node->sysdev, &attr_distance);
+#ifdef CONFIG_NUMA_EMU
+ sysdev_remove_file(&node->sysdev, &attr_physnode);
+#endif
sysdev_unregister(&node->sysdev);
}
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists