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 BBFDEC4332F for ; Sat, 19 Nov 2022 02:05:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3C2FF8E0001; Fri, 18 Nov 2022 21:05:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 373186B0075; Fri, 18 Nov 2022 21:05:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 23A408E0001; Fri, 18 Nov 2022 21:05:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 1476B6B0074 for ; Fri, 18 Nov 2022 21:05:25 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id DCC33A0247 for ; Sat, 19 Nov 2022 02:05:24 +0000 (UTC) X-FDA: 80148549768.08.37277E9 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf18.hostedemail.com (Postfix) with ESMTP id 181CF1C0003 for ; Sat, 19 Nov 2022 02:05:22 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NDcRG5DyfzHvx0; Sat, 19 Nov 2022 10:04:42 +0800 (CST) Received: from [10.174.151.185] (10.174.151.185) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Sat, 19 Nov 2022 10:05:15 +0800 Subject: Re: [PATCH] hugetlb: Fix __prep_compound_gigantic_page page flag setting To: Mike Kravetz , , CC: Muchun Song , Joao Martins , Matthew Wilcox , Michal Hocko , Peter Xu , Oscar Salvador , Naoya Horiguchi , Vlastimil Babka , Sidhartha Kumar , "Aneesh Kumar K . V" , Andrew Morton References: <20221118195249.178319-1-mike.kravetz@oracle.com> From: Miaohe Lin Message-ID: <5877406c-62bb-8330-e8dc-a5d78c6ab15a@huawei.com> Date: Sat, 19 Nov 2022 10:05:14 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20221118195249.178319-1-mike.kravetz@oracle.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.151.185] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668823524; a=rsa-sha256; cv=none; b=uz6M0aM6ehBR5NbByN9FjRkQbMqHRKgTMy1E/NWybFcqdpVgPQnAG5FkJGb9rgOJJ7uKMy Z6f6oOfSfc9tSuDStBwte0ZPoFj5cb8cAfbsO3SZJAgIn95aRX2zqfF83mdLxJduDsETi8 eK9sNIbJfpx8rTew0NULEoSieculDd4= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf18.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668823524; 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; bh=9YrkIm6H9xSZVgYcasrAhd6IxeyZOq0QoGG9Swu0J2c=; b=KE9YIEjyeln/6xUwbjRPJEV6cu6O7uR61usOhfwknEQkA3aWGkbPq43odSV8Tuaz2dxppL slFN+jSynqXZxE9eoAOeF4aaInmRk9i+zfxSC7f/hLyElvG5oQdtpijMI81xX8UbwJldOS X/aSkQPDayziF7unjPbN5VYiLm3uDoM= X-Stat-Signature: bzx6fxf9xqbcrg4c1giwpsdmx8pa5ix4 X-Rspamd-Queue-Id: 181CF1C0003 Authentication-Results: imf18.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf18.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Rspam-User: X-Rspamd-Server: rspam12 X-HE-Tag: 1668823522-165636 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 2022/11/19 3:52, Mike Kravetz wrote: > 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: > > 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. > > Make sure to __ClearPageReserved BEFORE __SetPageHead. > > Reported-by: Aneesh Kumar K.V > Fixes: 2b21624fc232 ("hugetlb: freeze allocated pages before creating hugetlb pages") > Signed-off-by: Mike Kravetz Yes, PG_reserved is PF_NO_COMPOUND policy. Thanks for fixing this. Reviewed-by: Miaohe Lin Thanks, Miaohe Lin