Re: [PATCH 1/1] hugetlb: pull gigantic page initialisation out of the default path

Andrew Morton
2008-10-10T21:55:13Z

On Wed, 8 Oct 2008 23:31:45 +1100
Nick Piggin <nickpiggin@yahoo.com.au> wrote:

> On Wednesday 08 October 2008 20:34, Andy Whitcroft wrote:
> > As we can determine exactly when a gigantic page is in use we can optimise
> > the common regular page cases by pulling out gigantic page initialisation
> > into its own function. As gigantic pages are never released to buddy we
> > do not need a destructor. This effectivly reverts the previous change
> > to the main buddy allocator. It also adds a paranoid check to ensure we
> > never release gigantic pages from hugetlbfs to the main buddy.
>
> Thanks for doing this. Can prep_compound_gigantic_page be #ifdef HUGETLB?

Yup.

--- a/mm/page_alloc.c~hugetlb-pull-gigantic-page-initialisation-out-of-the-default-path-fix
+++ a/mm/page_alloc.c
@@ -280,6 +280,7 @@ void prep_compound_page(struct page *pag
}
}

+#ifdef CONFIG_HUGETLBFS
void prep_compound_gigantic_page(struct page *page, unsigned long order)
{
int i;
@@ -294,6 +295,7 @@ void prep_compound_gigantic_page(struct
p->first_page = page;
}
}
+#endif

static void destroy_compound_page(struct page *page, unsigned long order)
{
_