diff options
author | Christoph Lameter <clameter@sgi.com> | 2006-06-30 04:55:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-30 14:25:36 -0400 |
commit | ca889e6c45e0b112cb2ca9d35afc66297519b5d5 (patch) | |
tree | 0a5efdec2a61540204d34bcbf56dc691d8f9c391 /drivers/base/node.c | |
parent | bab1846a0582f627f5ec22aa2dc5f4f3e82e8176 (diff) |
[PATCH] Use Zoned VM Counters for NUMA statistics
The numa statistics are really event counters. But they are per node and
so we have had special treatment for these counters through additional
fields on the pcp structure. We can now use the per zone nature of the
zoned VM counters to realize these.
This will shrink the size of the pcp structure on NUMA systems. We will
have some room to add additional per zone counters that will all still fit
in the same cacheline.
Bits Prior pcp size Size after patch We can add
------------------------------------------------------------------
64 128 bytes (16 words) 80 bytes (10 words) 48
32 76 bytes (19 words) 56 bytes (14 words) 8 (64 byte cacheline)
72 (128 byte)
Remove the special statistics for numa and replace them with zoned vm
counters. This has the side effect that global sums of these events now
show up in /proc/vmstat.
Also take the opportunity to move the zone_statistics() function from
page_alloc.c into vmstat.c.
Discussions:
V2 http://marc.theaimsgroup.com/?t=115048227000002&r=1&w=2
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Acked-by: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/base/node.c')
-rw-r--r-- | drivers/base/node.c | 34 |
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 | ||
95 | static ssize_t node_read_numastat(struct sys_device * dev, char * buf) | 95 | static 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 | } |
133 | static SYSDEV_ATTR(numastat, S_IRUGO, node_read_numastat, NULL); | 111 | static SYSDEV_ATTR(numastat, S_IRUGO, node_read_numastat, NULL); |
134 | 112 | ||