[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20190111034033.601-1-yuzhao@google.com>
Date: Thu, 10 Jan 2019 20:40:33 -0700
From: Yu Zhao <yuzhao@...gle.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
Dan Williams <dan.j.williams@...el.com>,
Huang Ying <ying.huang@...el.com>
Cc: Matthew Wilcox <willy@...radead.org>,
Keith Busch <keith.busch@...el.com>,
"Michael S . Tsirkin" <mst@...hat.com>, Jan Kara <jack@...e.cz>,
John Hubbard <jhubbard@...dia.com>,
Wei Yang <richard.weiyang@...il.com>,
Mike Rapoport <rppt@...ux.ibm.com>,
Andrea Arcangeli <aarcange@...hat.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Yu Zhao <yuzhao@...gle.com>
Subject: [PATCH] mm/gup: fix gup_pmd_range() for dax
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@...gle.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
Powered by blists - more mailing lists