[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100924064714.GB26639@spritzera.linux.bs1.fc.nec.co.jp>
Date: Fri, 24 Sep 2010 15:47:14 +0900
From: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
To: Christoph Lameter <cl@...ux.com>
Cc: Andi Kleen <andi@...stfloor.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Mel Gorman <mel@....ul.ie>,
Wu Fengguang <fengguang.wu@...el.com>,
"Jun'ichi Nomura" <j-nomura@...jp.nec.com>,
linux-mm <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 06/10] hugetlb: move refcounting in hugepage allocation
inside hugetlb_lock
On Thu, Sep 23, 2010 at 12:12:55PM -0500, Christoph Lameter wrote:
> On Wed, 8 Sep 2010, Naoya Horiguchi wrote:
>
> > Currently alloc_huge_page() raises page refcount outside hugetlb_lock.
> > but it causes race when dequeue_hwpoison_huge_page() runs concurrently
> > with alloc_huge_page().
> > To avoid it, this patch moves set_page_refcounted() in hugetlb_lock.
>
> Reviewed-by: Christoph Lameter <cl@...ux.com>
>
> One wonders though how many other of these huge races are still there
> though.
>
> "Normal" page migration is based on LRU isolation and therefore does not
> suffer from these problems on allocation since the page is not yet on the
> LRU. Also the LRU isolation is a known issue due to memory reclaim doing
> this.
Yes.
For normal page, allocation and reclaiming and migration are protected from
each other by LRU isolation.
For huge page, however, allocation and migration (reclaiming is not available)
are protected by reference count, and race between allocation and hwpoison
are avoided by hugetlb_lock.
I see that this seems complex and can cause unpredicted races.
> This protection is going away of one goes directly to a page
> without going through the LRU. That should create more races...
To unify these protection mechanism, we need that LRU list become available
for hugepage, but we must wait for the appearance of hugepage swapping
for this. Or implementing dummy LRU list until then? (Maybe it's more messy...)
Thanks,
Naoya Horiguchi
--
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