Re: [PATCH] [10/18] Factor out new huge page preparation code intoseparate function

From: Adam Litke
Date: Mon Mar 17 2008 - 16:30:32 EST



On Mon, 2008-03-17 at 02:58 +0100, Andi Kleen wrote:
> Index: linux/mm/hugetlb.c
> ===================================================================
> --- linux.orig/mm/hugetlb.c
> +++ linux/mm/hugetlb.c
> @@ -200,6 +200,17 @@ static int adjust_pool_surplus(struct hs
> return ret;
> }
>
> +static void huge_new_page(struct hstate *h, struct page *page)
> +{
> + unsigned nid = pfn_to_nid(page_to_pfn(page));
> + set_compound_page_dtor(page, free_huge_page);
> + spin_lock(&hugetlb_lock);
> + h->nr_huge_pages++;
> + h->nr_huge_pages_node[nid]++;
> + spin_unlock(&hugetlb_lock);
> + put_page(page); /* free it into the hugepage allocator */
> +}
> +
> static struct page *alloc_fresh_huge_page_node(struct hstate *h, int nid)
> {
> struct page *page;

We do not usually preface functions in mm/hugetlb.c with "huge" and the
name you have chosen doesn't seem that clear to me anyway. Could we
rename it to prep_new_huge_page() or something similar?

--
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/