aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/node.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/base/node.c')
-rw-r--r--drivers/base/node.c34
1 files changed, 6 insertions, 28 deletions
diff --git a/drivers/base/node.c b/drivers/base/node.c
index 772eadac57a7..d7de1753e094 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -94,28 +94,6 @@ static SYSDEV_ATTR(meminfo, S_IRUGO, node_read_meminfo, NULL);
94 94
95static ssize_t node_read_numastat(struct sys_device * dev, char * buf) 95static ssize_t node_read_numastat(struct sys_device * dev, char * buf)
96{ 96{
97 unsigned long numa_hit, numa_miss, interleave_hit, numa_foreign;
98 unsigned long local_node, other_node;
99 int i, cpu;
100 pg_data_t *pg = NODE_DATA(dev->id);
101 numa_hit = 0;
102 numa_miss = 0;
103 interleave_hit = 0;
104 numa_foreign = 0;
105 local_node = 0;
106 other_node = 0;
107 for (i = 0; i < MAX_NR_ZONES; i++) {
108 struct zone *z = &pg->node_zones[i];
109 for_each_online_cpu(cpu) {
110 struct per_cpu_pageset *ps = zone_pcp(z,cpu);
111 numa_hit += ps->numa_hit;
112 numa_miss += ps->numa_miss;
113 numa_foreign += ps->numa_foreign;
114 interleave_hit += ps->interleave_hit;
115 local_node += ps->local_node;
116 other_node += ps->other_node;
117 }
118 }
119 return sprintf(buf, 97 return sprintf(buf,
120 "numa_hit %lu\n" 98 "numa_hit %lu\n"
121 "numa_miss %lu\n" 99 "numa_miss %lu\n"
@@ -123,12 +101,12 @@ static ssize_t node_read_numastat(struct sys_device * dev, char * buf)
123 "interleave_hit %lu\n" 101 "interleave_hit %lu\n"
124 "local_node %lu\n" 102 "local_node %lu\n"
125 "other_node %lu\n", 103 "other_node %lu\n",
126 numa_hit, 104 node_page_state(dev->id, NUMA_HIT),
127 numa_miss, 105 node_page_state(dev->id, NUMA_MISS),
128 numa_foreign, 106 node_page_state(dev->id, NUMA_FOREIGN),
129 interleave_hit, 107 node_page_state(dev->id, NUMA_INTERLEAVE_HIT),
130 local_node, 108 node_page_state(dev->id, NUMA_LOCAL),
131 other_node); 109 node_page_state(dev->id, NUMA_OTHER));
132} 110}
133static SYSDEV_ATTR(numastat, S_IRUGO, node_read_numastat, NULL); 111static SYSDEV_ATTR(numastat, S_IRUGO, node_read_numastat, NULL);
134 112