linux/arch/arm
Mel Gorman eb33575cf6 [ARM] Double check memmap is actually valid with a memmap has unexpected holes V2
pfn_valid() is meant to be able to tell if a given PFN has valid memmap
associated with it or not. In FLATMEM, it is expected that holes always
have valid memmap as long as there is valid PFNs either side of the hole.
In SPARSEMEM, it is assumed that a valid section has a memmap for the
entire section.

However, ARM and maybe other embedded architectures in the future free
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. A walker of the full memmap must then do this additional
check to ensure the memmap they are looking at is sane by making sure the
zone and PFN linkages are still valid. This is expensive, but walkers of
the full memmap are extremely rare.

This was caught before for FLATMEM and hacked around but it hits again for
SPARSEMEM because the page_zone linkages can look ok where the PFN linkages
are totally screwed. This looks like a hatchet job but the reality is that
any clean solution would end up consumning all the memory saved by punching
these unexpected holes in the memmap. For example, we tried marking the
memmap within the section invalid but the section size exceeds the size of
the hole in most cases so pfn_valid() starts returning false where valid
memmap exists. Shrinking the size of the section would increase memory
consumption offsetting the gains.

This patch identifies when an architecture is punching unexpected holes
in the memmap that the memory model cannot automatically detect and sets
ARCH_HAS_HOLES_MEMORYMODEL. At the moment, this is restricted to EP93xx
which is the model sub-architecture this has been reported on but may expand
later. When set, walkers of the full memmap must call memmap_valid_within()
for each PFN and passing in what it expects the page and zone to be for
that PFN. If it finds the linkages to be broken, it assumes the memmap is
invalid for that PFN.

Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-05-18 11:22:24 +01:00
..
boot
common [ARM] smp: fix cpumask usage in ARM SMP code 2009-05-17 16:22:46 +01:00
configs Merge branch 'for-rmk' of git://git.pengutronix.de/git/imx/linux-2.6 2009-05-05 09:22:26 +01:00
include/asm [ARM] smp: fix cpumask usage in ARM SMP code 2009-05-17 16:22:46 +01:00
kernel [ARM] smp: fix cpumask usage in ARM SMP code 2009-05-17 16:22:46 +01:00
lib
mach-aaec2000
mach-at91 clocksource: pass clocksource to read() callback 2009-04-21 13:41:47 -07:00
mach-clps711x
mach-davinci Merge branch 'fix/asoc' into for-linus 2009-05-15 15:38:26 +02:00
mach-ebsa110
mach-ep93xx [ARM] 5509/1: ep93xx: clkdev enable UARTS 2009-05-16 19:55:56 +01:00
mach-footbridge
mach-gemini
mach-h720x
mach-imx Merge master.kernel.org:/home/rmk/linux-2.6-arm 2009-04-24 08:36:41 -07:00
mach-integrator
mach-iop13xx
mach-iop32x
mach-iop33x
mach-ixp4xx Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2009-05-10 10:46:45 -07:00
mach-ixp23xx
mach-ixp2000
mach-kirkwood [ARM] 5460/1: Orion: reduce namespace pollution 2009-04-23 23:25:41 +01:00
mach-ks8695
mach-l7200
mach-lh7a40x
mach-loki [ARM] 5460/1: Orion: reduce namespace pollution 2009-04-23 23:25:41 +01:00
mach-mmp
mach-msm clocksource: pass clocksource to read() callback 2009-04-21 13:41:47 -07:00
mach-mv78xx0 [ARM] 5460/1: Orion: reduce namespace pollution 2009-04-23 23:25:41 +01:00
mach-mx1 MX1ADS: remove I2C ifdefs 2009-04-16 12:57:15 +02:00
mach-mx2 imx21: activate i2c 2009-04-16 12:57:13 +02:00
mach-mx3 mx31ads: Mark as having full regulatoion constraints with 1133-EV1 board 2009-04-16 13:03:56 +02:00
mach-netx clocksource: pass clocksource to read() callback 2009-04-21 13:41:47 -07:00
mach-ns9xxx clocksource: pass clocksource to read() callback 2009-04-21 13:41:47 -07:00
mach-omap1 Merge branch 'omap-clock-fixes' into omap-fixes 2009-04-24 09:56:16 -07:00
mach-omap2 ARM: OMAP2/3: Change omapfb to use clkdev for dispc and rfbi, v2 2009-05-16 08:28:17 -07:00
mach-orion5x [ARM] 5460/1: Orion: reduce namespace pollution 2009-04-23 23:25:41 +01:00
mach-pnx4008
mach-pxa [ARM] 5513/1: Eurotech VIPER SBC: fix compilation error 2009-05-16 19:55:56 +01:00
mach-realview [ARM] realview: fix broadcast tick support 2009-05-17 17:11:35 +01:00
mach-rpc
mach-s3c24a0/include/mach
mach-s3c2400
mach-s3c2410 [ARM] S3C2410: mach-bast.c registering i2c data too early 2009-05-15 15:13:25 +01:00
mach-s3c2412 [ARM] S3C2412: Add missing cache flush in suspend code 2009-05-01 12:28:16 +01:00
mach-s3c2440 [ARM] Osiris: Fix double initialisation in machine block 2009-04-17 12:42:24 +01:00
mach-s3c2442
mach-s3c2443
mach-s3c6400 [ARM] S3C64XX: Add S3C64XX_PA_IIS{0,1} to <mach/map.h> 2009-05-01 12:28:16 +01:00
mach-s3c6410
mach-sa1100 [ARM] lart: fix build error 2009-04-26 13:56:01 +01:00
mach-shark
mach-versatile clocksource: pass clocksource to read() callback 2009-04-21 13:41:47 -07:00
mach-w90x900
mm Merge master.kernel.org:/home/rmk/linux-2.6-arm 2009-05-02 16:40:20 -07:00
nwfpe [ARM] nwfpe: fix 'floatx80_is_nan' sparse warning 2009-05-15 12:49:14 +01:00
oprofile
plat-iop
plat-mxc mx27ads: move PBC mapping out of vmalloc space 2009-05-05 09:37:08 +02:00
plat-omap ARM: OMAP3: Fix number of GPIO lines for 34xx 2009-05-16 08:28:16 -07:00
plat-orion Merge master.kernel.org:/home/rmk/linux-2.6-arm 2009-04-24 08:36:41 -07:00
plat-pxa [ARM] pxa: fix issue of muxed GPIO irq_chip functions touching non-muxed GPIOs 2009-04-27 11:45:16 +08:00
plat-s3c [ARM] S3C: Do not set clk->owner field if unset 2009-05-15 15:21:57 +01:00
plat-s3c24xx [ARM] S3C24XX: Fix unused code warning in arch/arm/plat-s3c24xx/dma.c 2009-05-15 15:13:24 +01:00
plat-s3c64xx [ARM] S3C64XX: fix GPIO debug 2009-05-15 15:13:18 +01:00
tools
vfp
Kconfig [ARM] Double check memmap is actually valid with a memmap has unexpected holes V2 2009-05-18 11:22:24 +01:00
Kconfig-nommu
Kconfig.debug
Makefile