Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4094483pxb; Mon, 8 Feb 2021 07:50:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1u3lZQkgtJ9Ri1DfY5ljDKaSesDkEbm7i6hPplFQxKBGc/G2Kmwq3x9q/ta93itnh4Csl X-Received: by 2002:a05:6402:6cc:: with SMTP id n12mr15737419edy.69.1612799405074; Mon, 08 Feb 2021 07:50:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612799405; cv=none; d=google.com; s=arc-20160816; b=0veRbWsAgLMjwRISaFa+OmZU4NdPPMGDQTxxLvjZY/aYnSoCRMHKY+AC8vQ7peacIT n/ZDSb7fCTDxZ2XdT9iQgsvreUEpEqyeeO/8ib7x18jPHlFz2qqLVddh/3QvDoyqEETS 67dzvWkAVyA8dF0f5KUk1g6kH5zejXxFlHvj/+nxQK1vUbtaM6lPoeXYF0heTCIPrS4n ouoddp4DMTW5P6mxEeP1G22VpNSxQzWEA3saViZyc9/78lQcVJmkxISstRpdES43saxl i7QKd9matjRaV336BNSPkMc59fAOCqEORdVoOth9S42sX8krwoPPioJwV5LKXFDaD3pM qasw== 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=+s7r/59XSHXxzHPb51WMHPVoVJOXRc6R2PI0pkExLW8=; b=MgcwF+2UAbyYdWbmwWNq1+mgZfKJFxSGE4owta7BBUYJ+AI3wfqOJK+BJqYy+NeCKL vBGrK6XeHiJMXg6Tv2Sm+gR9U/2aLAOdHjIPV3bafamcY/PPBREPqY8NS4XlRnXM6csq v9zaeTODIfbKcpBbmDPJ2It344qxhQAT09qsQeam940WAD4Bh2GSNKZK1RE54iVQxBks x+PmaANN9shtaSFS7LHk7TQMAXvKrXt5Bw9cNNiY+LLhSwKkYujFEUCQJupgJ9WuYY8x ourNVratf+KiackS1pmpjnaPMkxMnltsFzCmgBD+AcIAIeuMmMBHREBS3itMCmmmxEYM jimg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Sio7x1ZL; 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 s22si10334635ejv.410.2021.02.08.07.49.40; Mon, 08 Feb 2021 07:50:05 -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=Sio7x1ZL; 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 S229754AbhBHPqm (ORCPT + 99 others); Mon, 8 Feb 2021 10:46:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:52242 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233036AbhBHPGi (ORCPT ); Mon, 8 Feb 2021 10:06:38 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9967464EC4; Mon, 8 Feb 2021 15:05:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612796706; bh=Zr3a50vF2KkXLHkbobMc06uOnXhcEsQBL39Nd4bbvhc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sio7x1ZL3fmhLKNKQvlIjFH3eydaWIhMOkirh8ZCHOF+hdV3seWBMSAP+JSysMS1B p46oDzxWiT1CAWS0aMWugwtC4BNQmospI658VEpvoSwRhPCw03lo+8eGBNHv/GlRBv vEcelrI4jVawEZiPTZoIDc0T+89t0w+134GHcRMw= 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 4.9 36/43] mm: hugetlb: remove VM_BUG_ON_PAGE from page_huge_active Date: Mon, 8 Feb 2021 16:01:02 +0100 Message-Id: <20210208145807.768478692@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210208145806.281758651@linuxfoundation.org> References: <20210208145806.281758651@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 @@ -1210,8 +1210,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 */