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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F471C4332F for ; Sun, 20 Nov 2022 04:04:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 216746B0072; Sat, 19 Nov 2022 23:04:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1C6CC6B0073; Sat, 19 Nov 2022 23:04:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 08F7F6B0074; Sat, 19 Nov 2022 23:04:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id EE1316B0072 for ; Sat, 19 Nov 2022 23:04:13 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id BBF6CAAB35 for ; Sun, 20 Nov 2022 04:04:13 +0000 (UTC) X-FDA: 80152477986.29.3C93A45 Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) by imf02.hostedemail.com (Postfix) with ESMTP id 24A8780006 for ; Sun, 20 Nov 2022 04:04:11 +0000 (UTC) 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668917052; a=rsa-sha256; cv=none; b=UPN371fnRYrC/PQYe3wA+fuocylEcDR+aO5IDTrcM9kkx/MSP6H+mZKZvt8xuNypSbNIZE VWsCMaF9zWuFiKCCRN1vx5W2I3vE3LAV5qMaZHpQ+0eO+/qTXg/HFSYZP7xXJ3L+16hNvn 2KxUZmJgN16XA91tgCJemTJmISu2+O4= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=g3Evtgww; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf02.hostedemail.com: domain of muchun.song@linux.dev designates 94.23.1.103 as permitted sender) smtp.mailfrom=muchun.song@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668917052; h=from:from:sender: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:dkim-signature; bh=HDxWdGiElBsqX8waqP46DZtvp4qVUO5EP4TRxvBLmaY=; b=IvjHNLk8llqwtrLJgBjWmj4g2NKJ+dpPBzmpN0D88qtWjVz3/0Dgp8vwwq4Gcaq6p5oWEE r00ejtRvv2tcTFQIBs3Y2c/hla6bdpqwbkb5yz76XBkHiVdAArAZLQ6Z0zvgoVrLrsuMyq YxT9pQzg/dv7blxRk/XdDSsaLC7l0rc= X-Stat-Signature: ooxfwfm5o6zad3wpbdspgfkpe4ka49a8 X-Rspamd-Queue-Id: 24A8780006 Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=g3Evtgww; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf02.hostedemail.com: domain of muchun.song@linux.dev designates 94.23.1.103 as permitted sender) smtp.mailfrom=muchun.song@linux.dev X-Rspam-User: X-Rspamd-Server: rspam12 X-HE-Tag: 1668917051-655658 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: > 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.