aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaoya Horiguchi <[email protected]>2015-09-22 14:59:14 -0700
committerLinus Torvalds <[email protected]>2015-09-22 15:09:53 -0700
commit3aaa76e125c1dd58c9b599baa8c6021896874c12 (patch)
treed733e970440cbe96dc3fe78cbaf56b1581eb036b
parent8a04446ab0cf4f35d9f583cd6adcbf7c534e4995 (diff)
mm: migrate: hugetlb: putback destination hugepage to active list
Since commit bcc54222309c ("mm: hugetlb: introduce page_huge_active") each hugetlb page maintains its active flag to avoid a race condition betwe= en multiple calls of isolate_huge_page(), but current kernel doesn't set the f= lag on a hugepage allocated by migration because the proper putback routine isn= 't called. This means that users could still encounter the race referred to by bcc54222309c in this special case, so this patch fixes it. Fixes: bcc54222309c ("mm: hugetlb: introduce page_huge_active") Signed-off-by: Naoya Horiguchi <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Andi Kleen <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: <[email protected]> [4.1.x] Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--mm/migrate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index c3cb566af3e2..7452a00bbb50 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1075,7 +1075,7 @@ out:
if (rc != MIGRATEPAGE_SUCCESS && put_new_page)
put_new_page(new_hpage, private);
else
- put_page(new_hpage);
+ putback_active_hugepage(new_hpage);
if (result) {
if (rc)