Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4184602pxb; Mon, 8 Feb 2021 09:52:48 -0800 (PST) X-Google-Smtp-Source: ABdhPJxH/R4nj507LutOE1wtXW+39dP2r4PoN87z4Dl7+p09lqrWqepi9pTdR+LyCTUYwacBwkTT X-Received: by 2002:a2e:541b:: with SMTP id i27mr11495114ljb.331.1612806767351; Mon, 08 Feb 2021 09:52:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612806767; cv=none; d=google.com; s=arc-20160816; b=rFjRuBU2/db2Yy8MssMc4PShZ4C9WSINH+CUjDiTCYSPvGx3NfMyWEkGfWjW9HOdmM mS5EDrxC+Y19tpj/oRLjPuFXxVwDKNCNjDf/12xqSnj4gPbzz135BS+4+Few7f2bJhWa NFNx9PVKuJvzk/kuT3ReRMdVeN/rWKNyKorQlI/XLjwXKXvrqRhlDTTR934oaNdsx2Qi PHRcE/9Iql+kZ03hzxS2p9YV/nhngheOQQiLRWIU36bOIukIb6l+v12h3tvvZBOCGNz+ +2lsavLi1ihBzMzfopEHkEPM6qFPJN7GigFPKm1JNE/uRSvORgL2esaDwoO+72YWywjv Z9vw== 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=HyqzzOhuhR1nj2nLCk4XnZSHMX/ePSa5f5i2NfgGX6g=; b=a+AVEeVTkVJgwRG1T9onUlnR/HhfXEl3E20FwXeN5pgTpha5T+bd1OAKRdjMO29ptb 4MwSb7pgSMVeOaljz/eoygCdQJaSSgXjBfoYJlLa8HOi+XCsTS8iYB7PhwCLa0nvD/30 az3bD98M8Ob2xJbxzEAf7aWUUBXtq8iyM6HWzWfTDmqjUZJfeA2QDkhKDNZKaQ1+sYZO BOeskH5dhsThq0UtkeP44hK7kR9s1bkCj1zO3kYm7Sp0yUbH11MuqvzDwasxdWFzj/rl nW3gQj+uJc7k7sczeoqLuq1ugKVKV6d9ul3Mq3OBF45E7Nj/7PI8y7pQ/uhQhhQNbv8H 6f7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=UGEvVAlA; 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 e6si14708789edz.362.2021.02.08.09.52.23; Mon, 08 Feb 2021 09:52:47 -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=UGEvVAlA; 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 S235019AbhBHRvi (ORCPT + 99 others); Mon, 8 Feb 2021 12:51:38 -0500 Received: from mail.kernel.org ([198.145.29.99]:37068 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233922AbhBHPcQ (ORCPT ); Mon, 8 Feb 2021 10:32:16 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9DEFA64F3C; Mon, 8 Feb 2021 15:17:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612797479; bh=TdTA/fxymBE0tTeiPb+IL5zh8tbFN1R1nYYcEX0XlPA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UGEvVAlAVoJ0LWQDjq+sDHXph2FusimJoEl93Fhs9pOZJTEsLd8XVBw71JUDowy+L T1SEDGMfb4Mr9rkIr321xJc5WCyo5LTttC4uAQJEiKPg+2zJDgWgfP/Hr2lBbEcVDw e94dXr0oVAWUIAi5UGM4nU9ICrQEPGnqoncCC684= 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.10 101/120] mm: hugetlb: remove VM_BUG_ON_PAGE from page_huge_active Date: Mon, 8 Feb 2021 16:01:28 +0100 Message-Id: <20210208145822.401165815@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210208145818.395353822@linuxfoundation.org> References: <20210208145818.395353822@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 @@ -1361,8 +1361,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 */