Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1317579rwb; Wed, 7 Dec 2022 11:17:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf6+PyII20GAsr0QWLbGIk1p3c0breVxCtUQjw4x4MQchdkqMCgNPth05SrTSAgdKyvwSD6R X-Received: by 2002:a63:417:0:b0:478:6f31:d40c with SMTP id 23-20020a630417000000b004786f31d40cmr28686634pge.16.1670440671144; Wed, 07 Dec 2022 11:17:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1670440671; cv=pass; d=google.com; s=arc-20160816; b=c7NAQRIJfZdivIwpXKYbgvZ0omAUNglbFCDvnX5YREvse8N6bEbbdvMxaTr7sl4enG xNTMtknl+w4mo6kxVG3r68fshR4Hf+Hy0jHieWIZMumSUXD7MgBFxFLBxznM8osIbYLT vA2tco8DTMZWPc3y8LvncDNNjtNHkTjespho+KTYXladEUn6VS3d//6HRXV0qyS3Q0i+ VIToaGg65XHeF+mLANUBRU5xdNDR/KALkP4uAKwQK7nzbJB2NmoVaHU66E4hE4+mIbON Zaoe9BUL46Ou2SQdV1jxLeMkjzJpLPd8oH9uuNBkgQkoirGRp7mOU3LIgVEVEx0r0lya JHmg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature:dkim-signature; bh=9Bno0cJYWBwIkLXpNnDWGShTTpdjdj0xd00yD2LLOMQ=; b=Pwwmltb2udCcJM4doRjHrXxKfPHNRaRBZ41Sijg2W/cjc/H4IhV6Eq+NOypJLvhP7U mRCCtup+lvqIyC+mLZwqioEgyrPVkUM8p/L/iwdItm5XLIdoZHDdcg6sG77ypE4MsenY f8q7pBdxYWw8S8SbiuPBNSofDfBIvzqm7aFWY/YdHYCttm+N/sBLBg9sgYM7Uaj0tBrx lpM2hfNs6EbAYfG+dNC+DVN+Z6E6ovyEbAdfoEa6yXU/WQIHxyvMjfY9fkvQtSGoxwPW s1nJdKYGl1EaGHsDs63+/yzW9c2Gtwo2w6Ig33WwmZz46h6YcyDYfJqdzTgVn+qXUEky akiQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=G4ALFs7B; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=y5udZbtb; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s22-20020a056a00195600b00572dc2ed1f7si23167208pfk.191.2022.12.07.11.17.41; Wed, 07 Dec 2022 11:17:51 -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=@oracle.com header.s=corp-2022-7-12 header.b=G4ALFs7B; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=y5udZbtb; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.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=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229680AbiLGSt6 (ORCPT + 74 others); Wed, 7 Dec 2022 13:49:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229545AbiLGStz (ORCPT ); Wed, 7 Dec 2022 13:49:55 -0500 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1CD668C48 for ; Wed, 7 Dec 2022 10:49:53 -0800 (PST) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2B7GDven010253; Wed, 7 Dec 2022 18:49:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2022-7-12; bh=9Bno0cJYWBwIkLXpNnDWGShTTpdjdj0xd00yD2LLOMQ=; b=G4ALFs7BGXutAOBdWafs1B21Vqo/jco28Y9NAI71Gvu5oFotoOAPbEEupbC3Bi+ZDN70 cE6X2FOyIKVp2JerEhQ6DUPrTAEFwxtaUmOhv5WI33q06yMPBkMLdKBN7OxKW+MVVzcU F3Ng65kPsC6tb50vw3+1KKm3ai1y2gIInbNZzzRlKklEgGKtn8zc2ElHbhExJ1Be7hEZ KZTlbsqkSVr1QUv6hXx4D1p7nQosMTXdGent06N7klq7d3qs/oqv8ORp83UgNLw0O4Ug 168YOpbRUtEHzp7yv5nSBbx966LzH00whySbgOMpFS9jlqKM9rzttgMvL0xSavhovU5+ uw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3maudus2xr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 07 Dec 2022 18:49:29 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2B7HMVH0002304; Wed, 7 Dec 2022 18:49:28 GMT Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2169.outbound.protection.outlook.com [104.47.59.169]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3maa7cqvac-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 07 Dec 2022 18:49:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nRXjsMlw7SjpotbBmXuvbxKUo3K56LoA42aAOpY1ww2UKeQkReddwzjSPTWOKkgfkFfbxo4oeTIyjPiQSlBG1akHN1jU5GswAd8l/1nyoJQmLOVzGXoF3gZ4DsuYR29nJf4ckhcnHaIiGfGPbgUDi0/lyGu5ajEzqJSmE2da81Yi5yOsEr7K+7YkI2BuaO1wFzXBnJisDq2n7cOkfuNDuV4B3G6Lf/dYKhy4IRtdExOBH2GeOdwjKJVA5x51pWcce3PK5GZ19a4Q5tOEp0ea496XwNwo9hOy5DFr5MUPbmwHdR3wtNGX4gOPW7iTwkvlR/cEfKafTogA7iPwxed7kA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9Bno0cJYWBwIkLXpNnDWGShTTpdjdj0xd00yD2LLOMQ=; b=EsrdxSGjxjEgQKaIFnzRirXSKaACWUxgaAELYWFI6FQYMJ41M9TD6zt+FE/n8TgghgBFRZAlGHtZciq5tQdNlB6kwK9Gasz3+YcsXhx9rICAfyMNquOrB3QnPPtypQAZ2DEinolV5na7taLV1YjUKGVwmQJCNG1IiIbPLVRtaqOCAWQkWdNB0A0EM+pqk93l7TRsNRypYBBTMlo9PLchNmnqiWvhpIFqP1NraL542WOzUm2QC6Yf+qWY6A+PycecAGlje46TkqmitJhQ0VnBJ2pwSbopMV7A759J0d9AyAHWrqlt1HcxntIgLekDo7LJgY54dB2ViRSgMs9Mk/uLzg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9Bno0cJYWBwIkLXpNnDWGShTTpdjdj0xd00yD2LLOMQ=; b=y5udZbtbPTmHQR8GeN214lUqz5jgM73lMroCdauVuLBEUyOllQvnayiYNwpBd47M3yce18WfupQu/DWabfUDQ+sMxN6ppbi29GxFagLCfo8qV5mTj7qoJWcJWE4q6B2quuQv84nlEjoDmVSHlaST2c/yPpaCIkl61HFV54Nz13o= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by IA1PR10MB7334.namprd10.prod.outlook.com (2603:10b6:208:3fc::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Wed, 7 Dec 2022 18:49:26 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::51be:1301:5ec3:996f]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::51be:1301:5ec3:996f%5]) with mapi id 15.20.5880.014; Wed, 7 Dec 2022 18:49:26 +0000 Message-ID: Date: Wed, 7 Dec 2022 10:49:21 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH mm-unstable v5 01/10] mm: add folio dtor and order setter functions Content-Language: en-US To: Mike Kravetz , Muchun Song Cc: linux-kernel@vger.kernel.org, Linux Memory Management List , Andrew Morton , Muchun Song , Matthew Wilcox , Mina Almasry , Miaohe Lin , hughd@google.com, tsahu@linux.ibm.com, jhubbard@nvidia.com, David Hildenbrand References: <20221129225039.82257-1-sidhartha.kumar@oracle.com> <20221129225039.82257-2-sidhartha.kumar@oracle.com> <4161AF1A-9508-4DF8-B756-FEB476EB32B5@linux.dev> From: Sidhartha Kumar In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BYAPR02CA0061.namprd02.prod.outlook.com (2603:10b6:a03:54::38) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|IA1PR10MB7334:EE_ X-MS-Office365-Filtering-Correlation-Id: ebfb9738-28d5-4c86-21bd-08dad883c3e7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: yPXJrSXcA6fzMx5enADQ0ME/udz/iKmRp3I5/T+Niiw8lfoojrUjARKjUDaYDhBznoGWecq9GqcEqvWLCljz5Z3Flngew/hPbJ99xFQ5Blh4acaQHwPGPa64C83xWL09BogXyrGnCiu473O3U9e+z3s3LS0MTIZFgc52zD+2/yfwJ9xK3M3sesQ/BFLvLzgxyo8wW54Wg4cnkEVtnyitD0pOFwALOyMV4+oRh6avRBDlIYZgEm5mv7L0S5WyKltP0gW3RD1EYwg20csw7tJi7ynZ9RbLM90izoAuECWSFSwqbwjPNM+wqlaM9I96mnt792NqogRfawz942hytrlbhKNFlMNhS6d48Ic+6XNdwAZH5ix5dUSYDyY+xIDbLxpjAC0h/3KQLcHgHwlKV/z7raNOroeEBVSFpkoD88LzZmldEudixguEgVgJGoI0iF4v2U6Ri9WfquG7/QZrkdy8+m7P5FHSgyHqb2UHOcPQaGD01f3gwg1f4VQWh4U6sxQclux/NzC0r4Dmc77oEFHJAsD5WquXrMZX41j+WY4XeEgItsIyvCBFp/JL9tBBx2fvDRs2C6VZvNzYeZcyq7RT5hK1b0GVlOFleFxb0pt52UvD/h++uvhDENFIihmgdTBddB359HaqkeoIQwkMfyPkq3qkfIcucG2QZpN/Gf9sdXwhzvcufvNVd+oWVW4Q2TFa0iconOG0lnyWn3GsS4aAm7sg1NuNqOgibiV5JcZedCU= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(346002)(376002)(136003)(366004)(39860400002)(396003)(451199015)(478600001)(6486002)(6666004)(186003)(66946007)(6506007)(86362001)(31696002)(110136005)(53546011)(316002)(6512007)(66556008)(54906003)(41300700001)(66476007)(4326008)(8676002)(38100700002)(2616005)(2906002)(31686004)(44832011)(83380400001)(36756003)(8936002)(5660300002)(7416002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?T0pJY2JGTmt1MVNzSkpQVmY2dUpNM0pOWFE5Q1gyaHJwMFgyZkc2Y0FseEg4?= =?utf-8?B?YzFXbVd4YlpFbWJEQjJ0N2FPZnBQVm51VW4zVythWmFWUmNzaWd4RHZ3R1A4?= =?utf-8?B?bjFGbU55emtiL0MzdXlyZ3hjV1BpWnJSMGRxbUh2bU1DYnBSWkZmQ2FONnFa?= =?utf-8?B?RUN5V0hwc3JVZlhyZzc1YnlCcUp2YjNFVnhMN3lPSWJxN2hFWWltR21WQ0Z6?= =?utf-8?B?TVY1UW1FeHBVTDhzNHA4OE5pZ1doOU1kdjhCZExsc0Z2cFloMzVzVy9GSDAz?= =?utf-8?B?dWhMTVlYdXlzaU9jWW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WURJ?= =?utf-8?B?U2F5ZWZrai9yODNaVVEwUFdxcm1YZzZjcnBXc0lHWFVBcVVTQy9abnBySEpC?= =?utf-8?B?b0lHMGZjWXh3WHVGNFVxTFBnWjlUeGpxbEx6VVVOVVNkY0pYZUNRekhVbm9V?= =?utf-8?B?MmZUMHBDb0ZyM3dtSndTZlB1UWR3PT0=?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ebfb9738-28d5-4c86-21bd-08dad883c3e7 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2022 18:49:26.6616 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Gg5YlOeYTmJMpcmCGKLudp0Bk+MbCIGAdX9Gh1Em5pVHI8vM79026TanCGfEpJz4pOQVbK+ewNFy7OmonoQNZzZclSueYEvVYhfhOUCHNEQ= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB7334 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-07_09,2022-12-07_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 bulkscore=0 suspectscore=0 phishscore=0 malwarescore=0 spamscore=0 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2212070158 X-Proofpoint-ORIG-GUID: ONURiwlv8fA4BdHWLOVzlM3dQZORuZkn X-Proofpoint-GUID: ONURiwlv8fA4BdHWLOVzlM3dQZORuZkn X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 12/7/22 10:12 AM, Mike Kravetz wrote: > On 12/07/22 12:11, Muchun Song wrote: >> >> >>> On Dec 7, 2022, at 11:42, Mike Kravetz wrote: >>> >>> On 12/07/22 11:34, Muchun Song wrote: >>>> >>>> >>>>> On Nov 30, 2022, at 06:50, Sidhartha Kumar wrote: >>>>> >>>>> Add folio equivalents for set_compound_order() and set_compound_page_dtor(). >>>>> >>>>> Also remove extra new-lines introduced by mm/hugetlb: convert >>>>> move_hugetlb_state() to folios and mm/hugetlb_cgroup: convert >>>>> hugetlb_cgroup_uncharge_page() to folios. >>>>> >>>>> Suggested-by: Mike Kravetz >>>>> Suggested-by: Muchun Song >>>>> Signed-off-by: Sidhartha Kumar >>>>> --- >>>>> include/linux/mm.h | 16 ++++++++++++++++ >>>>> mm/hugetlb.c | 4 +--- >>>>> 2 files changed, 17 insertions(+), 3 deletions(-) >>>>> >>>>> diff --git a/include/linux/mm.h b/include/linux/mm.h >>>>> index a48c5ad16a5e..2bdef8a5298a 100644 >>>>> --- a/include/linux/mm.h >>>>> +++ b/include/linux/mm.h >>>>> @@ -972,6 +972,13 @@ static inline void set_compound_page_dtor(struct page *page, >>>>> page[1].compound_dtor = compound_dtor; >>>>> } >>>>> >>>>> +static inline void folio_set_compound_dtor(struct folio *folio, >>>>> + enum compound_dtor_id compound_dtor) >>>>> +{ >>>>> + VM_BUG_ON_FOLIO(compound_dtor >= NR_COMPOUND_DTORS, folio); >>>>> + folio->_folio_dtor = compound_dtor; >>>>> +} >>>>> + >>>>> void destroy_large_folio(struct folio *folio); >>>>> >>>>> static inline int head_compound_pincount(struct page *head) >>>>> @@ -987,6 +994,15 @@ static inline void set_compound_order(struct page *page, unsigned int order) >>>>> #endif >>>>> } >>>>> >>>>> +static inline void folio_set_compound_order(struct folio *folio, >>>>> + unsigned int order) >>>>> +{ >>>>> + folio->_folio_order = order; >>>>> +#ifdef CONFIG_64BIT >>>>> + folio->_folio_nr_pages = order ? 1U << order : 0; >>>> >>>> It seems that you think the user could pass 0 to order. However, >>>> ->_folio_nr_pages and ->_folio_order fields are invalid for order-0 pages. >>>> You should not touch it. So this should be: >>>> >>>> static inline void folio_set_compound_order(struct folio *folio, >>>> unsigned int order) >>>> { >>>> if (!folio_test_large(folio)) >>>> return; >>>> >>>> folio->_folio_order = order; >>>> #ifdef CONFIG_64BIT >>>> folio->_folio_nr_pages = 1U << order; >>>> #endif >>>> } >>> >>> I believe this was changed to accommodate the code in >>> __destroy_compound_gigantic_page(). It is used in a subsequent patch. >>> Here is the v6.0 version of the routine. >> >> Thanks for your clarification. >> >>> >>> static void __destroy_compound_gigantic_page(struct page *page, >>> unsigned int order, bool demote) >>> { >>> int i; >>> int nr_pages = 1 << order; >>> struct page *p = page + 1; >>> >>> atomic_set(compound_mapcount_ptr(page), 0); >>> atomic_set(compound_pincount_ptr(page), 0); >>> >>> for (i = 1; i < nr_pages; i++, p = mem_map_next(p, page, i)) { >>> p->mapping = NULL; >>> clear_compound_head(p); >>> if (!demote) >>> set_page_refcounted(p); >>> } >>> >>> set_compound_order(page, 0); >>> #ifdef CONFIG_64BIT >>> page[1].compound_nr = 0; >>> #endif >>> __ClearPageHead(page); >>> } >>> >>> >>> Might have been better to change this set_compound_order call to >>> folio_set_compound_order in this patch. >>> >> >> Agree. It has confused me a lot. I suggest changing the code to the >> followings. The folio_test_large() check is still to avoid unexpected >> users for OOB. >> >> static inline void folio_set_compound_order(struct folio *folio, >> unsigned int order) >> { >> VM_BUG_ON_FOLIO(!folio_test_large(folio), folio); >> // or >> // if (!folio_test_large(folio)) >> // return; >> >> folio->_folio_order = order; >> #ifdef CONFIG_64BIT >> folio->_folio_nr_pages = order ? 1U << order : 0; >> #endif >> } > > I think the VM_BUG_ON_FOLIO is appropriate as it would at least flag > data corruption. > As Mike pointed out, my intention with supporting the 0 case was to cleanup the __destroy_compound_gigantic_page code by moving the ifdef CONFIG_64BIT lines to folio_set_compound_order(). I'll add the VM_BUG_ON_FOLIO line as well as a comment to make it clear it is not normally supported. > Thinking about this some more, it seems that hugetlb is the only caller > that abuses folio_set_compound_order (and previously set_compound_order) > by passing in a zero order. Since it is unlikely that anyone knows of > this abuse, it might be good to add a comment to the routine to note > why it handles the zero case. This might help prevent changes which > would potentially break hugetlb. +/* + * _folio_nr_pages and _folio_order are invalid for + * order-zero pages. An exception is hugetlb, which passes + * in a zero order in __destroy_compound_gigantic_page(). + */ static inline void folio_set_compound_order(struct folio *folio, unsigned int order) { + VM_BUG_ON_FOLIO(!folio_test_large(folio), folio); + folio->_folio_order = order; #ifdef CONFIG_64BIT folio->_folio_nr_pages = order ? 1U << order : 0; Does this comment work?