• David Gibson's avatar
    powerpc/mm: Cleanup initialization of hugepages on powerpc · d1837cba
    David Gibson authored
    This patch simplifies the logic used to initialize hugepages on
    powerpc.  The somewhat oddly named set_huge_psize() is renamed to
    add_huge_page_size() and now does all necessary verification of
    whether it's given a valid hugepage sizes (instead of just some) and
    instantiates the generic hstate structure (but no more).
    
    hugetlbpage_init() now steps through the available pagesizes, checks
    if they're valid for hugepages by calling add_huge_page_size() and
    initializes the kmem_caches for the hugepage pagetables.  This means
    we can now eliminate the mmu_huge_psizes array, since we no longer
    need to pass the sizing information for the pagetable caches from
    set_huge_psize() into hugetlbpage_init()
    
    Determination of the default huge page size is also moved from the
    hash code into the general hugepage code.
    Signed-off-by: default avatarDavid Gibson <dwg@au1.ibm.com>
    Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
    d1837cba
page_64.h 5.32 KB