Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4144502pxb; Mon, 8 Feb 2021 08:56:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJyR7HF5ijyQTMRAsEqjty/+wmFW9FSRYUGfiL6+K15JhuY08GuDzuOr2M3DXc7e4NRKyLNq X-Received: by 2002:a05:6402:35ca:: with SMTP id z10mr18001527edc.186.1612803394609; Mon, 08 Feb 2021 08:56:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612803394; cv=none; d=google.com; s=arc-20160816; b=em6GB8mPGBRipQmR3osoAfLKlSVDPB84TmzRyzXS3x6i85DGX7MVjQyG45k6k5iqOe g1N12PhBvkpqkLeBECsupqWAH9lq4reKqdgCs+n49gNW2YZVmOPDy7xid0KUIusSzI8e DxLow57lnzFyDQtSQ6BJRe0Bd+4OmeCrJ4YAZZ1PfQhGCFdDYnMU1FY8ZYK+usGf6HAY Xtk9rWIHhryMXNeZ++JNkXGQp/c3CjuR/+unC9WXvIKxtzElzmA1sxCu5ZkCmgvWgeg9 VESqCmzpVV5EIErl9+N/xnGHBBc8BZuRtz3FqOAuavW7ZDbeBKwpSSj/8RjcZ+dEfTtE pPCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vEDoCl6tEFNG1+Kx7MeoroGnTlki7t3TJxRgcwfQmmA=; b=08Kah2yy+LGi7NOpjBvxgkpnIy/G3gQOf8K2d9woAr+98GBQlCqh8UODdNTeQUwQTP pfCIB/sqnc9lWLNCUOSeQi/AWHlvw5P5F/veIXzHBHG6xV+0uh95IeGSST9GtRhSdcSx 8wxaMl8yfVjovp8MyQ3hgogyGcIfjiE37y2PHZgcsNzXGKXDB2e/YmwMyGNCW4X5RViw f61aFoteisAbrXykFONt4jH7O53vNpBNmvSLhqHegAZHcWSSP+moQG7KwX5csLBqqZ+8 ssbLc1DIglX+0ojkJTohHbAEOiN9gdLKysUUz/oduV69KSa83ccEwX9T6Qx7YqvYOI1V GhPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DhuoTZ0A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m19si14287457edd.509.2021.02.08.08.56.09; Mon, 08 Feb 2021 08:56:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=DhuoTZ0A; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233574AbhBHQwY (ORCPT + 99 others); Mon, 8 Feb 2021 11:52:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:60178 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233393AbhBHPRa (ORCPT ); Mon, 8 Feb 2021 10:17:30 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3171464ED7; Mon, 8 Feb 2021 15:12:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612797123; bh=l6kelLns2a54V95MdoGr4X0peT0OIHegaSq042hNbEw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DhuoTZ0AEzHAhf9TmWOxI7fHo2CER8v2/rl7bBmUIeksy7znNONqWc9y898PSw6EZ djLh0TRSWvhwAsGDUPjJNW2Ip3WoA0XO6k6zmSPgxIq7PkYeyEGDwOfjxdJ2opmj2/ uQ4aQq2aFiEeY2TfkTMcRtYkA6UaafQCMaLv7wRI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Muchun Song , Mike Kravetz , Michal Hocko , Oscar Salvador , David Hildenbrand , Yang Shi , Andrew Morton , Linus Torvalds Subject: [PATCH 5.4 51/65] mm: hugetlb: remove VM_BUG_ON_PAGE from page_huge_active Date: Mon, 8 Feb 2021 16:01:23 +0100 Message-Id: <20210208145812.195767206@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210208145810.230485165@linuxfoundation.org> References: <20210208145810.230485165@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Muchun Song commit ecbf4724e6061b4b01be20f6d797d64d462b2bc8 upstream. The page_huge_active() can be called from scan_movable_pages() which do not hold a reference count to the HugeTLB page. So when we call page_huge_active() from scan_movable_pages(), the HugeTLB page can be freed parallel. Then we will trigger a BUG_ON which is in the page_huge_active() when CONFIG_DEBUG_VM is enabled. Just remove the VM_BUG_ON_PAGE. Link: https://lkml.kernel.org/r/20210115124942.46403-6-songmuchun@bytedance.com Fixes: 7e1f049efb86 ("mm: hugetlb: cleanup using paeg_huge_active()") Signed-off-by: Muchun Song Reviewed-by: Mike Kravetz Acked-by: Michal Hocko Reviewed-by: Oscar Salvador Cc: David Hildenbrand Cc: Yang Shi Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- mm/hugetlb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1234,8 +1234,7 @@ struct hstate *size_to_hstate(unsigned l */ bool page_huge_active(struct page *page) { - VM_BUG_ON_PAGE(!PageHuge(page), page); - return PageHead(page) && PagePrivate(&page[1]); + return PageHeadHuge(page) && PagePrivate(&page[1]); } /* never called for tail page */