Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1407500rwb; Fri, 18 Nov 2022 18:30:55 -0800 (PST) X-Google-Smtp-Source: AA0mqf73yyJT2scyomzFrVn7/53KFu67VCd+3ydKfROoAL/ZRj3iQXEOhEw0Zi7ZZbSKx3F++6qg X-Received: by 2002:a17:902:76c1:b0:188:f461:8014 with SMTP id j1-20020a17090276c100b00188f4618014mr2330728plt.66.1668825055108; Fri, 18 Nov 2022 18:30:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668825055; cv=none; d=google.com; s=arc-20160816; b=wNcGlDe4COw99FFzaFmR7CWga+lhxED5qPApa0kKwK44whQUfdX5w6qJ5E2697gH+D nUFN9fhybRisnUOKMHCttrQYZpyZZGKokxtNIlYCEArAa0YMg3F6GDt11qTBxY+pd/Ol Dey8qfZxdIZRFWS0VkBgpVU2qVcythmEQQpIbY0tocDFqP5JlTf0wVCQTJ9xE7c9Ohc8 JRQx5WajzxUEcJK558+5jyxSR/MNtfR8Itr7OBLYarpRBRH1kqgARMxTqQPaQgFZOev+ 5PG75LAnm/hGW1q73C8MSvZwE9ZST7hrWpQ9V21tSxYzMVz0CCy3ZbXckrFnY7SpVcUu +4vQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=9YrkIm6H9xSZVgYcasrAhd6IxeyZOq0QoGG9Swu0J2c=; b=SbbTgVYNim7xN1nkoJI7S6rjKHF09YeVdrfJjMrEAm2fmqH7v1eXtv5MTR+xMfh/nV O3nmYoOdvnjkEpbD1KMmWnUYGZwK3qOsvwFl6VGZiXB5RyS4dzxJ7aBxTXDIF0G+jv9b OJX4OFbG8DKMbpGCcp7PCsezPqMuU/Yr1SO359xJoujv4qoplTTwaFtT0GCmssvBZTTe 89Z1r/TrE3pR7n1v6UHhdITGddwCHbJ3Ki9i/zBkCW0mVw7o5v+8N6XncMKUlIJipWBG Gz+ZtJBDdPCBYnknCqsI5zs8KuCSUvVOItR3GwxX0MA/W8EcjjyqOk41nbwmiM5NeWYH jQmw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id lw6-20020a17090b180600b0020d65f31df8si10765441pjb.143.2022.11.18.18.30.44; Fri, 18 Nov 2022 18:30:55 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229824AbiKSCGQ (ORCPT + 90 others); Fri, 18 Nov 2022 21:06:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232536AbiKSCF4 (ORCPT ); Fri, 18 Nov 2022 21:05:56 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 183B225F5 for ; Fri, 18 Nov 2022 18:05:20 -0800 (PST) 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 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,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 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