From patchwork Thu Apr 13 23:14:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13210733 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 BC19BC77B61 for ; Thu, 13 Apr 2023 23:15:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 53760280002; Thu, 13 Apr 2023 19:15:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D996280001; Thu, 13 Apr 2023 19:15:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E3451900005; Thu, 13 Apr 2023 19:15:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id B6056900003 for ; Thu, 13 Apr 2023 19:15:25 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 8D1B4A045C for ; Thu, 13 Apr 2023 23:15:25 +0000 (UTC) X-FDA: 80677926210.25.320C91B Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf23.hostedemail.com (Postfix) with ESMTP id 2DCD114000D for ; Thu, 13 Apr 2023 23:15:22 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=r1GL5Ekj; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=BFTFRveu; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf23.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=none) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681427722; 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:dkim-signature; bh=nNGzYXNZiU1HGYEV2TvGskVf68jn6hY1qJpj/I7cqww=; b=c3f6rzhzvPAIOf2u3VilADFnMBeyFKyX+nWnxuJcekShWtNv0CkAs6wX1snT18XmRccB4x egIPJGylC/HEFbN8fPZgV3GPkQ0XDhJ0S9p6nmb665F5kupRyJ+gFPi/nCwjOOtEFbMKmZ ezEQfWT6Phm2tOxquEaPF/UUamlsQio= ARC-Authentication-Results: i=2; imf23.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b=r1GL5Ekj; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=BFTFRveu; arc=pass ("microsoft.com:s=arcselector9901:i=1"); spf=pass (imf23.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1681427722; a=rsa-sha256; cv=pass; b=oplvyRcRFVqcLBDNa9jiNHBOBh/NdT0onyNP+lLQ+ypGQu4ZCbhwuOfv4rXlYGRuYu1ToX nMMDSB8Gu5gOxR2qQAZzfuZYBFHxkp8UUR+0cZTr0JwrX3N0aieDNGLvNDsGkKDnfwGuS4 j1ndq7ukTGJSsZLF8VlV9XqtFBDS7O8= Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 33DLfvWm012832; Thu, 13 Apr 2023 23:15:04 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=nNGzYXNZiU1HGYEV2TvGskVf68jn6hY1qJpj/I7cqww=; b=r1GL5EkjS2MTXcND/H3g1BFigCOSnP3y18rQsEZRVOTSfLLfaJGaaxc6uyx0zbE/fpAq x4bjhgtR5e8gPP+JMAR6gATRbdIUeprym1QRb8MzKfwpDlAl+OPIQvUhL/SUKF2HxuAo HWavCDLiUIHe+GW2NQfO8gaPKVz+N5qsLVuAUmBJj1oOm1rYVeLDlXpT+tSpI0vyv3Z0 ZHrWw3SIWcJrAgLmn8wUm5ep3KP8ZC6u5owHd+D3TpCvjrJJxT+vucToo1x9ys/8peo7 5eB7mgjrGuXmzqcZ0szjp526TunTmO/5WqlwTfhviN++rf53FDmAXIwx2S9AtQnex8Yo sQ== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3pu0bwn0pd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Apr 2023 23:15:04 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 33DLeMve025109; Thu, 13 Apr 2023 23:15:03 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2169.outbound.protection.outlook.com [104.47.57.169]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3puwdt922n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Apr 2023 23:15:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h9Ds4l3QeXH7RjubDukRnzbQyurfyKBnqZ3YPOM+/+Iw11LpTN4IZIRLgsfAB0cKtU6lUclQ6rPTCLYXNGqrs2T30+93ZjvQWM+qMAz7Vm8SCYKHHRUOYtjhgxYNIQ7wt5UIf9cwqZZ8wytY2GwD0s8OqJ8PV1oMyklLitrFd4w/vV9mYB1QfRZCUbukOywoCovmnC85XREbuCMdcOSkuf1ycz/QZQfwMUFCLxdGXuxMGp8foCnJMNZ2gg4StMgNLTw5y0TmnXoR8qQvrowf+5PWYE3lSs8OjRQgowu68F7yjj2CIz3tvIZAPpi23xyCMfGwGaoY39pTiAgtgpI9SQ== 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=nNGzYXNZiU1HGYEV2TvGskVf68jn6hY1qJpj/I7cqww=; b=ZQ2hiA+bPxO7+xgVLTEHZCvyoC4weXQwpOjg3NOUUkYH+MOw/mHca09TwDSWGDmtc3SITQBYVDrPgIPjuTxoNA5ke2LLknG00GsMNFMMgfLeF5uL5IlcBkQm1oxMYP2wJLDOkue8ERi/fkzcMMPUGv1SWcdS7W7/rWR5+5VYLy870+vXFYd0IOisuQPsmDQgleX5rFEa6agF539mlfEVqssJxMPpojTIwShyrzcv7Rq7NXmkMe2g95kTlPdAHQdcCRC8vUEBNQgDR+EC8sq0kpgsaTdmH+CQLyVFI97LV8r6bUxCT0c9QpnFkIPcRgFZpUZhfaIdW6J9/2PQ4+oSFQ== 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=nNGzYXNZiU1HGYEV2TvGskVf68jn6hY1qJpj/I7cqww=; b=BFTFRveuwm0X0wALVZ2EZQyCuyeZxrbktxb5vWQH/ejUDpvXytV6LIh7m28TOC2bKLyD7csd8q+zkYLKnDGKbRU20xDaKqtd10UU1MpcPDjyOFxXExlI29Ap3LvGhKfwr6h2elX5IcqZD2DgJ7NHH2afsKhzF20tpCYNJVqEbqU= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by SN7PR10MB6287.namprd10.prod.outlook.com (2603:10b6:806:26d::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.38; Thu, 13 Apr 2023 23:15:01 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::12d3:3f71:5b55:c342]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::12d3:3f71:5b55:c342%6]) with mapi id 15.20.6298.030; Thu, 13 Apr 2023 23:15:01 +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, Sidhartha Kumar Subject: [RFC PATCH 2/4] mm/hugetlb: remove hugetlb_basepage_index() Date: Thu, 13 Apr 2023 16:14:50 -0700 Message-Id: <20230413231452.84529-3-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230413231452.84529-1-sidhartha.kumar@oracle.com> References: <20230413231452.84529-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR08CA0030.namprd08.prod.outlook.com (2603:10b6:a03:100::43) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|SN7PR10MB6287:EE_ X-MS-Office365-Filtering-Correlation-Id: a25a9b17-5ef8-4420-16ab-08db3c74e822 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0uABKVaLs7QYZGQm2oft410K/vB54Jw01PyDPt+o6U6qqUVj2QuN1qhBk0r4m4qhgW5KpSR3RHRhl5PKSNrDq09gd7z3SGqDkRtHv6JhjDv5nVKigwfe0dwqCUa/rEY1/VIa1LGzdUqiYEBAeJ0NQ0xgIf/8JLbQknk8yhhds4lIpoKHYEAD/S8o4xA7nchtNA/yeujwqEsKjPZBHP9h3XTIqYHbmJ3F9fXAHcVN/VJEKOKjGhzoop+MfeOkwHgUP2KIHxPD6N//0RY22MkYlKHA0EuqgaaIDL9PzwI5ilae5n2iO2/cqeocPGDl5StoLxPUsU92t+znrAcQxHpOAT9mX7ZvC6vcZDpMv5gAqbo0blLcjXmYgDJWpyJwIXGSSHyNzXsJ3C/MRPjM/rhrJhj/y9sGg/hSkEq37XjgHNGdMBHnMy25i/KQeY7Xw+PIvOdLHgi1BaAYChq0U6Utm9v5tL2E989pjpcJ123BVAVngN/nP+y4cL9+/22/eeGhpHImystF78VaZ0t/ac9YiY87MXDPZove8wlPcmBE4K/dGGPGJEc520LyQzaainF7 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)(39860400002)(376002)(396003)(136003)(346002)(366004)(451199021)(6506007)(86362001)(6666004)(6512007)(107886003)(478600001)(6486002)(1076003)(186003)(66556008)(66946007)(66476007)(4326008)(38100700002)(316002)(5660300002)(2616005)(41300700001)(83380400001)(44832011)(36756003)(2906002)(8676002)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange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w2AZyK61o0vQ39+yb1sAFqCWZ6sa7H4zdbSrOy2D9/qW4BLWg2D3S+yNr+i1b1n8pGF+BuXsi3lbvgc6Ymr4CWCJqJbjz5BP2VdWGvqn2C3fUSBlJo+C/pZ5KHqk/T5D9YO2BAJXE9l/j+251393DXbfVCj0divbTlq8OnTbFswU/+AP87ns2/eAxWFlr9E3MdOACfHVm+ZP0KaRDw25Sp04JMj63Eby356QUWRw94eePocdjcvh06lzE5ShGJ0mLH+6YJmSlJyVp5JktxSq4pg1ig4OKNx5tlSSS5cBT0u0Ui8SRBreARFOknwG9tzHW1SCPEf586o6OhV8SNM2tbW+C0G5aDaumIWIukR/WLq1y932QteZ03wkEEhNmf14QWYfvW6QOTOXyFY6zjqsOhAg8hfRiCWf1phouNePDBi6qNojtyHLJVYFjqlWOHSMUE2l0nNwZsxxkrcWICHtCrV+gUD+oMy0C9H/TO4jGWQOi79srMEv6YP9iMVNzZZDOMOxvX34juFfaozKofv05xQp5qEEFGGD6gyxisu4Z0m4Lf+mHqBcU= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a25a9b17-5ef8-4420-16ab-08db3c74e822 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Apr 2023 23:15:01.2705 (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: /5sw/U/qKegAloe+DwZ9HEl6jXblC7HBsGASMo9UyLDuUxNhTKkjsZTcGipGA9PdbUXi3d8WYISWZz6QLeoU8QcPzmMPT2Z5MZLvS2AE34o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR10MB6287 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-13_16,2023-04-13_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 mlxscore=0 mlxlogscore=999 spamscore=0 suspectscore=0 bulkscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304130207 X-Proofpoint-ORIG-GUID: CGdbZDWTTTrGciyPweo43NDpf6YvVJui X-Proofpoint-GUID: CGdbZDWTTTrGciyPweo43NDpf6YvVJui X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 2DCD114000D X-Rspam-User: X-Stat-Signature: 974jzsrhrqyfwcuukjwwbtcde8cp3gza X-HE-Tag: 1681427722-478454 X-HE-Meta: U2FsdGVkX1+hbsOqkcomdyQMZPa/ahZnchuDRA64VdcLXlwrrHN6qF+Iqasey0/qIhjnLh4tpLI7HPkZ7WS120LatZQYk2cPILqXFXxgBZKyYCe7b1Lck5p2hYNBIakFIIjOXC/003G8uRbBprbiKh7JquhxyfJNLBCMcvG2u6Nu3SdQilK5NcfrPAJX+Iper5/l5npi424VmOXztS9RmWiHzV0TdsI05vY/nTSBRCiR6b1tjnPDHugXMPHJK4V/w1SblYJJFirPYdbaqYQq9fSjMvIdvMZoUB/xWlUHzyhJdgb72Y0qdzhTFbbB7bSu34mc8ewF90foT/J/rtCr6a4cj4msPUdzQy5vTmyZfjAwlP5P8NujKVC97FA7v7NAh8YzRQuqSYxHzzlVmK8K794X2sH9Feyc3HhHK9tMXCSAiJ0PNY9eq6l2OGk0Yqxs6Isc+yqJbC/LqRFyUUMBTYrtQVZK1BBAdCFSGIxr0/8QVVwa5azyU7fv6PGVh+ZvRKcYNtNdOy+oFrhrhK0Rf6yYcIMwX0+GNZx8RvhLF9ITRvq+O5ofNwxpOFhO6pXljsHqj/qI8zM64I/6gsrUKR7TG7DYLWhP3fwIj1Wc9l/EMJ8nLdpjZTybWpLl5208xZV0aemzvM6F0sKM3lSzX5XDDeMDFepxeRQoBgPFD01H5xEFH0pwhWFcZXSXpBu/Sd4WfJPap9u3fJxccx4rJLl84WWU3ATtgQdkDsRrMRKrxJdITgiQxcNOG2En/gMnhaq89do38a32re6K4M7TC5ZNtPof5gYzKPC009t/ufLI66Rv/jt7Fa1v+CVgxUlyXW2T7xGUaeynDGMNEcZb8MsJDXjevwgnRlTYyr570hnW+nMAjbDkM0/WnMMsXKMziLdD3f4ZtMxlGRNKNpF+/+3uDe/ZJiQ1q0yckuWHyw/syagzN3YstStmou++zHW0Y89EmAWXIQWaaZulMUB HDKd2hsP rP6DVWAe5T7cpHbcy9f4m4afEk1bylt7Ma/0z+HxcLyLoKQQr9WGbW7og7VH5YHeI+pmEXmMQH9gamcleZyjKXJQ2vC24WXvKdBng7T4IMUGUdAa0yI2avpoZaiZZs5uPlVYJ6+inGyWmYQP+fNYxmezwhAknhq99YE6P9U1dd0PJ5Saw1xIime9nnO7VEGSy2RXX0YMwj694Cv1AHkOpe/UuNF9ygoa33u9hEJFJq4YLLK+yav4VQsxFYktE7sCiIi5jwq9M17lGIgOb/MdkK9Y6iTwrZdOJmU0vbjlcnvA9TGjvtRIMA5Zql5mimM0sjjVKlMl6I63QJs67BUrFgl2hPonddmL0t6HOvTsatKWzRYSRTH5u5Y0k4oxcDVLiCAJxPS8343EWBjujYpPptzuGpPsEUjK5ZlNkifDg2XrGBAcPOL/no67gXdP7evUF4/Wh 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: hugetlb_basepage_index() can now be removed as hugetlb pages have ->index in PAGE_SIZE. This also allows removals of vma_hugecache_offset() and linear_hugepage_index() which are replaced by calls to linear_page_index(). Signed-off-by: Sidhartha Kumar --- include/linux/pagemap.h | 7 ------ mm/hugetlb.c | 50 ++++++++--------------------------------- 2 files changed, 9 insertions(+), 48 deletions(-) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 330b1db913f5a..bb60282317875 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -792,16 +792,11 @@ static inline pgoff_t page_to_index(struct page *page) return head->index + page - head; } -extern pgoff_t hugetlb_basepage_index(struct page *page); - /* * Get the offset in PAGE_SIZE (even for hugetlb pages). - * (TODO: hugetlb pages should have ->index in PAGE_SIZE) */ static inline pgoff_t page_to_pgoff(struct page *page) { - if (unlikely(PageHuge(page))) - return hugetlb_basepage_index(page); return page_to_index(page); } @@ -854,8 +849,6 @@ static inline pgoff_t linear_page_index(struct vm_area_struct *vma, unsigned long address) { pgoff_t pgoff; - if (unlikely(is_vm_hugetlb_page(vma))) - return linear_hugepage_index(vma, address); pgoff = (address - vma->vm_start) >> PAGE_SHIFT; pgoff += vma->vm_pgoff; return pgoff; diff --git a/mm/hugetlb.c b/mm/hugetlb.c index f16b25b1a6b93..011020a30f4ac 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -949,24 +949,6 @@ static long region_count(struct resv_map *resv, long f, long t) return chg; } -/* - * Convert the address within this vma to the page offset within - * the mapping, in pagecache page units; huge pages here. - */ -static pgoff_t vma_hugecache_offset(struct hstate *h, - struct vm_area_struct *vma, unsigned long address) -{ - return ((address - vma->vm_start) >> huge_page_shift(h)) + - (vma->vm_pgoff >> huge_page_order(h)); -} - -pgoff_t linear_hugepage_index(struct vm_area_struct *vma, - unsigned long address) -{ - return vma_hugecache_offset(hstate_vma(vma), vma, address); -} -EXPORT_SYMBOL_GPL(linear_hugepage_index); - /* * Return the size of the pages allocated when backing a VMA. In the majority * cases this will be same size as used by the page table entries. @@ -2087,21 +2069,6 @@ struct address_space *hugetlb_page_mapping_lock_write(struct page *hpage) return NULL; } - -pgoff_t hugetlb_basepage_index(struct page *page) -{ - struct page *page_head = compound_head(page); - pgoff_t index = page_index(page_head); - unsigned long compound_idx; - - if (compound_order(page_head) > MAX_ORDER) - compound_idx = page_to_pfn(page) - page_to_pfn(page_head); - else - compound_idx = page - page_head; - - return (index << compound_order(page_head)) + compound_idx; -} - static struct folio *alloc_buddy_hugetlb_folio(struct hstate *h, gfp_t gfp_mask, int nid, nodemask_t *nmask, nodemask_t *node_alloc_noretry) @@ -2703,7 +2670,7 @@ static long __vma_reservation_common(struct hstate *h, if (!resv) return 1; - idx = vma_hugecache_offset(h, vma, addr); + idx = linear_page_index(vma, addr); switch (mode) { case VMA_NEEDS_RESV: ret = region_chg(resv, idx, idx + 1, &dummy_out_regions_needed); @@ -4810,6 +4777,7 @@ static void hugetlb_vm_op_open(struct vm_area_struct *vma) static void hugetlb_vm_op_close(struct vm_area_struct *vma) { struct hstate *h = hstate_vma(vma); + unsigned int order = huge_page_order(h); struct resv_map *resv; struct hugepage_subpool *spool = subpool_vma(vma); unsigned long reserve, start, end; @@ -4821,11 +4789,11 @@ static void hugetlb_vm_op_close(struct vm_area_struct *vma) if (!resv || !is_vma_resv_set(vma, HPAGE_RESV_OWNER)) return; - start = vma_hugecache_offset(h, vma, vma->vm_start); - end = vma_hugecache_offset(h, vma, vma->vm_end); + start = linear_page_index(vma, vma->vm_start); + end = linear_page_index(vma, vma->vm_end); reserve = (end - start) - region_count(resv, start, end); - hugetlb_cgroup_uncharge_counter(resv, start, end); + hugetlb_cgroup_uncharge_counter(resv, start >> order, end >> order); if (reserve) { /* * Decrement reserve counts. The global reserve count may be @@ -5582,7 +5550,7 @@ static vm_fault_t hugetlb_wp(struct mm_struct *mm, struct vm_area_struct *vma, * * Reacquire both after unmap operation. */ - idx = vma_hugecache_offset(h, vma, haddr); + idx = linear_page_index(vma, address); hash = hugetlb_fault_mutex_hash(mapping, idx); hugetlb_vma_unlock_read(vma); mutex_unlock(&hugetlb_fault_mutex_table[hash]); @@ -5669,7 +5637,7 @@ static bool hugetlbfs_pagecache_present(struct hstate *h, struct vm_area_struct *vma, unsigned long address) { struct address_space *mapping = vma->vm_file->f_mapping; - pgoff_t idx = vma_hugecache_offset(h, vma, address); + pgoff_t idx = linear_page_index(vma, address); bool present; rcu_read_lock(); @@ -6014,7 +5982,7 @@ vm_fault_t hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, * the same page in the page cache. */ mapping = vma->vm_file->f_mapping; - idx = vma_hugecache_offset(h, vma, haddr); + idx = linear_page_index(vma, address); hash = hugetlb_fault_mutex_hash(mapping, idx); mutex_lock(&hugetlb_fault_mutex_table[hash]); @@ -6185,7 +6153,7 @@ int hugetlb_mfill_atomic_pte(pte_t *dst_pte, bool wp_enabled = (flags & MFILL_ATOMIC_WP); struct hstate *h = hstate_vma(dst_vma); struct address_space *mapping = dst_vma->vm_file->f_mapping; - pgoff_t idx = vma_hugecache_offset(h, dst_vma, dst_addr); + pgoff_t idx = linear_page_index(dst_vma, dst_addr); unsigned long size; int vm_shared = dst_vma->vm_flags & VM_SHARED; pte_t _dst_pte;