linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/gup: fix gup_pmd_range() for dax
@ 2019-01-11  3:40 Yu Zhao
  0 siblings, 0 replies; only message in thread
From: Yu Zhao @ 2019-01-11  3:40 UTC (permalink / raw)
  To: Andrew Morton, Dan Williams, Huang Ying
  Cc: Matthew Wilcox, Keith Busch, Michael S . Tsirkin, Jan Kara,
	John Hubbard, Wei Yang, Mike Rapoport, Andrea Arcangeli,
	linux-mm, linux-kernel, Kirill A . Shutemov, Yu Zhao

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.

Signed-off-by: Yu Zhao <yuzhao@google.com>
---
 mm/gup.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/gup.c b/mm/gup.c
index 05acd7e2eb22..75029649baca 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1674,7 +1674,8 @@ static int gup_pmd_range(pud_t pud, unsigned long addr, unsigned long end,
 		if (!pmd_present(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
-- 
2.20.1.97.g81188d93c3-goog

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

only message in thread, other threads:[~2019-01-11  3:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-11  3:40 [PATCH] mm/gup: fix gup_pmd_range() for dax Yu Zhao

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