aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/node.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/base/node.c b/drivers/base/node.c
index ee53558b452f..ce012a9c6201 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -160,6 +160,18 @@ static ssize_t node_read_numastat(struct sys_device * dev,
160} 160}
161static SYSDEV_ATTR(numastat, S_IRUGO, node_read_numastat, NULL); 161static SYSDEV_ATTR(numastat, S_IRUGO, node_read_numastat, NULL);
162 162
163static ssize_t node_read_vmstat(struct sys_device *dev,
164 struct sysdev_attribute *attr, char *buf)
165{
166 int nid = dev->id;
167 return sprintf(buf,
168 "nr_written %lu\n"
169 "nr_dirtied %lu\n",
170 node_page_state(nid, NR_WRITTEN),
171 node_page_state(nid, NR_DIRTIED));
172}
173static SYSDEV_ATTR(vmstat, S_IRUGO, node_read_vmstat, NULL);
174
163static ssize_t node_read_distance(struct sys_device * dev, 175static ssize_t node_read_distance(struct sys_device * dev,
164 struct sysdev_attribute *attr, char * buf) 176 struct sysdev_attribute *attr, char * buf)
165{ 177{
@@ -243,6 +255,7 @@ int register_node(struct node *node, int num, struct node *parent)
243 sysdev_create_file(&node->sysdev, &attr_meminfo); 255 sysdev_create_file(&node->sysdev, &attr_meminfo);
244 sysdev_create_file(&node->sysdev, &attr_numastat); 256 sysdev_create_file(&node->sysdev, &attr_numastat);
245 sysdev_create_file(&node->sysdev, &attr_distance); 257 sysdev_create_file(&node->sysdev, &attr_distance);
258 sysdev_create_file(&node->sysdev, &attr_vmstat);
246 259
247 scan_unevictable_register_node(node); 260 scan_unevictable_register_node(node);
248 261
@@ -267,6 +280,7 @@ void unregister_node(struct node *node)
267 sysdev_remove_file(&node->sysdev, &attr_meminfo); 280 sysdev_remove_file(&node->sysdev, &attr_meminfo);
268 sysdev_remove_file(&node->sysdev, &attr_numastat); 281 sysdev_remove_file(&node->sysdev, &attr_numastat);
269 sysdev_remove_file(&node->sysdev, &attr_distance); 282 sysdev_remove_file(&node->sysdev, &attr_distance);
283 sysdev_remove_file(&node->sysdev, &attr_vmstat);
270 284
271 scan_unevictable_unregister_node(node); 285 scan_unevictable_unregister_node(node);
272 hugetlb_unregister_node(node); /* no-op, if memoryless node */ 286 hugetlb_unregister_node(node); /* no-op, if memoryless node */