linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/hugetlb: use pmd_page() in follow_huge_pmd()
@ 2015-04-09 16:11 Gerald Schaefer
  2015-04-09 19:41 ` David Rientjes
  2015-04-10  0:08 ` Naoya Horiguchi
  0 siblings, 2 replies; 6+ messages in thread
From: Gerald Schaefer @ 2015-04-09 16:11 UTC (permalink / raw)
  To: Naoya Horiguchi, Andrew Morton, Hugh Dickins
  Cc: linux-kernel, linux-mm, Michal Hocko, Andrea Arcangeli,
	Martin Schwidefsky, Gerald Schaefer, stable

commit 61f77eda "mm/hugetlb: reduce arch dependent code around follow_huge_*"
broke follow_huge_pmd() on s390, where pmd and pte layout differ and using
pte_page() on a huge pmd will return wrong results. Using pmd_page() instead
fixes this.

All architectures that were touched by commit 61f77eda have pmd_page()
defined, so this should not break anything on other architectures.

Signed-off-by: Gerald Schaefer <gerald.schaefer@de.ibm.com>
Cc: stable@vger.kernel.org # v3.12
---
 mm/hugetlb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index e8c92ae..271e443 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -3865,8 +3865,7 @@ retry:
 	if (!pmd_huge(*pmd))
 		goto out;
 	if (pmd_present(*pmd)) {
-		page = pte_page(*(pte_t *)pmd) +
-			((address & ~PMD_MASK) >> PAGE_SHIFT);
+		page = pmd_page(*pmd) + ((address & ~PMD_MASK) >> PAGE_SHIFT);
 		if (flags & FOLL_GET)
 			get_page(page);
 	} else {
-- 
2.1.4

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-04-23  7:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-09 16:11 [PATCH] mm/hugetlb: use pmd_page() in follow_huge_pmd() Gerald Schaefer
2015-04-09 19:41 ` David Rientjes
2015-04-10  8:08   ` Gerald Schaefer
2015-04-10 20:38     ` Andrew Morton
2015-04-23  7:46       ` Jiri Slaby
2015-04-10  0:08 ` Naoya Horiguchi

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).