summaryrefslogtreecommitdiff
authorYu Zhao <yuzhao@google.com>2019-02-12 23:35:58 (GMT)
committer Greg Kroah-Hartman <gregkh@linuxfoundation.org>2019-03-23 12:19:41 (GMT)
commitc133d8eb894cb280f331608c6f1962ba9fbfe6b0 (patch)
tree51d6cda634865cbca402008ad6511151cfa9157d
parent489a9abf60680d7489b25232989aa7719e70b27e (diff)
downloadcommon-c133d8eb894cb280f331608c6f1962ba9fbfe6b0.zip
common-c133d8eb894cb280f331608c6f1962ba9fbfe6b0.tar.gz
common-c133d8eb894cb280f331608c6f1962ba9fbfe6b0.tar.bz2
mm/gup: fix gup_pmd_range() for dax
[ Upstream commit 414fd080d125408cb15d04ff4907e1dd8145c8c7 ] For dax pmd, pmd_trans_huge() returns false but pmd_huge() returns true on x86. So the function works as long as hugetlb is configured. However, dax doesn't depend on hugetlb. Link: http://lkml.kernel.org/r/20190111034033.601-1-yuzhao@google.com Signed-off-by: Yu Zhao <yuzhao@google.com> Reviewed-by: Jan Kara <jack@suse.cz> Cc: Dan Williams <dan.j.williams@intel.com> Cc: Huang Ying <ying.huang@intel.com> Cc: Matthew Wilcox <willy@infradead.org> Cc: Keith Busch <keith.busch@intel.com> Cc: "Michael S . Tsirkin" <mst@redhat.com> Cc: John Hubbard <jhubbard@nvidia.com> Cc: Wei Yang <richard.weiyang@gmail.com> Cc: Mike Rapoport <rppt@linux.ibm.com> Cc: Andrea Arcangeli <aarcange@redhat.com> Cc: "Kirill A . Shutemov" <kirill.shutemov@linux.intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat
-rw-r--r--mm/gup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/gup.c b/mm/gup.c
index d71da72..99c2f10 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1423,7 +1423,8 @@ static int gup_pmd_range(pud_t pud, unsigned long addr, unsigned long end,
if (pmd_none(pmd))
return 0;
- if (unlikely(pmd_trans_huge(pmd) || pmd_huge(pmd))) {
+ if (unlikely(pmd_trans_huge(pmd) || pmd_huge(pmd) ||
+ pmd_devmap(pmd))) {
/*
* NUMA hinting faults need to be handled in the GUP
* slowpath for accounting purposes and so that they