From 940f51bfb2f01d61de13f698e9dded022238b42c Mon Sep 17 00:00:00 2001 From: Mel Gorman Date: Thu, 14 Aug 2008 11:10:14 +0100 Subject: [PATCH] --- yaml --- r: 109339 b: refs/heads/master c: e80d6a248298721e0ec2cac150c539d8378577d8 h: refs/heads/master i: 109337: ed52519e2a91f210c66ba832265c927bcbcab827 109335: 19b96e3a96b1d9175d9a78df6b8c7951f12618c3 v: v3 --- [refs] | 2 +- trunk/arch/arm/Kconfig | 5 +++++ trunk/mm/vmstat.c | 19 ++++++++++++++++++- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index d4814b0a7e17..f7da21f0e521 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f1bcf7e3e734ea8713e08fbc3409f8bf26ec418f +refs/heads/master: e80d6a248298721e0ec2cac150c539d8378577d8 diff --git a/trunk/arch/arm/Kconfig b/trunk/arch/arm/Kconfig index 4b8acd2851f4..70dba1668907 100644 --- a/trunk/arch/arm/Kconfig +++ b/trunk/arch/arm/Kconfig @@ -810,6 +810,11 @@ config OABI_COMPAT UNPREDICTABLE (in fact it can be predicted that it won't work at all). If in doubt say Y. +config ARCH_FLATMEM_HAS_HOLES + bool + default y + depends on FLATMEM + config ARCH_DISCONTIGMEM_ENABLE bool default (ARCH_LH7A40X && !LH7A40X_CONTIGMEM) diff --git a/trunk/mm/vmstat.c b/trunk/mm/vmstat.c index b0d08e667ece..d7826af2fb07 100644 --- a/trunk/mm/vmstat.c +++ b/trunk/mm/vmstat.c @@ -516,9 +516,26 @@ static void pagetypeinfo_showblockcount_print(struct seq_file *m, continue; page = pfn_to_page(pfn); +#ifdef CONFIG_ARCH_FLATMEM_HAS_HOLES + /* + * Ordinarily, memory holes in flatmem still have a valid + * memmap for the PFN range. However, an architecture for + * embedded systems (e.g. ARM) can free up the memmap backing + * holes to save memory on the assumption the memmap is + * never used. The page_zone linkages are then broken even + * though pfn_valid() returns true. Skip the page if the + * linkages are broken. Even if this test passed, the impact + * is that the counters for the movable type are off but + * fragmentation monitoring is likely meaningless on small + * systems. + */ + if (page_zone(page) != zone) + continue; +#endif mtype = get_pageblock_migratetype(page); - count[mtype]++; + if (mtype < MIGRATE_TYPES) + count[mtype]++; } /* Print counts */