diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-26 20:15:20 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-26 20:15:20 -0400 |
| commit | 31453a9764f7e2a72a6e2c502ace586e2663a68c (patch) | |
| tree | 5d4db63de5b4b85d1ffdab4e95a75175a784a10a /drivers/base/node.c | |
| parent | f9ba5375a8aae4aeea6be15df77e24707a429812 (diff) | |
| parent | 93ed0e2d07b25aff4db1d61bfbcd1e82074c0ad5 (diff) | |
Merge branch 'akpm-incoming-1'
* akpm-incoming-1: (176 commits)
scripts/checkpatch.pl: add check for declaration of pci_device_id
scripts/checkpatch.pl: add warnings for static char that could be static const char
checkpatch: version 0.31
checkpatch: statement/block context analyser should look at sanitised lines
checkpatch: handle EXPORT_SYMBOL for DEVICE_ATTR and similar
checkpatch: clean up structure definition macro handline
checkpatch: update copyright dates
checkpatch: Add additional attribute #defines
checkpatch: check for incorrect permissions
checkpatch: ensure kconfig help checks only apply when we are adding help
checkpatch: simplify and consolidate "missing space after" checks
checkpatch: add check for space after struct, union, and enum
checkpatch: returning errno typically should be negative
checkpatch: handle casts better fixing false categorisation of : as binary
checkpatch: ensure we do not collapse bracketed sections into constants
checkpatch: suggest cleanpatch and cleanfile when appropriate
checkpatch: types may sit on a line on their own
checkpatch: fix regressions in "fix handling of leading spaces"
div64_u64(): improve precision on 32bit platforms
lib/parser: cleanup match_number()
...
Diffstat (limited to 'drivers/base/node.c')
| -rw-r--r-- | drivers/base/node.c | 14 |
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 | } |
| 161 | static SYSDEV_ATTR(numastat, S_IRUGO, node_read_numastat, NULL); | 161 | static SYSDEV_ATTR(numastat, S_IRUGO, node_read_numastat, NULL); |
| 162 | 162 | ||
| 163 | static 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 | } | ||
| 173 | static SYSDEV_ATTR(vmstat, S_IRUGO, node_read_vmstat, NULL); | ||
| 174 | |||
| 163 | static ssize_t node_read_distance(struct sys_device * dev, | 175 | static 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 */ |
