+ mm-hugetlb-fix-race-when-migrate-pages.patch added to -mm tree
Hillf Danton
Acked-byQuoted 19 lines
From
b1e9b3214f1859fdf7d134cdcb56f5871933539cMon Sep 17 00:00:00 2001
From: Michal Hocko <[email protected]>
Date: Thu, 21 Jul 2016 09:28:13 +0200
Subject: [PATCH] mm, hugetlb: fixhuge_pte_allocBUG_ONZhong Jiang has reported a
BUG_ONfromhuge_pte_allochitting when he runs his database load with memory online and offline running in parallel. The reason is thathuge_pmd_sharemight detect a shared pmd which is currently migrated and so it has migration pte which is !pte_huge.There doesn't seem to be any easy way to prevent from the race and in fact seeing the migration swap entry is not harmful. Both callers of
huge_pte_allocare prepared to handle them.copy_hugetlb_page_rangewill copy the swap entry and make it COW if needed.hugetlb_faultwill back off and so the page fault is retries if the page is still under migration and waits for its completion inhugetlb_fault.
Quoted 6 lines
That means that the
BUG_ONis wrong and we should update it. Let's simply check that all present ptes arepte_hugeinstead.Reported-by zhongjiang <[email protected]>Signed-off-by Michal Hocko <[email protected]>---
Quoted 17 lines
mm/hugetlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)mm/hugetlb.c +1
-2@@ -4303,7 +4303,7 @@ pte_t *huge_pte_alloc(struct mm_struct *mm, pte = (pte_t *)pmd_alloc (mm, pud, addr); } } -BUG_ON (pte && !pte_none (*pte) && !pte_huge (*pte)); +BUG_ON (pte &&pte_present (*pte) && !pte_huge (*pte));return pte; } --
Quoted 2 lines
2.8.1
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>