From patchwork Mon Jul 10 23:04: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: 13307812 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 85004EB64DA for ; Mon, 10 Jul 2023 23:05:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EE9ED8D0001; Mon, 10 Jul 2023 19:05:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E99A58E0002; Mon, 10 Jul 2023 19:05:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CC69E8D0002; Mon, 10 Jul 2023 19:05:56 -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 B46F88D0001 for ; Mon, 10 Jul 2023 19:05:56 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 832B640288 for ; Mon, 10 Jul 2023 23:05:56 +0000 (UTC) X-FDA: 80997236712.30.9061A04 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf18.hostedemail.com (Postfix) with ESMTP id F0DC31C0005 for ; Mon, 10 Jul 2023 23:05:51 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="Lc3T6t/X"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=RxDQHrV6; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf18.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689030353; 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=TX8ReSra2CTr+mmxeCiQytd1RCxHzR3pjRde6VuAu3o=; b=dDT1yg64ewtSCw6V+47VF12u85C/akGacJnwZ28JB1ZlnLWFQr0zCqJGfnX+4iLmsUTHdN 6EoctIfZBe3CIfa6pqChTesfHTagyFJ6JztGlfc3WRj9cRE6KYmf7yPmGbFXKgoOeZTZ0m eAiUnhG+BRZzfonjIjRANAaUkF7QDfc= ARC-Authentication-Results: i=2; imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-03-30 header.b="Lc3T6t/X"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=RxDQHrV6; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf18.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1689030353; a=rsa-sha256; cv=pass; b=5vzKXiJCQlWq/NNxJgnc+Tl7g+T1zaKxVuAlwFn4WEx2OI9DjVOsH3YTwaErcCUcchAXVA 8xUQD4Og7c+oOH/whiA0ljAvUr4Dt0UrBKwIoMLJLdZ5u6HvfSYPNG55GNKYW/SQ8xqvxU DvJp4Q4lUfV0def49KbynJHgIpaQn0Q= Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 36AJNeo3016636; Mon, 10 Jul 2023 23:05:28 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=TX8ReSra2CTr+mmxeCiQytd1RCxHzR3pjRde6VuAu3o=; b=Lc3T6t/XMdkcLnXgx3FoMu8hAdJw1TnVNr1sqnnhovEiqhVLcw7RJN5GGYGXzERNW5IT edCe6/l5cHO5LSyRXZZgGGlAugkMK5PfuyaUKtSUJT8g/o/C6sr1hgMbeA+zTsQYC4gC lb29RzlAyiTn9F2fqgV8Mc8a2URaidaH8ncVhdGM17ahTPD8qU70g5AysZgbtDL+vJdI 7esiYHNYcXC1F9B3J5/QgKggziNXiEJrwn7Q1ziLgfq6qu+yucqyfVfbpzTvt6BiNvTM jo8T+NXaIGwpyPo0JuFRgPZdHNESp4beHWz6XdA0BBxG4FewuEvgZ3xJyXj9Fc+M2Bte zg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rpydtumhe-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jul 2023 23:05:27 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 36ALKR30022913; Mon, 10 Jul 2023 23:05:26 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2168.outbound.protection.outlook.com [104.47.58.168]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3rpx843unr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Jul 2023 23:05:26 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HWjGns0CHteSjCkT7h9c7TVgz6UR9GVCHg6QAphlPSMlKjVV5J/q7NmaRmnsMg5LD9jlIhH9TRm17x71DmJ1SJseJZJH8PDDDDztbP5+9MIOI2i/QXK6kZFVD1/TSjnbQzk/J6szo7M32QDqvLyCcdlrIsGtULAK7eTO/ehBPlf3EdoTuObu9aHPgT52bHtQRp3+qrIZP6FKKV3EbixxiqIvoRKvMdFZ5MjwGjueKe/gHMl9QSIxj6ZxuHyGtRCsK2qsC8/Yqa702i9nYg1o3NFPSUjVdPpFCLjx5ubPJljR0zMAQxfGwlpBcBTIz1EHAOmNj2hRh7ihvPnWfE1m2w== 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=TX8ReSra2CTr+mmxeCiQytd1RCxHzR3pjRde6VuAu3o=; b=hJQgDQGS/RliYLz3EQzVa3IYOiBGHltPQB5wQ5cZgyvxXEHMe0DsxSu2E0Fv7/SOiujYP7A43HeB2hKjtmuJ2A780cRyODLJR29DkRadc+UKst5ykPgGbHwIheGjQLSR/dP+DnUUmPt3VEbbbZCP4niLMX40yn6KMwAf6ukeXkYTH/UDXTTP6+X1uXumyBA9RPX+ww8CrAlM/hKuyGhh1RZoyVIY4RHvvO32bsoHiLtA3jqtfLfBuxnRPiVPeHqPIp+/n1CDkeVEBbnyd20f12gLOZmy+iDeZm3PkEFnae9uNPdjJDc+4UyWxcYmIvPf6UAeTW8e5FIfUcsrCG3kNw== 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=TX8ReSra2CTr+mmxeCiQytd1RCxHzR3pjRde6VuAu3o=; b=RxDQHrV6CONYO90WwMMCYiFUMlToWVbAhQ+VfzvViNlwBiQ/cW8bCfoqDEF3DhyU3SuqfGjb1Mw0MbFFc+0xVra2g8fBm27GgrjS1qzp84FpzusLTSr6yMZIor7bm1yBGoRiP92Zq8sOaqXE2boJtqu1QQZW5+UsJ9mRT6lseGw= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by PH7PR10MB5856.namprd10.prod.outlook.com (2603:10b6:510:131::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6565.30; Mon, 10 Jul 2023 23:05:23 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::d9c0:689a:147b:ced5]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::d9c0:689a:147b:ced5%5]) with mapi id 15.20.6565.028; Mon, 10 Jul 2023 23:05:23 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, willy@infradead.org, songmuchun@bytedance.com, mike.kravetz@oracle.com, david@redhat.com, Sidhartha Kumar Subject: [PATCH v2 1/1] mm/filemap: remove hugetlb special casing in filemap.c Date: Mon, 10 Jul 2023 16:04:50 -0700 Message-ID: <20230710230450.110064-2-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230710230450.110064-1-sidhartha.kumar@oracle.com> References: <20230710230450.110064-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR05CA0052.namprd05.prod.outlook.com (2603:10b6:a03:74::29) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|PH7PR10MB5856:EE_ X-MS-Office365-Filtering-Correlation-Id: 7ce00b54-bc9b-4429-4cd8-08db819a2423 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 31dnM49XK5dHP0b9dN7nqXFZXRARIHws5YHDD/Ns5GkviKHEjn0zZ6rR/mku+GNwnB4bHOn2IWX/DHVEw6aUBDjl5izUzJlKPXcPF2asMXUa7sZNtvc+k7Qjt9/bpenxDa390d8WsUvIMBVdHDSn5sFZCthZj2dlckp8A4K8d8tbg53QHt+n0wEbaEkD7SICAH3d0TfQBwxehGnCHzhp/H7bL7+S/D3rPrDL9PRkDoxWdutIj65ipQbyCg9051ZC6FA31s6GkHc+qoPuZyloXYZr5e8V/MYFAP0tJDAhpXn/Yicg3AABOBJG2LgSEXxGcpw1H+4/2nUOEEsZGLdM4K3gn9kGaOADVC83LFNbG/KV/3/2fvt4rrZo3+n0Npi1QV5z3xaKkNRPBuDp6L2pgYlmo38Uw3wZ/O9oOtD/WYLRXhGUuPKktVuKy/zhVgHMF4bKVpvUyDUDAG4mzVytPm7bdiLAqdt/UwXERHn/tP7imc1PGuA7ecuUzGZIrea8zPRGy+6s9X22hkn4kRnG5U8LgFtf4r2sa81E1HWjtvYpG7EswbqmBYc064l8/akg 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)(346002)(366004)(396003)(376002)(136003)(451199021)(186003)(1076003)(2616005)(6512007)(6506007)(107886003)(478600001)(83380400001)(41300700001)(4326008)(30864003)(66556008)(316002)(2906002)(5660300002)(66476007)(8676002)(66946007)(44832011)(8936002)(6486002)(6666004)(36756003)(38100700002)(86362001)(66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EaFaZmwPHsAn4jTKQU37CRKv9Cx5/19CEELt2pAXEhn13W/K48ae71wEJNCg4dRSi1W+72sXSLcFmhE7Z0V5a2X6rWMI4FaRLK9GvN1xULaIr0dMxr8Sm7NyfHDp51k802GnB54Ph0xPgpGw0/cEJss9bhj2g8H9dpAEi9uyNCHycZx7gkUhA7KWNkA488o6IvARePFObqVCFjTrMjGNy6FRWxtpZUJgLzQdXaYfzy3OZw9iTUmUIwCiwshb+FnCCDJB3ef/28YVCJIlDwW8Z0cH65uzKYqhHsvs4sLNeDT2be35hhQC5I08RR7Sm8CQQVhXafhb2JNYxW9k7qpNIoGffV793+H4Ic4iBd9DWSt6Nh8Oc1JCDCFGUcA1nEQ9JnlBkEqi7WrZSThVIFbsJYq0uRaWz1H+vUtngxZZDGn0ah0zmVCbeovgLyW40sa72Wai8IWKNY7oi8Yz8T6BzUMqo4ESiQpko5quzLTj7qcUZW1ggM2kB0mLi2d1gad5n506GohqN0Zmyuz06Id+By82ZhC4NudBaTx5nCxpzR4fdvFtuYUqBLlERSNcywI7HPoEzKySTYHczUftJ49Xgry0d/dEcwxYKo X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7ce00b54-bc9b-4429-4cd8-08db819a2423 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jul 2023 23:05:23.5691 (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: 7ofbfhK2eP+gyESbyuJ8ntTmrLzrXe1y/OY/Riadb5SQpwfnBxo9gNsCFhsITgmqeaJFS+GyQ6A7+JNf0jWKyryThiHShu8clAyVs2nyU0s= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR10MB5856 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-10_16,2023-07-06_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxlogscore=999 adultscore=0 mlxscore=0 spamscore=0 phishscore=0 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307100209 X-Proofpoint-GUID: zqBKDcRLl2R8r5iBk810W_UBpxt21Y3J X-Proofpoint-ORIG-GUID: zqBKDcRLl2R8r5iBk810W_UBpxt21Y3J X-Rspamd-Queue-Id: F0DC31C0005 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: 7twhxqn7ihdq77cnbg1i6jr5jmtnnpgh X-HE-Tag: 1689030351-956134 X-HE-Meta: U2FsdGVkX1/9iS47ycv5lGt7Bf4Q1TBoiR0USQusGVujh1zB5fAwV+YpTVTh+nFaNB1nj9bdVqxJt/n/bGXcOx9rIQEiQTRxEx5g38tHinRz4U44SWZkO5p7yR4AV5dUb6yz3yD0FLNdpy3FCIimkt3qsU0tSbY3Npu14J4o35MVpnf7MPCH2mPMKpHKDW7fB5hnJDAi2CBkXWnvqxgXqX13qKqkU/dkxa+oI2yaLJa4rbwdoGP9Q+B0QUsCIloMIsB6bRcaoVE/j9mlOkApp9NR2ASefv3VIjVFYbfN9FYLtmlNENWeCBoraTF9MmhXsDGp6DjygX7dzYvzuYsmnXkYgB2EbgcfrJAj2c8kM2IQU7YYFqha0s3xKpM8sFQRSYL3MPsAjgErifx+xSsHhKJoZL+gs78dZBD2kmKakX/3La6zj6sRGlRrlI/pCTkWdKrJ7Rr0h0v4nabfZ7ACFej/JB6lX0YnNu1QsreUluG0sP1dc2iaS86Omxm9IimlcJ+/LNrAjPov9xGUG3zTS3Lr0bJog+QAh8/4mmwrdIcu/H0Kn794dv9FCcicKzDMxrdnE46UNnZD0zW9rWK9vN1BDE87pcYM5cl03R9AewFwW7c3aPox2/wz60bKN1gPKJDrMmlVSpqDaYwtRp0zxvHYNAoTuXXf+El/f+ko2biQ8Vu4GUPvvKTbHDqnwEjl1zwPB8m+ZfneichzzD7TF8NOlxZC0d8U/g8pgesZh0Xg8HA5AGUpNXOkebKb1M5j+2KdAjRWuPk4iYLqOdLx5rcjypyywuDyPbXwQKjTiJHTFtEgiH5qrJUPt6Sx+CHA0e1+qvJXb6I7XMSYSdIo2lh7D+Adue5StvxG0K4hjKjC4xEuaLOQEESNMibHceQ2hzuxW2eBMJDjrW4PBbfKL9JM3yDBPLGWWqFKXsY3xEHiOQWfxa3+xvZ4VsuS/ShAlHEmGqyySxwCWRr8feh ON9Lg1kC tVJ6t45eaIsuOBViuZ+wy6pNdxtPblkKjXc9r+wlzrfWvTbXJgvfFx0v/017eAoxZMl+7uCy5AN0rWXraDCR03aOSNhJyPE4vrieYc1xy0r8W4vPXr6vyzuzfUDyNC7g0z0/a7OYNhWQ42v71QrZ5mSHywAAqt1pE4AvnDMef1Ul2aBUdWwlwC+5TS27P+eUPtCZdZreIV4TI9A72JXdUXboVy7oobublBm0+Hy0migUWO3oy5saB0t67uSnZCNCZjIcXb/AAaOWiIpf4ih7r4/3BIPJ5ALnWlVARLhgj96mpCF8O2V0LV0tbUVZKWbsjQNIAW6rH+UX87/mVrHk3Zy/iK51c4EN/tNKUFKWD6N1Qdlx7mVS44bS1Yn8g+9tgJ7a+ 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: Remove 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. Adds new wrappers for hugetlb code to to interact with the page cache which convert to a linear index. Signed-off-by: Sidhartha Kumar --- fs/hugetlbfs/inode.c | 10 +++++----- include/linux/hugetlb.h | 12 ++++++++++++ include/linux/pagemap.h | 26 ++------------------------ mm/filemap.c | 36 +++++++++++------------------------- mm/hugetlb.c | 11 ++++++----- 5 files changed, 36 insertions(+), 59 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index c2b807d37f852..d78c71dacf0d4 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -663,20 +663,20 @@ static void remove_inode_hugepages(struct inode *inode, loff_t lstart, struct hstate *h = hstate_inode(inode); struct address_space *mapping = &inode->i_data; const pgoff_t start = lstart >> huge_page_shift(h); - const pgoff_t end = lend >> huge_page_shift(h); + const pgoff_t end = lend >> PAGE_SHIFT; struct folio_batch fbatch; pgoff_t next, index; int i, freed = 0; bool truncate_op = (lend == LLONG_MAX); folio_batch_init(&fbatch); - next = start; + next = lstart >> PAGE_SHIFT; while (filemap_get_folios(mapping, &next, end - 1, &fbatch)) { for (i = 0; i < folio_batch_count(&fbatch); ++i) { struct folio *folio = fbatch.folios[i]; u32 hash = 0; - index = folio->index; + index = folio->index >> huge_page_order(h); hash = hugetlb_fault_mutex_hash(mapping, index); mutex_lock(&hugetlb_fault_mutex_table[hash]); @@ -742,7 +742,7 @@ static void hugetlbfs_zero_partial_page(struct hstate *h, pgoff_t idx = start >> huge_page_shift(h); struct folio *folio; - folio = filemap_lock_folio(mapping, idx); + folio = filemap_lock_hugetlb_folio(h, mapping, idx); if (IS_ERR(folio)) return; @@ -887,7 +887,7 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset, mutex_lock(&hugetlb_fault_mutex_table[hash]); /* See if already present in mapping to avoid alloc/free */ - folio = filemap_get_folio(mapping, index); + folio = filemap_get_folio(mapping, index << huge_page_order(h)); if (!IS_ERR(folio)) { folio_put(folio); mutex_unlock(&hugetlb_fault_mutex_table[hash]); diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 623e98d62df3a..57f21279c529f 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -811,6 +811,12 @@ static inline unsigned int blocks_per_huge_page(struct hstate *h) return huge_page_size(h) / 512; } +static inline struct folio *filemap_lock_hugetlb_folio(struct hstate *h, + struct address_space *mapping, pgoff_t idx) +{ + return filemap_lock_folio(mapping, idx << huge_page_order(h)); +} + #include #ifndef is_hugepage_only_range @@ -1024,6 +1030,12 @@ static inline struct hugepage_subpool *hugetlb_folio_subpool(struct folio *folio return NULL; } +static inline struct folio *filemap_lock_hugetlb_folio(struct hstate *h, + struct address_space *mapping, pgoff_t idx) +{ + return NULL; +} + static inline int isolate_or_dissolve_huge_page(struct page *page, struct list_head *list) { diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 69b99b61ed72c..71d969557bd94 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -739,9 +739,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); } @@ -799,10 +796,9 @@ static inline struct folio *read_mapping_folio(struct address_space *mapping, } /* - * Get index of the page within radix-tree (but not for hugetlb pages). - * (TODO: remove once hugetlb pages will have ->index in PAGE_SIZE) + * Get the offset in PAGE_SIZE (even for hugetlb pages). */ -static inline pgoff_t page_to_index(struct page *page) +static inline pgoff_t page_to_pgoff(struct page *page) { struct page *head; @@ -817,19 +813,6 @@ 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); -} - /* * Return byte-offset into filesystem object for page. */ @@ -866,12 +849,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; } @@ -882,8 +862,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/filemap.c b/mm/filemap.c index 8040545954bc4..12f51e1b0f4d2 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; @@ -2038,7 +2036,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; } @@ -2102,7 +2100,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; } @@ -2143,9 +2141,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; } @@ -2171,7 +2166,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; @@ -2221,9 +2216,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; } @@ -2240,10 +2232,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_next_index(folio); + *start = folio->index + folio_nr_pages(folio); } out: rcu_read_unlock(); @@ -2281,9 +2270,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; } diff --git a/mm/hugetlb.c b/mm/hugetlb.c index e4a28ce0667f1..71d18bb76b4df 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -952,7 +952,7 @@ static long region_count(struct resv_map *resv, long f, long t) /* * Convert the address within this vma to the page offset within - * the mapping, in pagecache page units; huge pages here. + * the mapping, huge page units here. */ static pgoff_t vma_hugecache_offset(struct hstate *h, struct vm_area_struct *vma, unsigned long address) @@ -5724,7 +5724,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); struct folio *folio; folio = filemap_get_folio(mapping, idx); @@ -5741,6 +5741,7 @@ int hugetlb_add_to_page_cache(struct folio *folio, struct address_space *mapping struct hstate *h = hstate_inode(inode); int err; + idx <<= huge_page_order(h); __folio_set_locked(folio); err = __filemap_add_folio(mapping, folio, idx, GFP_KERNEL, NULL); @@ -5848,7 +5849,7 @@ static vm_fault_t hugetlb_no_page(struct mm_struct *mm, * before we get page_table_lock. */ new_folio = false; - folio = filemap_lock_folio(mapping, idx); + folio = filemap_lock_hugetlb_folio(h, mapping, idx); if (IS_ERR(folio)) { size = i_size_read(mapping->host) >> huge_page_shift(h); if (idx >= size) @@ -6151,7 +6152,7 @@ vm_fault_t hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, /* Just decrements count, does not deallocate */ vma_end_reservation(h, vma, haddr); - pagecache_folio = filemap_lock_folio(mapping, idx); + pagecache_folio = filemap_lock_hugetlb_folio(h, mapping, idx); if (IS_ERR(pagecache_folio)) pagecache_folio = NULL; } @@ -6283,7 +6284,7 @@ int hugetlb_mfill_atomic_pte(pte_t *dst_pte, if (is_continue) { ret = -EFAULT; - folio = filemap_lock_folio(mapping, idx); + folio = filemap_lock_hugetlb_folio(h, mapping, idx); if (IS_ERR(folio)) goto out; folio_in_pagecache = true;