[POWERPC] vmemmap fixes to use smaller pages
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 30 Apr 2008 05:41:48 +0000 (15:41 +1000)
committerPaul Mackerras <paulus@samba.org>
Thu, 15 May 2008 10:49:25 +0000 (20:49 +1000)
commitcec08e7a948326b01555be6311480aa08e637de2
treea08e1d91c9a0c5eaa4e81036a3d7f992b2de1745
parent08fcf1d61193d7b7779aa6d7388535e26e064a0b
[POWERPC] vmemmap fixes to use smaller pages

This changes vmemmap to use a different region (region 0xf) of the
address space, and to configure the page size of that region
dynamically at boot.

The problem with the current approach of always using 16M pages is that
it's not well suited to machines that have small amounts of memory such
as small partitions on pseries, or PS3's.

In fact, on the PS3, failure to allocate the 16M page backing vmmemmap
tends to prevent hotplugging the HV's "additional" memory, thus limiting
the available memory even more, from my experience down to something
like 80M total, which makes it really not very useable.

The logic used by my match to choose the vmemmap page size is:

 - If 16M pages are available and there's 1G or more RAM at boot,
   use that size.
 - Else if 64K pages are available, use that
 - Else use 4K pages

I've tested on a POWER6 (16M pages) and on an iSeries POWER3 (4K pages)
and it seems to work fine.

Note that I intend to change the way we organize the kernel regions &
SLBs so the actual region will change from 0xf back to something else at
one point, as I simplify the SLB miss handler, but that will be for a
later patch.

Signed-off-by: Paul Mackerras <paulus@samba.org>
arch/powerpc/mm/hash_utils_64.c
arch/powerpc/mm/init_64.c
arch/powerpc/mm/slb.c
arch/powerpc/mm/slb_low.S
include/asm-powerpc/mmu-hash64.h
include/asm-powerpc/pgtable-ppc64.h