[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.2.00.1009101011140.9670@i5.linux-foundation.org>
Date: Fri, 10 Sep 2010 10:15:46 -0700 (PDT)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
cc: LKML <linux-kernel@...r.kernel.org>,
Andrea Arcangeli <aarcange@...hat.com>,
Hugh Dickins <hughd@...gle.com>,
Christoph Lameter <cl@...ux.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
Rik van Riel <riel@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Andi Kleen <andi@...stfloor.org>, linux-mm <linux-mm@...ck.org>
Subject: Re: [PATCH 3/4] hugetlb, rmap: fix confusing page locking in
hugetlb_cow()
On Fri, 10 Sep 2010, Naoya Horiguchi wrote:
>
> - if (!pagecache_page) {
> - page = pte_page(entry);
> + /*
> + * hugetlb_cow() requires page locks of pte_page(entry) and
> + * pagecache_page, so here we need take the former one
> + * when page != pagecache_page or !pagecache_page.
> + */
> + page = pte_page(entry);
> + if (page != pagecache_page)
> lock_page(page);
Why isn't this a potential deadlock? You have two pages, and lock them
both. Is there some ordering guarantee that says that 'pagecache_page' and
'page' will always be in a certain relationship so that you cannot get
A->B and B->A lock ordering?
Please document that ordering rule if so.
Linus
--
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