Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2601253rwb; Sat, 19 Nov 2022 20:40:27 -0800 (PST) X-Google-Smtp-Source: AA0mqf4COrzW6+zXvC6ZClILj998QyS1McxZ4rnIU5P7U6ACUuSOTv5mqup6hDh+qeztB6JV6lMJ X-Received: by 2002:a17:906:1b4a:b0:7ad:aeda:f81d with SMTP id p10-20020a1709061b4a00b007adaedaf81dmr11430524ejg.588.1668919227335; Sat, 19 Nov 2022 20:40:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668919227; cv=none; d=google.com; s=arc-20160816; b=QOtG2yOxKjPt8y6HZXoQseEUZBgwSxGJz9GUm1mPfLonb/+vYOxPkaDyGCsz99QM2k 3CuVZ31AoQX4YwXFgyvRibFillt27AukiPkBGGmJpJaP7wvMb2VeBxfLMWvUZRbmZzgz Z/gnvmNHT944itPpjT9i5Txw8TonwiwDoOHYCFRpOBcwoxzfXC6c6nxCWCyolGDp5smH VcBsvpWz/INcO6kZSXvfUKQTPDwZUT95GufKQe/wsim+hd94zXDrPFoceSWuoecW2lXx gljdXCRxKpoZptByxrWzhpxBJzc6wFYXvANicjT3Ucq5hSXaYBZ0+a3IRxj16QYP7whj aW0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=HDxWdGiElBsqX8waqP46DZtvp4qVUO5EP4TRxvBLmaY=; b=ALCpf+zOhjx9BTnac2AVcAjQapTkvh1rKSCDPXNmRf0kvyeDudHTWp1O/NhktJhFJY L37VqOcMCD2PQh+rgb5QIKVNBvLMsNZFJdkBAlaivc/QSfQxopAnKWsNr7GGeYK6TGl3 ZrogNzOjAroWnkMxJULaiJ2y3BfAfWGQbeCwosBAOinbZtOjncNmvHkeLTa74mOq7KTQ 3nKjiSgznxYOXOxVZ7boaoIMbUWxIf6DbXXq+z8VBFSKLnCp+T6M8Ntbu3bwKFstGPwT aFzDuwnkU600VgXyZAcruijEjGFks0DZAVYok5p3Cb7TRL7eTHRiXmv2KGNNQuauxQrZ a5TA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=g3Evtgww; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nc30-20020a1709071c1e00b0077f3a9c58e2si6766478ejc.6.2022.11.19.20.39.47; Sat, 19 Nov 2022 20:40:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=g3Evtgww; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229518AbiKTEEQ (ORCPT + 90 others); Sat, 19 Nov 2022 23:04:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbiKTEEO (ORCPT ); Sat, 19 Nov 2022 23:04:14 -0500 Received: from out0.migadu.com (out0.migadu.com [IPv6:2001:41d0:2:267::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A33369E97B for ; Sat, 19 Nov 2022 20:04:11 -0800 (PST) Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1668917049; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HDxWdGiElBsqX8waqP46DZtvp4qVUO5EP4TRxvBLmaY=; b=g3EvtgwwK1CFc0Jgv3Ju3S+OtVQ2JsxjeC09PWbMWC9UN5lIDfZzL2MG6SJc/Z63dVoSP7 WvVu1I3F35qBcmrjIEsf78lSkMiAYLSbY+40l73sTTiHNI97ORFuueqE34ZnasaIKuaks7 UXmObkORL9qcHf/QG0P2VmTJbeYbOX4= MIME-Version: 1.0 Subject: Re: [PATCH] hugetlb: Fix __prep_compound_gigantic_page page flag setting X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: <20221118195249.178319-1-mike.kravetz@oracle.com> Date: Sun, 20 Nov 2022 12:03:52 +0800 Cc: Linux Memory Management List , linux-kernel@vger.kernel.org, Andrew Morton , Muchun Song , Joao Martins , Matthew Wilcox , Michal Hocko , Peter Xu , Miaohe Lin , Oscar Salvador , Naoya Horiguchi , Vlastimil Babka , Sidhartha Kumar , "Aneesh Kumar K . V" Content-Transfer-Encoding: quoted-printable Message-Id: <2D335332-2BFB-4F69-ACA2-3CE5EC5BD494@linux.dev> References: <20221118195249.178319-1-mike.kravetz@oracle.com> To: Mike Kravetz X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Nov 19, 2022, at 03:52, Mike Kravetz = wrote: >=20 > Commit 2b21624fc232 ("hugetlb: freeze allocated pages before creating > hugetlb pages") changed the order page flags were cleared and set in = the > head page. It moved the __ClearPageReserved after __SetPageHead. > However, there is a check to make sure __ClearPageReserved is never > done on a head page. If CONFIG_DEBUG_VM_PGFLAGS is enabled, the > following BUG will be hit when creating a hugetlb gigantic page: >=20 > page dumped because: VM_BUG_ON_PAGE(1 && PageCompound(page)) > ------------[ cut here ]------------ > kernel BUG at include/linux/page-flags.h:500! > Call Trace will differ depending on whether hugetlb page is created > at boot time or run time. >=20 > Make sure to __ClearPageReserved BEFORE __SetPageHead. >=20 > Reported-by: Aneesh Kumar K.V > Fixes: 2b21624fc232 ("hugetlb: freeze allocated pages before creating = hugetlb pages") > Signed-off-by: Mike Kravetz Acked-by: Muchun Song Thanks.