Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp54400imu; Thu, 8 Nov 2018 14:40:30 -0800 (PST) X-Google-Smtp-Source: AJdET5dSvXB+XKQ9UttuqqHFsmHvoti+5lcgzCVHkH0w54BH67uD0Maoz2I9/rMiM5aT4a1jVKj+ X-Received: by 2002:a62:adb:: with SMTP id 88-v6mr6316404pfk.121.1541716830061; Thu, 08 Nov 2018 14:40:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541716830; cv=none; d=google.com; s=arc-20160816; b=xXchJIPTzRIMz/sJ3wJvPy0G0r2z6vTvSM8XYmKNSqiKGV2RwKHEweWeR9R68Kf31l as8Ed9uSmpeSbpqstamOe7ymdx+xnrG8qnOIjyo6wCT6e9i3aJazeELO5AymVPnx3wg0 AtvAFdFzZ6eoSBnZblHSVE0PaXoyCIxdE6zJGPSJmjn8NhcsyZc/tPmU7DZKvAO2qX4C 98yEBqGcpIk3BzXa5U4hcbt6LpbtAJoQFAqWsQQ4I1dRqaVq7OvTlqieY1DV4gDr71vx BdP5bOMgZwCk3PgqcP+i7GsR0i+AsuxIEXWWiZTwcC0+JGn1p6nua2g3RF0ByTNbHnXK /uSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=ZoQ0XRMog92PpZfgxv0XQxl9qeAPDBei7Nj9xZ/gee4=; b=FKrDja46UnJYvHJ+9YA1LA2htFWm6lSn2fJZqy1ugRGAWuD9F2AH/gBSFHhzsX3glC 8nC8OeROAyrKk1a3k8r/sfABGSPlaN6s7oS6P0QlsFP5prfYLNOT7faoj/Ah2PJR3+aR MWD6ldnFSzLUdYLJU3KoD5nhLnwtKjKMJM9+Sw8yz73bsmoXlgnp0qB9jIbk0BxyQk2y eibPZPjBfdKkFL5DwkIKQ5WgP3uJj4Y3KtzMTCpOqnpOmnyT9+n7c/Vc4VHOR+gSncTz hinhnn2H/1i/KGUs/cqy9xevf9t8j89FXxhX2KU/w6Gpgw8QqxLokfI0iZtPQLsQnPmz 7b5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FmHP3kJ2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z16-v6si4829592pga.177.2018.11.08.14.40.08; Thu, 08 Nov 2018 14:40:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FmHP3kJ2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729230AbeKIHeB (ORCPT + 99 others); Fri, 9 Nov 2018 02:34:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:50356 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727463AbeKIHeA (ORCPT ); Fri, 9 Nov 2018 02:34:00 -0500 Received: from localhost (unknown [208.72.13.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D502821019; Thu, 8 Nov 2018 21:56:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714192; bh=FkO+DPUYMtJ5uDJ1S9M3TOqZMh3NHsM12chFSfGUeG4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FmHP3kJ2oXzFyFy1Q4zuZrUR+gJ0GfTULLGEu70lQy3KMf/pJzGVS0OdhkFD0ViRH 0RzFMJXYAsq6RAldZ0i1DktB6U6EnFrxnzdUeXyQ9Lk1lhCCptEwuYHM8VJnx10p0P ZDcE8gn9i3/rPpRofhak9wuuuLfkEN84XuX7m+no= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Naoya Horiguchi , Michal Hocko , Andi Kleen , Hugh Dickins , Andrew Morton , Linus Torvalds , Sasha Levin Subject: [PATCH 3.18 113/144] mm: migrate: hugetlb: putback destination hugepage to active list Date: Thu, 8 Nov 2018 13:51:24 -0800 Message-Id: <20181108215106.088438909@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215054.826084593@linuxfoundation.org> References: <20181108215054.826084593@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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 Cc: Michal Hocko Cc: Andi Kleen Cc: Hugh Dickins Cc: [4.1.x] Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- mm/migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- 2.17.1