Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217452
b: refs/heads/master
c: 2ac3903
h: refs/heads/master
v: v3
  • Loading branch information
Michael Rubin authored and Linus Torvalds committed Oct 26, 2010
1 parent 90f7f67 commit ebe5a54
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ea941f0e2a8c02ae876cd73deb4e1557248f258c
refs/heads/master: 2ac390370aac4aaa49cab17f328b478cbd5b3d8d
14 changes: 14 additions & 0 deletions trunk/drivers/base/node.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,18 @@ static ssize_t node_read_numastat(struct sys_device * dev,
}
static SYSDEV_ATTR(numastat, S_IRUGO, node_read_numastat, NULL);

static ssize_t node_read_vmstat(struct sys_device *dev,
struct sysdev_attribute *attr, char *buf)
{
int nid = dev->id;
return sprintf(buf,
"nr_written %lu\n"
"nr_dirtied %lu\n",
node_page_state(nid, NR_WRITTEN),
node_page_state(nid, NR_DIRTIED));
}
static SYSDEV_ATTR(vmstat, S_IRUGO, node_read_vmstat, NULL);

static ssize_t node_read_distance(struct sys_device * dev,
struct sysdev_attribute *attr, char * buf)
{
Expand Down Expand Up @@ -243,6 +255,7 @@ 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);
sysdev_create_file(&node->sysdev, &attr_vmstat);

scan_unevictable_register_node(node);

Expand All @@ -267,6 +280,7 @@ 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);
sysdev_remove_file(&node->sysdev, &attr_vmstat);

scan_unevictable_unregister_node(node);
hugetlb_unregister_node(node); /* no-op, if memoryless node */
Expand Down

0 comments on commit ebe5a54

Please sign in to comment.