Mel Gorman e80d6a2482 [ARM] Skip memory holes in FLATMEM when reading /proc/pagetypeinfo
Ordinarily, memory holes in flatmem still have a valid memmap and is safe
to use. However, an architecture (ARM) frees up the memmap backing memory
holes on the assumption it is never used. /proc/pagetypeinfo reads the
whole range of pages in a zone believing that the memmap is valid and that
pfn_valid will return false if it is not. On ARM, freeing the memmap breaks
the page->zone linkages even though pfn_valid() returns true and the kernel
can oops shortly afterwards due to accessing a bogus struct zone *.

This patch lets architectures say when FLATMEM can have holes in the
memmap. Rather than an expensive check for valid memory, /proc/pagetypeinfo
will confirm that the page linkages are still valid by checking page->zone
is still the expected zone. The lookup of page_zone is safe as there is a
limited range of memory that is accessed when calling page_zone.  Even if
page_zone happens to return the correct zone, the impact is that the counters
in /proc/pagetypeinfo are slightly off but fragmentation monitoring is
unlikely to be relevant on an embedded system.

Reported-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Mel Gorman <mel@csn.ul.ie>
Tested-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2008-08-27 20:09:28 +01:00
..
2008-08-04 21:31:34 -07:00
2008-07-28 16:30:21 -07:00
2008-07-19 22:39:46 -07:00
2008-07-24 10:47:17 -07:00
2008-07-28 16:30:21 -07:00
2008-08-04 21:31:34 -07:00
2007-10-20 01:27:18 +02:00
2008-08-04 21:31:34 -07:00
2008-04-28 08:58:18 -07:00
2008-08-04 16:58:45 -07:00
2008-07-28 16:30:21 -07:00
2008-07-28 16:30:21 -07:00
2008-07-28 16:30:21 -07:00
2007-05-21 09:18:19 -07:00
2008-08-04 16:01:47 +09:00
2008-02-05 09:44:19 -08:00
2008-07-26 12:00:06 -07:00
2008-06-12 18:05:41 -07:00
2007-10-20 01:27:18 +02:00
2008-07-26 12:00:06 -07:00
2008-08-20 15:40:32 -07:00
2008-08-04 21:31:34 -07:00
2008-07-29 23:44:26 +03:00
2008-07-29 23:44:26 +03:00
2008-08-05 09:28:47 +03:00
2008-07-04 10:40:04 -07:00
2008-08-20 15:40:30 -07:00
2008-08-04 21:31:34 -07:00
2008-08-04 21:31:34 -07:00
2008-08-04 21:31:34 -07:00
2008-07-26 12:00:07 -07:00
2008-08-04 21:31:34 -07:00