linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Conditionally call unlock_page() in hugetlb_fault()
@ 2010-11-25  0:35 Dean Nelson
  0 siblings, 0 replies; only message in thread
From: Dean Nelson @ 2010-11-25  0:35 UTC (permalink / raw)
  To: linux-mm; +Cc: linux-kernel, Andrew Morton

Have hugetlb_fault() call unlock_page(page) only if it had previously called
lock_page(page).

Signed-off-by: Dean Nelson <dnelson@redhat.com>
CC: stable@kernel.org

---

Setting CONFIG_DEBUG_VM=y and then running the libhugetlbfs test suite,
resulted in the tripping of VM_BUG_ON(!PageLocked(page)) in unlock_page()
having been called by hugetlb_fault() when page == pagecache_page.
This patch remedied the problem.

 mm/hugetlb.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index c4a3558..8585524 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2738,7 +2738,8 @@ out_page_table_lock:
 		unlock_page(pagecache_page);
 		put_page(pagecache_page);
 	}
-	unlock_page(page);
+	if (page != pagecache_page)
+		unlock_page(page);
 
 out_mutex:
 	mutex_unlock(&hugetlb_instantiation_mutex);

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom policy in Canada: sign http://dissolvethecrtc.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-11-25  0:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-25  0:35 [PATCH] Conditionally call unlock_page() in hugetlb_fault() Dean Nelson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).