[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100826082438.GV21389@spritzera.linux.bs1.fc.nec.co.jp>
Date: Thu, 26 Aug 2010 17:24:38 +0900
From: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
To: Wu Fengguang <fengguang.wu@...el.com>
Cc: Andi Kleen <andi@...stfloor.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Christoph Lameter <cl@...ux-foundation.org>,
Mel Gorman <mel@....ul.ie>,
"Jun'ichi Nomura" <j-nomura@...jp.nec.com>,
linux-mm <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/8] hugetlb: add allocate function for hugepage migration
On Wed, Aug 25, 2010 at 09:29:41AM +0800, Wu Fengguang wrote:
> > +static struct page *alloc_buddy_huge_page_node(struct hstate *h, int nid)
> > +{
> > + struct page *page = __alloc_huge_page_node(h, nid);
> > if (page) {
> > - if (arch_prepare_hugepage(page)) {
> > - __free_pages(page, huge_page_order(h));
> > + 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_testzero(page);
> > + }
> > + return page;
> > +}
>
> One would expect the alloc_buddy_huge_page_node() to only differ with
> alloc_buddy_huge_page() in the alloc_pages/alloc_pages_exact_node
> calls. However you implement alloc_buddy_huge_page_node() in a quite
> different way. Can the two functions be unified at all?
Yes. I did it by adding argument @nid to alloc_buddy_huge_page().
Code gets cleaner and work without problems.
Thanks,
Naoya
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists