summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorNaoya Horiguchi <n-horiguchi@ah.jp.nec.com>2015-09-22 14:59:14 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-11-10 07:39:20 -0800
commitf46c09f2fa5f718f40eadc32b024b105a0829278 (patch)
tree79961f86399747240be9bcdaed4381387721451a /mm
parent73c72ba64cbf2e69485de132a71b0dd175a01637 (diff)
downloadlinux-stable-f46c09f2fa5f718f40eadc32b024b105a0829278.tar.gz
linux-stable-f46c09f2fa5f718f40eadc32b024b105a0829278.tar.bz2
linux-stable-f46c09f2fa5f718f40eadc32b024b105a0829278.zip
mm: migrate: hugetlb: putback destination hugepage to active list
[ Upstream commit 3aaa76e125c1dd58c9b599baa8c6021896874c12 ] 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 <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: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/migrate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/migrate.c b/mm/migrate.c
index 4d743bce5a23..57559f9295f9 100644
--- a/mm/migrate.c
+++ b/mm/migrate.c
@@ -1077,7 +1077,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)