From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EFD0C4332F for ; Sun, 20 Nov 2022 04:11:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229524AbiKTEEQ (ORCPT ); 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 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.