[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190311195824.139043-20-sashal@kernel.org>
Date: Mon, 11 Mar 2019 15:58:17 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Yu Zhao <yuzhao@...gle.com>,
Dan Williams <dan.j.williams@...el.com>,
Huang Ying <ying.huang@...el.com>,
Matthew Wilcox <willy@...radead.org>,
Keith Busch <keith.busch@...el.com>,
"Michael S . Tsirkin" <mst@...hat.com>,
John Hubbard <jhubbard@...dia.com>,
Wei Yang <richard.weiyang@...il.com>,
Mike Rapoport <rppt@...ux.ibm.com>,
Andrea Arcangeli <aarcange@...hat.com>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Sasha Levin <sashal@...nel.org>, linux-mm@...ck.org
Subject: [PATCH AUTOSEL 4.14 20/27] mm/gup: fix gup_pmd_range() for dax
From: Yu Zhao <yuzhao@...gle.com>
[ 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@...gle.com>
Reviewed-by: Jan Kara <jack@...e.cz>
Cc: Dan Williams <dan.j.williams@...el.com>
Cc: Huang Ying <ying.huang@...el.com>
Cc: Matthew Wilcox <willy@...radead.org>
Cc: Keith Busch <keith.busch@...el.com>
Cc: "Michael S . Tsirkin" <mst@...hat.com>
Cc: John Hubbard <jhubbard@...dia.com>
Cc: Wei Yang <richard.weiyang@...il.com>
Cc: Mike Rapoport <rppt@...ux.ibm.com>
Cc: Andrea Arcangeli <aarcange@...hat.com>
Cc: "Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>
Signed-off-by: Andrew Morton <akpm@...ux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@...ux-foundation.org>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
mm/gup.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mm/gup.c b/mm/gup.c
index 4cc8a6ff0f56..7c0e5b1bbcd4 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1643,7 +1643,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.19.1
Powered by blists - more mailing lists