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 /include/linux | |
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 'include/linux')
-rw-r--r-- | include/linux/mmzone.h | 17 | ||||
-rw-r--r-- | include/linux/vmstat.h | 10 |
2 files changed, 17 insertions, 10 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 2dbeec1d2874..27e748eb72b0 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -57,6 +57,14 @@ enum zone_stat_item { | |||
57 | NR_WRITEBACK, | 57 | NR_WRITEBACK, |
58 | NR_UNSTABLE_NFS, /* NFS unstable pages */ | 58 | NR_UNSTABLE_NFS, /* NFS unstable pages */ |
59 | NR_BOUNCE, | 59 | NR_BOUNCE, |
60 | #ifdef CONFIG_NUMA | ||
61 | NUMA_HIT, /* allocated in intended node */ | ||
62 | NUMA_MISS, /* allocated in non intended node */ | ||
63 | NUMA_FOREIGN, /* was intended here, hit elsewhere */ | ||
64 | NUMA_INTERLEAVE_HIT, /* interleaver preferred this zone */ | ||
65 | NUMA_LOCAL, /* allocation from local node */ | ||
66 | NUMA_OTHER, /* allocation from other node */ | ||
67 | #endif | ||
60 | NR_VM_ZONE_STAT_ITEMS }; | 68 | NR_VM_ZONE_STAT_ITEMS }; |
61 | 69 | ||
62 | struct per_cpu_pages { | 70 | struct per_cpu_pages { |
@@ -71,15 +79,6 @@ struct per_cpu_pageset { | |||
71 | #ifdef CONFIG_SMP | 79 | #ifdef CONFIG_SMP |
72 | s8 vm_stat_diff[NR_VM_ZONE_STAT_ITEMS]; | 80 | s8 vm_stat_diff[NR_VM_ZONE_STAT_ITEMS]; |
73 | #endif | 81 | #endif |
74 | |||
75 | #ifdef CONFIG_NUMA | ||
76 | unsigned long numa_hit; /* allocated in intended node */ | ||
77 | unsigned long numa_miss; /* allocated in non intended node */ | ||
78 | unsigned long numa_foreign; /* was intended here, hit elsewhere */ | ||
79 | unsigned long interleave_hit; /* interleaver prefered this zone */ | ||
80 | unsigned long local_node; /* allocation from local node */ | ||
81 | unsigned long other_node; /* allocation from other node */ | ||
82 | #endif | ||
83 | } ____cacheline_aligned_in_smp; | 82 | } ____cacheline_aligned_in_smp; |
84 | 83 | ||
85 | #ifdef CONFIG_NUMA | 84 | #ifdef CONFIG_NUMA |
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 5fad1613e7d6..16173b63ee67 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
@@ -173,9 +173,15 @@ static inline unsigned long node_page_state(int node, | |||
173 | #endif | 173 | #endif |
174 | zone_page_state(&zones[ZONE_DMA], item); | 174 | zone_page_state(&zones[ZONE_DMA], item); |
175 | } | 175 | } |
176 | |||
177 | extern void zone_statistics(struct zonelist *, struct zone *); | ||
178 | |||
176 | #else | 179 | #else |
180 | |||
177 | #define node_page_state(node, item) global_page_state(item) | 181 | #define node_page_state(node, item) global_page_state(item) |
178 | #endif | 182 | #define zone_statistics(_zl,_z) do { } while (0) |
183 | |||
184 | #endif /* CONFIG_NUMA */ | ||
179 | 185 | ||
180 | #define __add_zone_page_state(__z, __i, __d) \ | 186 | #define __add_zone_page_state(__z, __i, __d) \ |
181 | __mod_zone_page_state(__z, __i, __d) | 187 | __mod_zone_page_state(__z, __i, __d) |
@@ -190,6 +196,8 @@ static inline void zap_zone_vm_stats(struct zone *zone) | |||
190 | memset(zone->vm_stat, 0, sizeof(zone->vm_stat)); | 196 | memset(zone->vm_stat, 0, sizeof(zone->vm_stat)); |
191 | } | 197 | } |
192 | 198 | ||
199 | extern void inc_zone_state(struct zone *, enum zone_stat_item); | ||
200 | |||
193 | #ifdef CONFIG_SMP | 201 | #ifdef CONFIG_SMP |
194 | void __mod_zone_page_state(struct zone *, enum zone_stat_item item, int); | 202 | void __mod_zone_page_state(struct zone *, enum zone_stat_item item, int); |
195 | void __inc_zone_page_state(struct page *, enum zone_stat_item); | 203 | void __inc_zone_page_state(struct page *, enum zone_stat_item); |