* [PATCH][mmotm] mm/mempolicy.c: add check to avoid queuing hugepage under migration
@ 2013-09-11 2:12 Naoya Horiguchi
0 siblings, 0 replies; only message in thread
From: Naoya Horiguchi @ 2013-09-11 2:12 UTC (permalink / raw)
To: linux-mm
Cc: Mel Gorman, Andrew Morton, Hugh Dickins, KOSAKI Motohiro,
Andi Kleen, Hillf Danton, Michal Hocko, Rik van Riel,
Aneesh Kumar K.V, Wanpeng Li, linux-kernel, Naoya Horiguchi
queue_pages_pmd_range() checks pmd_huge() to find hugepage, but this check
assumes the pmd is in the normal format and does not work on migration entry
whoes format is like swap entry. We can distinguish them with present bit,
so we need to check it before cheking pmd_huge(). Otherwise, pmd_huge() can
wrongly return false for hugepage, and the behavior is unpredictable.
This patch is against mmotm-2013-08-27.
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
---
mm/mempolicy.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 64d00c4..0472964 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -553,6 +553,8 @@ static inline int queue_pages_pmd_range(struct vm_area_struct *vma, pud_t *pud,
pmd = pmd_offset(pud, addr);
do {
next = pmd_addr_end(addr, end);
+ if (!pmd_present(*pmd))
+ continue;
if (pmd_huge(*pmd) && is_vm_hugetlb_page(vma)) {
queue_pages_hugetlb_pmd_range(vma, pmd, nodes,
flags, private);
--
1.8.3.1
--
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>
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-09-11 2:12 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-11 2:12 [PATCH][mmotm] mm/mempolicy.c: add check to avoid queuing hugepage under migration Naoya Horiguchi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox