From: Gerald Schaefer <gerald.schaefer@de.ibm.com>
To: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>,
Andrew Morton <akpm@linux-foundation.org>,
Hugh Dickins <hughd@google.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Michal Hocko <mhocko@suse.cz>,
Andrea Arcangeli <aarcange@redhat.com>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Gerald Schaefer <gerald.schaefer@de.ibm.com>,
stable@vger.kernel.org.#.v3.12
Subject: [PATCH] mm/hugetlb: use pmd_page() in follow_huge_pmd()
Date: Thu, 9 Apr 2015 18:11:35 +0200 [thread overview]
Message-ID: <1428595895-24140-1-git-send-email-gerald.schaefer@de.ibm.com> (raw)
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>
next reply other threads:[~2015-04-09 16:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-09 16:11 Gerald Schaefer [this message]
2015-04-09 19:41 ` [PATCH] mm/hugetlb: use pmd_page() in follow_huge_pmd() 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1428595895-24140-1-git-send-email-gerald.schaefer@de.ibm.com \
--to=gerald.schaefer@de.ibm.com \
--cc=aarcange@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.cz \
--cc=n-horiguchi@ah.jp.nec.com \
--cc=schwidefsky@de.ibm.com \
--cc=stable@vger.kernel.org.#.v3.12 \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).