Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4468071rwb; Mon, 21 Nov 2022 07:58:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Bz9l5U4/Y3EIKMoWi3LFOe9qpOnc+4kMwMgSBysQ2KEppWejQ9NILHr6NuoMIBh4E0Zkj X-Received: by 2002:a17:906:cd07:b0:781:f37a:f50e with SMTP id oz7-20020a170906cd0700b00781f37af50emr15762715ejb.468.1669046321130; Mon, 21 Nov 2022 07:58:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1669046321; cv=pass; d=google.com; s=arc-20160816; b=KClBxF75S/rMzD2rj7N/Jz+OzlfT0tMVNJ8jbXAG/VJ7JTqReLgqqHdCIYXSR6AvD3 H07/v++9fqYW3SH3w0ne7vIV6vv29n5x4Wn+gvLxHnDgF/WVhvd6M/JqJKEOH3zPZiUw fHTVk9onjDvrUyqju5QxwX637xH0Oi332LQ4+b9Z6QW/7kzhgujAh8nE1Jh0PsWZrHkG 84VFT7pDrrosDjnyGd7cshiJ5MqNBWruEPh7x9WKSV5Xna9wpzsoCvShCLejYZ1c2CMe MnYSLYJBr0XMPEyM+N8uhf/5Tef/mGKFuqAwk7dY9bFkSXYix8te8uxid/+SfIjeF8nq AaQg== 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:content-language:references:cc:to:subject :user-agent:date:message-id:dkim-signature:dkim-signature; bh=+SRD4lD9uKPkeelSxvKG9p9kOUbVe6YiEXNNCW+pVgw=; b=BddumfSikrN5HwwTGwrR2NiL5HAf5OtomnvxBkt1ipZu1YmKasqyFDWgRCRosUIGwo RwdwDvBjpLQjuyAN2tX7ZhPT12vgmFl/DXzeXZ7evD0aaTgLtFSJCT1kns1rhXPqLVZt pIGllG/LNQjE/xreyUvxJxPWUfmuVN2m66AXlRJvL4zFLfyqPSC4n7+TSLu3C6b8JVFq VAKKusbWNISdI4JCQLH6opLOepgaeXXLTgHwVmUcaJqhLYnvHd+MGkaClQy8A27/IP+2 HW9cu5g5Bvsrh8fBdUHHPBePgJZK/EjByFQfswDL0NLDyljVQcxYj0w5+FoZZFpHzpwn jaHA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2022-7-12 header.b=b8NNmbn2; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=xe6sD+aW; 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 gn19-20020a1709070d1300b007313312730esi3927035ejc.85.2022.11.21.07.58.18; Mon, 21 Nov 2022 07:58:41 -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=b8NNmbn2; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=xe6sD+aW; 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 S231951AbiKUPsG (ORCPT + 91 others); Mon, 21 Nov 2022 10:48:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50828 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231691AbiKUPre (ORCPT ); Mon, 21 Nov 2022 10:47:34 -0500 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0994BCEB89 for ; Mon, 21 Nov 2022 07:47:18 -0800 (PST) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2ALFaStM030862; Mon, 21 Nov 2022 15:46:52 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=+SRD4lD9uKPkeelSxvKG9p9kOUbVe6YiEXNNCW+pVgw=; b=b8NNmbn2sLFeUiYNVMzSa/7SWYqsXmXm6yh267ocyst1/3jQQSj1zv3PkWJHXH4jvSnD Tr6gGruVIAckkAm+EMcvpZEWPFNCHqhxbS2iFVkcTn3G8wwppuLGx7zpoAwh1vhB2aBe +KeSL4w33mwP2cDLM/c7DSjPZibrITAOxK7zNV7iKWRJFJ0WfOGj7jtuZ4DEnSRBYGE7 JklP3J9ba3cQ5+EUZPN0NYr1OIJgh9+gB13FiHWnDO7IIZkS9WLaw+dRIwQ36TyORuyr f2tKGMhBw5qEz2JRLtJ5rcXLsZ7L35HjAT59J1ghC1P/QL7B0VAms2pYzDr9nNLg25M0 zQ== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3kxr99n17c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 21 Nov 2022 15:46:46 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 2ALFVZDR038843; Mon, 21 Nov 2022 15:46:09 GMT Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam02lp2046.outbound.protection.outlook.com [104.47.51.46]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3kxnk3vkum-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 21 Nov 2022 15:46:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kEMv0pbklsVs1Zn6APTllJjyVNSmuJB7aesPGYuDpOyrvSmDDzFXnm8nHDWxXFJ6lDPeU5IJNsS2waBe//Ql0nWt99WrPinYunPErjSNXguSjGwSQrj7K+42gPNvJETdqR1RBYbk7dhDddDcjIJHffaQmQw0SZ9IVjatRrp3HgSWQV24yLhPNwi3/nr9EukEAtyT3ptaIfBrbpCBjaMd7k9zTagEEyqb4/C8zaxPSZF3PpA8u6xZcMeJTcDtj+ngg/MkCzEXSPRNZaybVu7/4J1E4tGyX93buLz+OYkc3LSYR6McdKMhimyBCjFRv35afL+2+DZm0d3S3Z/0uM6oZg== 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=+SRD4lD9uKPkeelSxvKG9p9kOUbVe6YiEXNNCW+pVgw=; b=SP4jw4oWShPXm6GT/8OvT+Rt5BePaA6gbVal03LbahcRF/r4z5ROA/arygh5ajOZRKq6aOX64l6z7kzq9TQeyg5Ea9aDcC9sEt+tkoH5jhnnhd2czi2aWKkI2dWa+hzGBTbsYwYkS5wg+5CFfjhDnlnhlf8HAEObwnuz82X7SH9uZ+xL00MSSb5KSJ7c/ZAllm/yrQWRmsa3znto7JW/fyzPP8QW0xheH5U30OpCOU4AMM/fhXIhLR6otnCfENXf5vcTYA3DMazVIlYo4SNnjmkQKjlSZtRm2E/wB70wGpTvZG2/ODser1GDy4FHgglrbxjb4SA6hfHINOQagvngMw== 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=+SRD4lD9uKPkeelSxvKG9p9kOUbVe6YiEXNNCW+pVgw=; b=xe6sD+aWprxPLhiCUf8oIEu+KS/GJT4h1+1CcGBTa2dNJOXmIMamiv27t6446/8zCu+bEisgyYgIfetJNl/6+/rydSGimH2ymdw+QXSkBjuXzMBdJCeVewy7i9lWx+sid9WxTskaZblbjvqOkBr3DsZ7q+aVvcELw4H4Ff9Gr50= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by DM4PR10MB6182.namprd10.prod.outlook.com (2603:10b6:8:89::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5834.15; Mon, 21 Nov 2022 15:46:07 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::3702:7db0:8917:9954]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::3702:7db0:8917:9954%6]) with mapi id 15.20.5834.015; Mon, 21 Nov 2022 15:46:07 +0000 Message-ID: <03ca2e41-28d3-c546-4347-5dee7b7dca9b@oracle.com> Date: Mon, 21 Nov 2022 07:46:03 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: [PATCH mm-unstable v4 10/10] mm/hugetlb: change hugetlb allocation functions to return a folio To: John Hubbard , linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, songmuchun@bytedance.com, mike.kravetz@oracle.com, willy@infradead.org, almasrymina@google.com, linmiaohe@huawei.com, hughd@google.com References: <20221118222002.82588-1-sidhartha.kumar@oracle.com> <20221118222002.82588-11-sidhartha.kumar@oracle.com> <380a57f3-d705-aedd-a0dd-6dab8b9f8e1d@nvidia.com> Content-Language: en-US From: Sidhartha Kumar In-Reply-To: <380a57f3-d705-aedd-a0dd-6dab8b9f8e1d@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: CH2PR12CA0010.namprd12.prod.outlook.com (2603:10b6:610:57::20) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|DM4PR10MB6182:EE_ X-MS-Office365-Filtering-Correlation-Id: 8486c9ea-dc21-4d52-72c9-08dacbd78017 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Byy82zlI5ZNzAiH9k8ZRVSNDCKkNW3E3Xfs3uI4um3JjQZHGnpOohA2wUKtDTxXeJf/U9pPJfCIbJ3Hp12smudR0U5+L93BGj+BBGm1D7cKu1esl3V5zkOxvQRr/pwDYTagMJHB3XPNa8qLiAA4rX35hkpzmuNflGfMQ1rJQNgHed/IG5qW834X73LltveLadmmQlsBQyrn92RZ1Yk9ONnozLKt7Zlns+SCsSchxjuJgOGyk50bf9+bxqZmy7WOdHwd9fyGz1rdPy/Nm8vRUMt7MNtVzSeNH7OZu8U4K92JS03G6A9uZEyR4rzluDApUoMqfCQqgVaoZd95GnJpBdxIsJ80C/vEOhbcx+dp3N9QUJjfr0s+8mKl4Ly15r4XZEkO454p1impvkT4Y4T5gDsdNX3qrGLxQ90kDJCj9I+MIsmemyGOzPHEPFXh38u0ki6hUNlqzVsS2JgFQ+1AElBQeG4oaZK2xBS8P/HfenQ9uksbIoqSHZhs6b2wsaeBYDCNnA9mryv1h2GRDgtlQYeCLwzncMfZQUd926Mf/gsBxLWn6Un9RrYTEygwtEbI+Ls4J4wYi7wjWS97TS5aceF9i/45JyguaughkHcWUovqPWhhoNBHBLpnAh5mvfMP0QvrQSsLEJHVLgtQvVWZGqOo4VTh61GKjZdIotf5fPy6iKtBIst4BtMzOVlShcieynGA49oYjHVx5jcNGvxK8Fr8MeV3O9nB3UjtK9pWSly0= 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)(396003)(376002)(39860400002)(136003)(346002)(366004)(451199015)(26005)(38100700002)(86362001)(31696002)(6506007)(478600001)(53546011)(6666004)(5660300002)(8936002)(6486002)(8676002)(4326008)(66946007)(66556008)(316002)(41300700001)(66476007)(186003)(44832011)(2906002)(2616005)(83380400001)(6512007)(31686004)(36756003)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?bEpwV3c2Ulg4bEIvZXdNcGkzQjJ6TGQwcGp0MGlOZys3T3NmZUhKdEhFY0FZ?= =?utf-8?B?VXdybiszU2tWYi9GU2c1ZTNpMFRsZjRGMjJRVTd5R3NxSXdpMUlNUU5KYk9i?= =?utf-8?B?blRNUmNpNTN4blVLellTVVpFWWMzQlJqd2EzbzlDbUZuZVg0UTUyRVVybUNX?= =?utf-8?B?MFNhd3FrVmNBOXp2YWdrbjN6WktualBwNU1rYmhJNkhtUUZEdGM5VjVlL2V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-8?B?TWplZWwvU0VUN1N1WmJ1eUNnalQ1b3U3Z2cvVmpBTDR3amErcG9jMFNiSCt1?= =?utf-8?B?eWFkQXM5SnFucko0cWp1WC9zbnM5U3Jyd3lpRnF3RHNXeWVpVjUyQ3lKS2xZ?= =?utf-8?B?V1JMRTYyQmNJN1ZWcmNyQXd0ME5FZWhEVC9CQSs5VTNhODVXa1hJQWo4NlRK?= =?utf-8?B?UHRTUFlNNjQ4TThQOWxlc1g1WFQ3bHpWSzMxQ29ObjFMT0Z6bWgvUFBNVHB0?= =?utf-8?B?a0FRYitrclBLM1E2WVBNUWZXT1lUUGJ1MzAzdjZob0t6Sk5GQ0ZRYitWdzYw?= =?utf-8?B?MERqd081bU1NS1M1N0FCQnZrT2RkL0xqcmR0UTRvT05vQUhFcVZWMzhIVzhS?= =?utf-8?B?bWtLbEcwTGtHUDdKdzlxTms5Y2xtV1RCS3U0M1Vqa2liWTNobGdLRnJ5ZGpm?= =?utf-8?B?VXl0VlFncXU3b0U1Mkt4bUdnMDUwdUs1Vm0rRVR0ZHdIREVuTkhBekhIbmd3?= =?utf-8?B?cmhmTzFjOCthbUZKMFVmbmVucHRBVDE4UHo1T2tucEQwVEZabUZMNWhFOXRG?= =?utf-8?B?dkdDcU5NSFRZQjVCaE9McjMzaGRYd2N4U3E0NGdiWHRCZk5RbnRpNjlKYmR3?= =?utf-8?B?QzEzWUc5YzZYcmdJRzdwb1RldlZkcXcwOEg5UFhmSzVaaGJYNnY5V1JvcE9P?= =?utf-8?B?M2FPUER2TzVBOHk2V25QZ2pHMUEraDBFa25CVzJCNnpVbm1EN1hzYWNCOWhu?= =?utf-8?Q?eiXCo0TeMw0Wva8nrc0Vki9NAadGu5gw=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8486c9ea-dc21-4d52-72c9-08dacbd78017 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Nov 2022 15:46:07.7044 (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: 4OIK0da3hmQanhYoWvsDGeDdRImEHySMzDHRdbEociQDgqkzn2QCpOhf6qGNC/m+dqDm36rDTMCbYc6Lg+lVuSlUMthJxylT/re/lmuqsDE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR10MB6182 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-21_14,2022-11-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 mlxscore=0 suspectscore=0 malwarescore=0 spamscore=0 bulkscore=0 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211210122 X-Proofpoint-GUID: JkpSjUnRrD6jerWlJhGSgTV1uncKjX2_ X-Proofpoint-ORIG-GUID: JkpSjUnRrD6jerWlJhGSgTV1uncKjX2_ X-Spam-Status: No, score=-2.8 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 11/20/22 6:31 PM, John Hubbard wrote: > On 11/18/22 14:20, Sidhartha Kumar wrote: > ... >> @@ -1950,7 +1949,7 @@ pgoff_t hugetlb_basepage_index(struct page *page) >>       return (index << compound_order(page_head)) + compound_idx; >>   } >>   -static struct page *alloc_buddy_huge_page(struct hstate *h, >> +static struct folio *alloc_buddy_hugetlb_folio(struct hstate *h, >>           gfp_t gfp_mask, int nid, nodemask_t *nmask, >>           nodemask_t *node_alloc_noretry) >>   { >> @@ -2009,7 +2008,7 @@ static struct page >> *alloc_buddy_huge_page(struct hstate *h, >>       if (node_alloc_noretry && !page && alloc_try_hard) >>           node_set(nid, *node_alloc_noretry); >>   -    return page; >> +    return page_folio(page); > > 1. This causes a NULL pointer crash when the user requests too many > hugetlb > pages (you can probably guess how I know this, haha), for example: > >     echo 50000 > /proc/sys/vm/nr_hugepages > > ...because page_folio() doesn't have a NULL check in there. You will want > to do something like this, on top of this current patch: > > diff --git a/mm/hugetlb.c b/mm/hugetlb.c > index 629bb044f063..ffb0f052bbff 100644 > --- a/mm/hugetlb.c > +++ b/mm/hugetlb.c > @@ -1987,11 +1987,6 @@ static struct folio > *alloc_buddy_hugetlb_folio(struct hstate *h, >                 page = NULL; >         } > > -       if (page) > -               __count_vm_event(HTLB_BUDDY_PGALLOC); > -       else > -               __count_vm_event(HTLB_BUDDY_PGALLOC_FAIL); > - >         /* >          * If we did not specify __GFP_RETRY_MAYFAIL, but still got a > page this >          * indicates an overall state change.  Clear bit so that we > resume > @@ -2008,6 +2003,12 @@ static struct folio > *alloc_buddy_hugetlb_folio(struct hstate *h, >         if (node_alloc_noretry && !page && alloc_try_hard) >                 node_set(nid, *node_alloc_noretry); > > +       if (!page) { > +               __count_vm_event(HTLB_BUDDY_PGALLOC_FAIL); > +               return NULL; > +       } > + > +       __count_vm_event(HTLB_BUDDY_PGALLOC); >         return page_folio(page); >  } > > > 2. And also, the tests should probably be augmented to run this simple > (but easy to overlook) test. > Sure, I can look into adding this type of test to Linux Test Project. > 3. And finally, the basic method of replacing page with page_folio(page) > is not sufficient, as you can see here. So I'd suggest taking a look > through your series to see if you are checking for NULL first, before > calling page_folio(page). > I will go through my series again to check for possible NULL dereferences. Thanks for taking a look. Sidhartha Kumar > > thanks,