powerpc/mm: Cleanup management of kmem_caches for pagetables
authorDavid Gibson <david@gibson.dropbear.id.au>
Wed, 28 Oct 2009 16:27:18 +0000 (16:27 +0000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 30 Oct 2009 06:20:57 +0000 (17:20 +1100)
commita0668cdc154e54bf0c85182e0535eea237d53146
tree84efcadf011e16c240ac9b1c948141fc1cc7d324
parentf71dc176aa06359681c30ba6877ffccab6fba3a6
powerpc/mm: Cleanup management of kmem_caches for pagetables

Currently we have a fair bit of rather fiddly code to manage the
various kmem_caches used to store page tables of various levels.  We
generally have two caches holding some combination of PGD, PUD and PMD
tables, plus several more for the special hugepage pagetables.

This patch cleans this all up by taking a different approach.  Rather
than the caches being designated as for PUDs or for hugeptes for 16M
pages, the caches are simply allocated to be a specific size.  Thus
sharing of caches between different types/levels of pagetables happens
naturally.  The pagetable size, where needed, is passed around encoded
in the same way as {PGD,PUD,PMD}_INDEX_SIZE; that is n where the
pagetable contains 2^n pointers.

Signed-off-by: David Gibson <dwg@au1.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/include/asm/pgalloc-32.h
arch/powerpc/include/asm/pgalloc-64.h
arch/powerpc/include/asm/pgalloc.h
arch/powerpc/include/asm/pgtable-ppc64.h
arch/powerpc/mm/hugetlbpage.c
arch/powerpc/mm/init_64.c
arch/powerpc/mm/pgtable.c