diff options
author | Nick Piggin <nickpiggin@yahoo.com.au> | 2006-01-06 03:11:10 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 11:33:26 -0500 |
commit | 9328b8faae922e52073785ed6c1eaa8565648a0e (patch) | |
tree | 065034bc534a4997197d26acf1774725159e4e65 | |
parent | 7756b9e4e321c3c83c7aa5b9532d3e7fd7ddeb4a (diff) |
[PATCH] mm: dma32 zone statistics
Add dma32 to zone statistics. Also attempt to arrange struct page_state a
bit better (visually).
Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | include/linux/mmzone.h | 11 | ||||
-rw-r--r-- | include/linux/page-flags.h | 38 | ||||
-rw-r--r-- | mm/page_alloc.c | 14 |
3 files changed, 46 insertions, 17 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 0d1a5981bb94..8d6caa414c4c 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -397,6 +397,7 @@ static inline int is_normal_idx(int idx) | |||
397 | { | 397 | { |
398 | return (idx == ZONE_NORMAL); | 398 | return (idx == ZONE_NORMAL); |
399 | } | 399 | } |
400 | |||
400 | /** | 401 | /** |
401 | * is_highmem - helper function to quickly check if a struct zone is a | 402 | * is_highmem - helper function to quickly check if a struct zone is a |
402 | * highmem zone or not. This is an attempt to keep references | 403 | * highmem zone or not. This is an attempt to keep references |
@@ -413,6 +414,16 @@ static inline int is_normal(struct zone *zone) | |||
413 | return zone == zone->zone_pgdat->node_zones + ZONE_NORMAL; | 414 | return zone == zone->zone_pgdat->node_zones + ZONE_NORMAL; |
414 | } | 415 | } |
415 | 416 | ||
417 | static inline int is_dma32(struct zone *zone) | ||
418 | { | ||
419 | return zone == zone->zone_pgdat->node_zones + ZONE_DMA32; | ||
420 | } | ||
421 | |||
422 | static inline int is_dma(struct zone *zone) | ||
423 | { | ||
424 | return zone == zone->zone_pgdat->node_zones + ZONE_DMA; | ||
425 | } | ||
426 | |||
416 | /* These two functions are used to setup the per zone pages min values */ | 427 | /* These two functions are used to setup the per zone pages min values */ |
417 | struct ctl_table; | 428 | struct ctl_table; |
418 | struct file; | 429 | struct file; |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 343083fec258..32d09c8d952b 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -97,32 +97,40 @@ struct page_state { | |||
97 | unsigned long pgpgout; /* Disk writes */ | 97 | unsigned long pgpgout; /* Disk writes */ |
98 | unsigned long pswpin; /* swap reads */ | 98 | unsigned long pswpin; /* swap reads */ |
99 | unsigned long pswpout; /* swap writes */ | 99 | unsigned long pswpout; /* swap writes */ |
100 | unsigned long pgalloc_high; /* page allocations */ | ||
101 | 100 | ||
101 | unsigned long pgalloc_high; /* page allocations */ | ||
102 | unsigned long pgalloc_normal; | 102 | unsigned long pgalloc_normal; |
103 | unsigned long pgalloc_dma32; | ||
103 | unsigned long pgalloc_dma; | 104 | unsigned long pgalloc_dma; |
105 | |||
104 | unsigned long pgfree; /* page freeings */ | 106 | unsigned long pgfree; /* page freeings */ |
105 | unsigned long pgactivate; /* pages moved inactive->active */ | 107 | unsigned long pgactivate; /* pages moved inactive->active */ |
106 | unsigned long pgdeactivate; /* pages moved active->inactive */ | 108 | unsigned long pgdeactivate; /* pages moved active->inactive */ |
107 | 109 | ||
108 | unsigned long pgfault; /* faults (major+minor) */ | 110 | unsigned long pgfault; /* faults (major+minor) */ |
109 | unsigned long pgmajfault; /* faults (major only) */ | 111 | unsigned long pgmajfault; /* faults (major only) */ |
112 | |||
110 | unsigned long pgrefill_high; /* inspected in refill_inactive_zone */ | 113 | unsigned long pgrefill_high; /* inspected in refill_inactive_zone */ |
111 | unsigned long pgrefill_normal; | 114 | unsigned long pgrefill_normal; |
115 | unsigned long pgrefill_dma32; | ||
112 | unsigned long pgrefill_dma; | 116 | unsigned long pgrefill_dma; |
113 | 117 | ||
114 | unsigned long pgsteal_high; /* total highmem pages reclaimed */ | 118 | unsigned long pgsteal_high; /* total highmem pages reclaimed */ |
115 | unsigned long pgsteal_normal; | 119 | unsigned long pgsteal_normal; |
120 | unsigned long pgsteal_dma32; | ||
116 | unsigned long pgsteal_dma; | 121 | unsigned long pgsteal_dma; |
122 | |||
117 | unsigned long pgscan_kswapd_high;/* total highmem pages scanned */ | 123 | unsigned long pgscan_kswapd_high;/* total highmem pages scanned */ |
118 | unsigned long pgscan_kswapd_normal; | 124 | unsigned long pgscan_kswapd_normal; |
119 | 125 | unsigned long pgscan_kswapd_dma32; | |
120 | unsigned long pgscan_kswapd_dma; | 126 | unsigned long pgscan_kswapd_dma; |
127 | |||
121 | unsigned long pgscan_direct_high;/* total highmem pages scanned */ | 128 | unsigned long pgscan_direct_high;/* total highmem pages scanned */ |
122 | unsigned long pgscan_direct_normal; | 129 | unsigned long pgscan_direct_normal; |
130 | unsigned long pgscan_direct_dma32; | ||
123 | unsigned long pgscan_direct_dma; | 131 | unsigned long pgscan_direct_dma; |
124 | unsigned long pginodesteal; /* pages reclaimed via inode freeing */ | ||
125 | 132 | ||
133 | unsigned long pginodesteal; /* pages reclaimed via inode freeing */ | ||
126 | unsigned long slabs_scanned; /* slab objects scanned */ | 134 | unsigned long slabs_scanned; /* slab objects scanned */ |
127 | unsigned long kswapd_steal; /* pages reclaimed by kswapd */ | 135 | unsigned long kswapd_steal; /* pages reclaimed by kswapd */ |
128 | unsigned long kswapd_inodesteal;/* reclaimed via kswapd inode freeing */ | 136 | unsigned long kswapd_inodesteal;/* reclaimed via kswapd inode freeing */ |
@@ -150,17 +158,19 @@ extern void __mod_page_state(unsigned long offset, unsigned long delta); | |||
150 | #define add_page_state(member,delta) mod_page_state(member, (delta)) | 158 | #define add_page_state(member,delta) mod_page_state(member, (delta)) |
151 | #define sub_page_state(member,delta) mod_page_state(member, 0UL - (delta)) | 159 | #define sub_page_state(member,delta) mod_page_state(member, 0UL - (delta)) |
152 | 160 | ||
153 | #define mod_page_state_zone(zone, member, delta) \ | 161 | #define mod_page_state_zone(zone, member, delta) \ |
154 | do { \ | 162 | do { \ |
155 | unsigned offset; \ | 163 | unsigned offset; \ |
156 | if (is_highmem(zone)) \ | 164 | if (is_highmem(zone)) \ |
157 | offset = offsetof(struct page_state, member##_high); \ | 165 | offset = offsetof(struct page_state, member##_high); \ |
158 | else if (is_normal(zone)) \ | 166 | else if (is_normal(zone)) \ |
159 | offset = offsetof(struct page_state, member##_normal); \ | 167 | offset = offsetof(struct page_state, member##_normal); \ |
160 | else \ | 168 | else if (is_dma32(zone)) \ |
161 | offset = offsetof(struct page_state, member##_dma); \ | 169 | offset = offsetof(struct page_state, member##_dma32); \ |
162 | __mod_page_state(offset, (delta)); \ | 170 | else \ |
163 | } while (0) | 171 | offset = offsetof(struct page_state, member##_dma); \ |
172 | __mod_page_state(offset, (delta)); \ | ||
173 | } while (0) | ||
164 | 174 | ||
165 | /* | 175 | /* |
166 | * Manipulation of page state flags | 176 | * Manipulation of page state flags |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index cdad3249cf7f..e12154d9c4ed 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -2277,32 +2277,40 @@ static char *vmstat_text[] = { | |||
2277 | "pgpgout", | 2277 | "pgpgout", |
2278 | "pswpin", | 2278 | "pswpin", |
2279 | "pswpout", | 2279 | "pswpout", |
2280 | "pgalloc_high", | ||
2281 | 2280 | ||
2281 | "pgalloc_high", | ||
2282 | "pgalloc_normal", | 2282 | "pgalloc_normal", |
2283 | "pgalloc_dma32", | ||
2283 | "pgalloc_dma", | 2284 | "pgalloc_dma", |
2285 | |||
2284 | "pgfree", | 2286 | "pgfree", |
2285 | "pgactivate", | 2287 | "pgactivate", |
2286 | "pgdeactivate", | 2288 | "pgdeactivate", |
2287 | 2289 | ||
2288 | "pgfault", | 2290 | "pgfault", |
2289 | "pgmajfault", | 2291 | "pgmajfault", |
2292 | |||
2290 | "pgrefill_high", | 2293 | "pgrefill_high", |
2291 | "pgrefill_normal", | 2294 | "pgrefill_normal", |
2295 | "pgrefill_dma32", | ||
2292 | "pgrefill_dma", | 2296 | "pgrefill_dma", |
2293 | 2297 | ||
2294 | "pgsteal_high", | 2298 | "pgsteal_high", |
2295 | "pgsteal_normal", | 2299 | "pgsteal_normal", |
2300 | "pgsteal_dma32", | ||
2296 | "pgsteal_dma", | 2301 | "pgsteal_dma", |
2302 | |||
2297 | "pgscan_kswapd_high", | 2303 | "pgscan_kswapd_high", |
2298 | "pgscan_kswapd_normal", | 2304 | "pgscan_kswapd_normal", |
2299 | 2305 | "pgscan_kswapd_dma32", | |
2300 | "pgscan_kswapd_dma", | 2306 | "pgscan_kswapd_dma", |
2307 | |||
2301 | "pgscan_direct_high", | 2308 | "pgscan_direct_high", |
2302 | "pgscan_direct_normal", | 2309 | "pgscan_direct_normal", |
2310 | "pgscan_direct_dma32", | ||
2303 | "pgscan_direct_dma", | 2311 | "pgscan_direct_dma", |
2304 | "pginodesteal", | ||
2305 | 2312 | ||
2313 | "pginodesteal", | ||
2306 | "slabs_scanned", | 2314 | "slabs_scanned", |
2307 | "kswapd_steal", | 2315 | "kswapd_steal", |
2308 | "kswapd_inodesteal", | 2316 | "kswapd_inodesteal", |