Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:43372 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934895AbbIVV7P (ORCPT ); Tue, 22 Sep 2015 17:59:15 -0400 Date: Tue, 22 Sep 2015 14:59:14 -0700 From: akpm@linux-foundation.org To: torvalds@linux-foundation.org, akpm@linux-foundation.org, n-horiguchi@ah.jp.nec.com, andi@firstfloor.org, hughd@google.com, mhocko@suse.cz, stable@vger.kernel.org Subject: [patch 10/15] mm: migrate: hugetlb: putback destination hugepage to active list Message-ID: <5601cf32.wXAnL4/CBHVVRfx8%akpm@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org List-ID: From: Naoya Horiguchi Subject: 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 Cc: Michal Hocko Cc: Andi Kleen Cc: Hugh Dickins Cc: [4.1.x] Signed-off-by: Andrew Morton --- mm/migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -puN mm/migrate.c~mm-migrate-hugetlb-putback-destination-hugepage-to-active-list mm/migrate.c --- a/mm/migrate.c~mm-migrate-hugetlb-putback-destination-hugepage-to-active-list +++ a/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) _