Commit 3aaa76e1 authored by Naoya Horiguchi's avatar Naoya Horiguchi Committed by Linus Torvalds

mm: migrate: hugetlb: putback destination hugepage to active list

Since commit bcc54222 ("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 bcc54222 in this special
case, so this patch fixes it.

Fixes: bcc54222 ("mm: hugetlb: introduce page_huge_active")
Signed-off-by: default avatarNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: <stable@vger.kernel.org>  [4.1.x]
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 8a04446a
...@@ -1075,7 +1075,7 @@ static int unmap_and_move_huge_page(new_page_t get_new_page, ...@@ -1075,7 +1075,7 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,
if (rc != MIGRATEPAGE_SUCCESS && put_new_page) if (rc != MIGRATEPAGE_SUCCESS && put_new_page)
put_new_page(new_hpage, private); put_new_page(new_hpage, private);
else else
put_page(new_hpage); putback_active_hugepage(new_hpage);
if (result) { if (result) {
if (rc) if (rc)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment