From patchwork Fri May 19 22:01:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 96666 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:6358:3046:b0:115:7a1d:dabb with SMTP id p6csp38809rwl; Fri, 19 May 2023 15:16:39 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7tzHAltFfxz7yO1rT1GPLdRKP5icvoRGmpsKiJOijYNC33TFhrhmtKsNHKSGIJ2mpLGLkA X-Received: by 2002:a17:902:ead4:b0:1a6:4b60:3195 with SMTP id p20-20020a170902ead400b001a64b603195mr3295750pld.66.1684534599445; Fri, 19 May 2023 15:16:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1684534599; cv=pass; d=google.com; s=arc-20160816; b=OZj9kWmaNUvTl8XXQ7/pDjf2L9jnzCunpSn2XFze0t84Py0P5ptfeyo1e9b+X2rV7e 7jNfST+6SKiWQFlPdxIhXEquX0knX8cOghe+gYiCNlSr0sSaiJcs94rjwnF+w15cYus+ PcktgULXoivMj75mYSNbDegHw1fvdPjEsAWw/EJ7laws7h67//xVj4KUxTJmGzBB37bt OfckhYDj5wARZ7EG6XtoXFtHDJyXSNyzBvCLQRLzc8g9ni9h6ZADUXefgpYAJwrrLLlZ 09Lvh2fEQQgKDxGUbII0LBiT6xdZ3AJ3AxEsn2+H5tYi2OnczByvxJ5rJ2bTU2dCpirr BH6g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=3Y22BrpTmVG5LwQMAZ+8OBnRvoromZAM5t2fjkjx9VE=; b=i4NJmlyZCns8hmCZR61Kw4r8FH+XqLcIqElwQKIWmnk+5hWbp4PztmgY33fWIAPjVt kgbXfuV1AL5QOmvV1AY9iFDagoMwAyhq23nc3c3yudWIjfzHGKbFfCKVbQDsSY2CYL0J TAAz8+jsxUudYYB76rXfQQog6tqIW57l+CRxxxVSyj3wZwcoc6kkpUk1wP33PWhA9Qjk FYs6KlqhUOmKZ6+aLLVSuOTSkrGEMhkSndBQaD3i0UqhEqF40ky/5ZRSg3KCMM7nDxzE J2w0Xo9X82JwW+jstKHY8O/N6wkc1vfn5NlZ50nBVJ8eKhutP65aU/CGHe7DmaiGoYSJ /H0g== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=EZWVWJQI; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=juVpM6RA; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r12-20020a170902be0c00b001a6b5a7db52si159635pls.596.2023.05.19.15.16.15; Fri, 19 May 2023 15:16:39 -0700 (PDT) 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-2023-03-30 header.b=EZWVWJQI; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=juVpM6RA; 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 S231434AbjESWCh (ORCPT + 99 others); Fri, 19 May 2023 18:02:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231176AbjESWCc (ORCPT ); Fri, 19 May 2023 18:02:32 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59D79C4 for ; Fri, 19 May 2023 15:02:31 -0700 (PDT) Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 34JJESfY009227; Fri, 19 May 2023 22:01:56 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=3Y22BrpTmVG5LwQMAZ+8OBnRvoromZAM5t2fjkjx9VE=; b=EZWVWJQIjWm0VTNS99o1AbkKUrNO8+DBy9agkWbA8Zr2M0nuTgNfXUnUW58yMh3K2NGH 0+RGayGtQnKCNQzYkCiGnt66eXXEzJgRu/PM8GogIlo5fqBFnZuqbBVzAfF6a6nchNiC pC+krp3LUVRrNmT8NUJjl6X6X7cWPJuASmh6X6FNRm7Q3BW1qzNuFf4txIXns8d/AEjc t3WYVAuS278Qyyhfzqz8CaS4rU5YwsCDUrGQC40LaQTegVOin7Mq8p4EljYP8AukOlDu m6GtLF66P9aTZcJ1619IIvexKbC4Qb2GLbqh8/oFYZZH68HIFsh6zjmbDNZ877UKnm2i sw== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3qj1fcbhy2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 19 May 2023 22:01:55 +0000 Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 34JKNbZo040097; Fri, 19 May 2023 22:01:55 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2102.outbound.protection.outlook.com [104.47.58.102]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3qj108c9nf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 19 May 2023 22:01:55 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dvXOCjSG8cFvtprfLj4L9P+PO10hyUZZlQR3e7gscvJEdUQgBoO3KjRmyDoHFB5GBZkpppXNp1r1/VuhUx5yjSB1LP6xzV0um3NqHrFs58zQUgFXAyv4IFViNPI8RspjvjnL3AyIIIsSsi4Vqy4OSs0KoTePwfkmg8BT0OnCFoaea17tHGVgoatA1nTpSfJ4voszV1qBlxWlPvqo/qLLLHVN5e0n0WJMP/+5vI9Ws91sShkiufX8GHNYRgXJ555ectVygirZFmHCfmznHX9tN2Vp259Km5fxxcT4u1BsslcRDG7V6ewsr4zFqcLzN6GuxtaACZLnIQkpj5qLG114bQ== 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=3Y22BrpTmVG5LwQMAZ+8OBnRvoromZAM5t2fjkjx9VE=; b=aebvyejMU7tC72WtPQHlB/DBtO/YTiDW5/L5qXPnlo/3hMe374GlHjFVPVCwfx4pGBzypduumUmNE71LZ80F22FdJGaJlk/N+g2CeseDBjq8V+8KgD9a4ASctmJbf0XH/P1hz356PwifTqBTU8rWjo12WPLvy+tQVd8pVvIGA5lnvmmYhuRv/8jm6mgVmhya5+ZufMxgY4J21quhg3BBp+jOP+TIlwbskxjYD0M0lpcGWwwVAs1L31XUcGQOzaF0nIC/a2Hplf+5+6y1b8WNL0ZAm+ewNoA3FDm3CH+GwbVSOmWpTuQs2le9btJiiekcbsxYOsGngJAwUQXOWdiOdQ== 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=3Y22BrpTmVG5LwQMAZ+8OBnRvoromZAM5t2fjkjx9VE=; b=juVpM6RAKYUfRbbOWRNKA13ySpAew+QjR0FNM21Qkq6cY7k1SLUszCVWyFRe68Vu8DpjVCp2I+47c2WYFVFWholwu9Ny0PW6iQ84zWr/tHYYeUkOAVGBUSV/ECNyOWAGZu3eDY24O9IHTZlKVT6thtFRfcKickncg1mRkC3ohPA= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by CH3PR10MB7862.namprd10.prod.outlook.com (2603:10b6:610:1ae::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6411.21; Fri, 19 May 2023 22:01:52 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::12d3:3f71:5b55:c342]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::12d3:3f71:5b55:c342%3]) with mapi id 15.20.6411.021; Fri, 19 May 2023 22:01:52 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, songmuchun@bytedance.com, mike.kravetz@oracle.com, willy@infradead.org, david@redhat.com, nphamcs@gmail.com, Sidhartha Kumar Subject: [RFC v2 1/2] mm/filemap: remove hugetlb special casing in filemap.c Date: Fri, 19 May 2023 15:01:41 -0700 Message-Id: <20230519220142.212051-2-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230519220142.212051-1-sidhartha.kumar@oracle.com> References: <20230519220142.212051-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: SJ0PR05CA0136.namprd05.prod.outlook.com (2603:10b6:a03:33d::21) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|CH3PR10MB7862:EE_ X-MS-Office365-Filtering-Correlation-Id: 4c7efd63-2d3d-45da-5a98-08db58b4a6ae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XhoGmR1kifsBa1vcudChDpClfOWBdCZ0qFHI8Nd1WAikakRzStPlxG0TwXPUT3/DGM1TB+jeMY5hN1KNSQSbxzxLvpr74HSF2FQOMXhcTTSjPrPuRPE05mCPfVch9ITx8FplliPOCR6ouKVLrum2/lnVtvqnd98GrpuxSjtX2ox348Bk0shUJCM2PWjqBilWZv3SNBh3QO2KdKmV37oszGDHUgWzrlAofVWqWU/ROw9d7T0VSRg+ObZHLWUYk6RwbgzmxWAQOKDmLceHzsRemb2UQ6kLzr7ERPTo9gYNYiGaBOw/iL6hXMLhfWla4CNbTZ4PkB4oxCmWIk1OMQAvIvNJuhNuheiSpx5USQLG6WVNB7P2JbZsz4fA8QHIh0pfuEcB/FKwWvrWBguAPLbW9lmgSs0NZEt/+MnWp3Vin7hRU+wIH17ua3ii3dUsx4a6NHW8tb1BY/XqDR8wiBsYwbFj3t5zYfkARJNqqVpzQU9fxU8pWw5wQgcqgHRLNkdHy9gxHlYZPE3WtMEcUnvLqu18h1uw0AQOGlJ1cShh37lUPHSLAv6Zqr7NNtts012F 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:(13230028)(136003)(39860400002)(346002)(376002)(366004)(396003)(451199021)(86362001)(36756003)(2906002)(2616005)(6486002)(83380400001)(6506007)(6666004)(107886003)(6512007)(1076003)(4326008)(66476007)(186003)(66946007)(66556008)(316002)(41300700001)(38100700002)(8676002)(478600001)(5660300002)(44832011)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: T6y24uwkHPPouqmzFTW/N5JquggJmchRgTV8wKuwDBgsOrPuOmNKb3Aicf9mM7zjuiVcDC6hhBEdugoit+Gjznh+XF9omr45dh1/U8immP95sCmPPwXhQXDon+A7c304td813DRZN7qBdqTBREj0Q6BuLaATr3FdTVGMwI0lo1L6BJWMb/SimnjxYwrO84UbfgAfGOh7JyztA+O6eJopDQVWWYFOqaRZD9+4qZAWB7Apth0953shNRvwtyKnOIHF7KTgJR/9f326o4hIVV5jzxMEvBCrzoRp2GxUtkxzK146TW+FTth/dVSjX3PIzhpssNcLzpLzJ9GA1rJTnaBcvIWffkmp+dfForh2IOuSmlAW4FwcAjN1SSMW0xkoIrb+mPzod7BuUavQTZMV168vhn6Q9+jgL44enlIGYmOxkD3OIPWlx04IdlLhvBQXkG3gqXeou2fZdtNlrzG7HW58prQHeu7dwsljAJ04LzHP+6v6/IRXfQ6ZuckZAjnF4PKLhDUR3t0B252j5AtY8JwiA2RuS4rvAdkPfFlBisgme6snCUiPja9ZongE/GDpzj8f4aVgGvHqNIaPTD/b4iiHuFOoOa/YCJtQvdvVSX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efd63-2d3d-45da-5a98-08db58b4a6ae X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 May 2023 22:01:51.8937 (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: tKcd9ebVoB2QPdiVEYmVAFWRSHSkE0/fWuz8nzG3ZRhCiwwxOxce2mbOGrtUw/RrieZCw4aGbG2hpW2eIkzilDqN1y2tc4jeVoe7+CeHNnw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR10MB7862 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-05-19_16,2023-05-17_02,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 adultscore=0 bulkscore=0 mlxscore=0 phishscore=0 malwarescore=0 spamscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305190190 X-Proofpoint-ORIG-GUID: Bzby6xGu6_4T6BllsjrEGRaz_bY1NLve X-Proofpoint-GUID: Bzby6xGu6_4T6BllsjrEGRaz_bY1NLve X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766362552098374979?= X-GMAIL-MSGID: =?utf-8?q?1766362552098374979?= This patch removes special cased hugetlb handling code within the page cache by changing the granularity of each index to the base page size rather than the huge page size. Signed-off-by: Sidhartha Kumar --- include/linux/pagemap.h | 6 ------ mm/filemap.c | 36 +++++++++++------------------------- 2 files changed, 11 insertions(+), 31 deletions(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index c1ae5ebc375fe..7ca967849c2cc 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -719,9 +719,6 @@ static inline struct page *folio_file_page(struct folio *folio, pgoff_t index) */ static inline bool folio_contains(struct folio *folio, pgoff_t index) { - /* HugeTLBfs indexes the page cache in units of hpage_size */ - if (folio_test_hugetlb(folio)) - return folio->index == index; return index - folio_index(folio) < folio_nr_pages(folio); } @@ -846,12 +843,9 @@ static inline loff_t folio_file_pos(struct folio *folio) /* * Get the offset in PAGE_SIZE (even for hugetlb folios). - * (TODO: hugetlb folios should have ->index in PAGE_SIZE) */ static inline pgoff_t folio_pgoff(struct folio *folio) { - if (unlikely(folio_test_hugetlb(folio))) - return hugetlb_basepage_index(&folio->page); return folio->index; } diff --git a/mm/filemap.c b/mm/filemap.c index 570bc8c3db878..12eee69240525 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -134,11 +134,8 @@ static void page_cache_delete(struct address_space *mapping, mapping_set_update(&xas, mapping); - /* hugetlb pages are represented by a single entry in the xarray */ - if (!folio_test_hugetlb(folio)) { - xas_set_order(&xas, folio->index, folio_order(folio)); - nr = folio_nr_pages(folio); - } + xas_set_order(&xas, folio->index, folio_order(folio)); + nr = folio_nr_pages(folio); VM_BUG_ON_FOLIO(!folio_test_locked(folio), folio); @@ -237,7 +234,7 @@ void filemap_free_folio(struct address_space *mapping, struct folio *folio) if (free_folio) free_folio(folio); - if (folio_test_large(folio) && !folio_test_hugetlb(folio)) + if (folio_test_large(folio)) refs = folio_nr_pages(folio); folio_put_refs(folio, refs); } @@ -858,14 +855,15 @@ noinline int __filemap_add_folio(struct address_space *mapping, if (!huge) { int error = mem_cgroup_charge(folio, NULL, gfp); - VM_BUG_ON_FOLIO(index & (folio_nr_pages(folio) - 1), folio); if (error) return error; charged = true; - xas_set_order(&xas, index, folio_order(folio)); - nr = folio_nr_pages(folio); } + VM_BUG_ON_FOLIO(index & (folio_nr_pages(folio) - 1), folio); + xas_set_order(&xas, index, folio_order(folio)); + nr = folio_nr_pages(folio); + gfp &= GFP_RECLAIM_MASK; folio_ref_add(folio, nr); folio->mapping = mapping; @@ -2042,7 +2040,7 @@ unsigned find_get_entries(struct address_space *mapping, pgoff_t *start, int idx = folio_batch_count(fbatch) - 1; folio = fbatch->folios[idx]; - if (!xa_is_value(folio) && !folio_test_hugetlb(folio)) + if (!xa_is_value(folio)) nr = folio_nr_pages(folio); *start = indices[idx] + nr; } @@ -2106,7 +2104,7 @@ unsigned find_lock_entries(struct address_space *mapping, pgoff_t *start, int idx = folio_batch_count(fbatch) - 1; folio = fbatch->folios[idx]; - if (!xa_is_value(folio) && !folio_test_hugetlb(folio)) + if (!xa_is_value(folio)) nr = folio_nr_pages(folio); *start = indices[idx] + nr; } @@ -2147,9 +2145,6 @@ unsigned filemap_get_folios(struct address_space *mapping, pgoff_t *start, continue; if (!folio_batch_add(fbatch, folio)) { unsigned long nr = folio_nr_pages(folio); - - if (folio_test_hugetlb(folio)) - nr = 1; *start = folio->index + nr; goto out; } @@ -2175,7 +2170,7 @@ EXPORT_SYMBOL(filemap_get_folios); static inline bool folio_more_pages(struct folio *folio, pgoff_t index, pgoff_t max) { - if (!folio_test_large(folio) || folio_test_hugetlb(folio)) + if (!folio_test_large(folio)) return false; if (index >= max) return false; @@ -2225,9 +2220,6 @@ unsigned filemap_get_folios_contig(struct address_space *mapping, if (!folio_batch_add(fbatch, folio)) { nr = folio_nr_pages(folio); - - if (folio_test_hugetlb(folio)) - nr = 1; *start = folio->index + nr; goto out; } @@ -2244,10 +2236,7 @@ unsigned filemap_get_folios_contig(struct address_space *mapping, if (nr) { folio = fbatch->folios[nr - 1]; - if (folio_test_hugetlb(folio)) - *start = folio->index + 1; - else - *start = folio->index + folio_nr_pages(folio); + *start = folio->index + folio_nr_pages(folio); } out: rcu_read_unlock(); @@ -2285,9 +2274,6 @@ unsigned filemap_get_folios_tag(struct address_space *mapping, pgoff_t *start, continue; if (!folio_batch_add(fbatch, folio)) { unsigned long nr = folio_nr_pages(folio); - - if (folio_test_hugetlb(folio)) - nr = 1; *start = folio->index + nr; goto out; }