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, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxxx For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>