summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2004-03-11 16:22:06 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-03-11 16:22:06 -0800
commit760d95b5a58de70a26352d5ee385dab1d7144dab (patch)
treee49134dd35351d3182d77edf69454d1fb5ceb8f3 /include/linux
parentbae30a3f854dd84d9857c19558e5b9aed0eb1610 (diff)
[PATCH] vm: per-zone vmscan instrumentation
To check on zone balancing, split the /proc/vmstat:pgsteal, pgreclaim pgalloc and pgscan stats into per-zone counters. Additionally, split the pgscan stats into pgscan_direct and pgscan_kswapd to see who's doing how much scanning. And add a metric for the number of slab objects which were scanned.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mmzone.h5
-rw-r--r--include/linux/page-flags.h40
2 files changed, 39 insertions, 6 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 1cbccb4d226f..147870f47c03 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -288,6 +288,11 @@ static inline int is_highmem(struct zone *zone)
return (zone - zone->zone_pgdat->node_zones == ZONE_HIGHMEM);
}
+static inline int is_normal(struct zone *zone)
+{
+ return (zone - zone->zone_pgdat->node_zones == ZONE_NORMAL);
+}
+
/* These two functions are used to setup the per zone pages min values */
struct ctl_table;
struct file;
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 0b35e7111465..f58c9e68d3d8 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -98,23 +98,38 @@ struct page_state {
unsigned long pgpgout; /* Disk writes */
unsigned long pswpin; /* swap reads */
unsigned long pswpout; /* swap writes */
- unsigned long pgalloc; /* page allocations */
+ unsigned long pgalloc_high; /* page allocations */
+ unsigned long pgalloc_normal;
+ unsigned long pgalloc_dma;
unsigned long pgfree; /* page freeings */
unsigned long pgactivate; /* pages moved inactive->active */
unsigned long pgdeactivate; /* pages moved active->inactive */
+
unsigned long pgfault; /* faults (major+minor) */
unsigned long pgmajfault; /* faults (major only) */
-
- unsigned long pgscan; /* pages scanned by page reclaim */
- unsigned long pgrefill; /* inspected in refill_inactive_zone */
- unsigned long pgsteal; /* total pages reclaimed */
+ unsigned long pgrefill_high; /* inspected in refill_inactive_zone */
+ unsigned long pgrefill_normal;
+ unsigned long pgrefill_dma;
+
+ unsigned long pgsteal_high; /* total highmem pages reclaimed */
+ unsigned long pgsteal_normal;
+ unsigned long pgsteal_dma;
+ unsigned long pgscan_kswapd_high;/* total highmem pages scanned */
+ unsigned long pgscan_kswapd_normal;
+
+ unsigned long pgscan_kswapd_dma;
+ unsigned long pgscan_direct_high;/* total highmem pages scanned */
+ unsigned long pgscan_direct_normal;
+ unsigned long pgscan_direct_dma;
unsigned long pginodesteal; /* pages reclaimed via inode freeing */
- unsigned long kswapd_steal; /* pages reclaimed by kswapd */
+ unsigned long slabs_scanned; /* slab objects scanned */
+ unsigned long kswapd_steal; /* pages reclaimed by kswapd */
unsigned long kswapd_inodesteal;/* reclaimed via kswapd inode freeing */
unsigned long pageoutrun; /* kswapd's calls to page reclaim */
unsigned long allocstall; /* direct reclaim calls */
+
unsigned long pgrotated; /* pages rotated to tail of the LRU */
} ____cacheline_aligned;
@@ -131,11 +146,24 @@ extern void get_full_page_state(struct page_state *ret);
local_irq_restore(flags); \
} while (0)
+
#define inc_page_state(member) mod_page_state(member, 1UL)
#define dec_page_state(member) mod_page_state(member, 0UL - 1)
#define add_page_state(member,delta) mod_page_state(member, (delta))
#define sub_page_state(member,delta) mod_page_state(member, 0UL - (delta))
+#define mod_page_state_zone(zone, member, delta) \
+ do { \
+ unsigned long flags; \
+ local_irq_save(flags); \
+ if (is_highmem(zone)) \
+ __get_cpu_var(page_states).member##_high += (delta);\
+ else if (is_normal(zone)) \
+ __get_cpu_var(page_states).member##_normal += (delta);\
+ else \
+ __get_cpu_var(page_states).member##_dma += (delta);\
+ local_irq_restore(flags); \
+ } while (0)
/*
* Manipulation of page state flags