From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752025AbbIPAXL (ORCPT ); Tue, 15 Sep 2015 20:23:11 -0400 Received: from TYO201.gate.nec.co.jp ([210.143.35.51]:50914 "EHLO tyo201.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750994AbbIPAXJ convert rfc822-to-8bit (ORCPT ); Tue, 15 Sep 2015 20:23:09 -0400 From: Naoya Horiguchi To: Andrew Morton CC: Michal Hocko , Andi Kleen , "Hugh Dickins" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "Naoya Horiguchi" Subject: [PATCH v1] mm: migrate: hugetlb: putback destination hugepage to active list Thread-Topic: [PATCH v1] mm: migrate: hugetlb: putback destination hugepage to active list Thread-Index: AQHQ8BWSNPQN4LHDJkSjsU9eUK3icQ== Date: Wed, 16 Sep 2015 00:21:04 +0000 Message-ID: <1442362850-23261-1-git-send-email-n-horiguchi@ah.jp.nec.com> References: <20150812000336.GB32192@hori1.linux.bs1.fc.nec.co.jp> In-Reply-To: <20150812000336.GB32192@hori1.linux.bs1.fc.nec.co.jp> Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.128.101.2] Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit bcc54222309c ("mm: hugetlb: introduce page_huge_active") each hugetlb page maintains its active flag to avoid a race condition between multiple calls of isolate_huge_page(), but current kernel doesn't set the flag 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: #4.1 --- mm/migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git v4.3-rc1/mm/migrate.c v4.3-rc1_patched/mm/migrate.c index c3cb566af3e2..7452a00bbb50 100644 --- v4.3-rc1/mm/migrate.c +++ v4.3-rc1_patched/mm/migrate.c @@ -1075,7 +1075,7 @@ static int unmap_and_move_huge_page(new_page_t get_new_page, 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) -- 2.4.3