From patchwork Tue Sep 6 16:54:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 12967823 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 877EBC38145 for ; Tue, 6 Sep 2022 16:55:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 068798D0007; Tue, 6 Sep 2022 12:55:57 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E7EF6940008; Tue, 6 Sep 2022 12:55:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C32BE8D0007; Tue, 6 Sep 2022 12:55:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 9E9768D0003 for ; Tue, 6 Sep 2022 12:55:56 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 748EBC08C0 for ; Tue, 6 Sep 2022 16:55:56 +0000 (UTC) X-FDA: 79882262712.19.D0EC4E8 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf24.hostedemail.com (Postfix) with ESMTP id 2F09C18009B for ; Tue, 6 Sep 2022 16:55:55 +0000 (UTC) Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 286GO19Y016876; Tue, 6 Sep 2022 16:55:41 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-2022-7-12; bh=2ZwJE9Txg9PnDua1OpfpI2XWocK+C9Mzt8dlocRPfIc=; b=BK/rCAui9oD/Xl1GFckyqJkzQLW7BFZX0eCI9FWz+AOtBFei1q+nPyPZ5r/GiEM9LVb5 AOvoaTcOzVNjEplx9wR9Q1b4ZUDEWJfVxh1lN63TMpg1LgBY7+6x8CZ9SHBKvlVNSGrN bhZiTfOoKoegHG7RMwIbkn+e8TJ3on2jPQXzpSFfoobRTALI3Iw/I+2A1GvDBFcWqMhq I8Cqt+HXrSaC/+RFBIjXLabMa2WpmfTBvx7UPqALCI0C8yR7lYdueMaABg2BV7pze7JR hZ//Ommxx5ECO2+fSekvXMJ4IlQHAxhcj2Lnim6AMUEQ2Hdt6/Nq/VYHmQd+Ok3eWX5v Qw== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3jbxhspg8k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 06 Sep 2022 16:55:41 +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 286EwPed037499; Tue, 6 Sep 2022 16:55:40 GMT Received: from nam02-sn1-obe.outbound.protection.outlook.com (mail-sn1anam02lp2048.outbound.protection.outlook.com [104.47.57.48]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3jbwc2w59e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 06 Sep 2022 16:55:40 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gAmcfoNW8NdcJVvRENdkSd8uTgvzLyY9JLhxQ7JAPifvbXTDiGWkV7yILu2PMBCP5Oi5+1RCRv5RPfSBH1bStgz+OLDX4cAXI2BEO9aV0ivUIqK8cb+PBPbnuzY1tR9zD0wrBCDMSqMtbT+84p9KHzmsug+IYNtMdVM3e+X+sgxrzQE72pl5M0suXihWXsF3lXRTUL9q4o0Ev0uACeEXCz4SsiJmNI8WDfqaTxVM0GXW7qvnnflrn5WH/nVL/RdySkim+vPJ5UgtercbQdW/qLzpxmjFkmCv5qQwW46cAGI15xndI2y/l3G9k9jsk9baFbvSIyGesyvZNeiQud5iEw== 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=2ZwJE9Txg9PnDua1OpfpI2XWocK+C9Mzt8dlocRPfIc=; b=ivdTRMEEsYfIeUZDfnb/zegKCiM6Hkjvo3MDEjhQUqoJzbFzjBny0+6CldDlQF1i4M9289Nw4/2NdfR6RHNoqpRpbxZlJPNV7RV8m8PtHXL8i5h1bPJd3F7x5ZGXZoSlmMe27Gg8w5qFtLuNaak9cpVvPH+EWy1DtA82Wk78X+IUKJicTwGoDi+j8dIW4E3+GKpRrZ0XjT9woESUQkxw4ntERljdncpLp/Twnnd68zjo/MtZ9+lucldfoRIEh5wPV+BNaUM5limH9ROFojyJVo2U6ijG86gYztPu3r3HkjrW8abuitRO+RvthEr++dNe+yHSRHQZgwNAxAR/s1n7sQ== 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=2ZwJE9Txg9PnDua1OpfpI2XWocK+C9Mzt8dlocRPfIc=; b=Th2AdoqysLMpP1uJCj7mdkaU1RU7gSrsEAivP2Gi2Y7y4Zz79MCPGc9oM2CO2zWWz4jDBYtZ7XpknxpZI3kJl/gHeAAvpaplwoh/E79Y1CKLppkwmrygMPkwTc2ZEwI6pavCoLppx4SfwrY8RHW8erGVvGCzFQL+O21qxCPAd7Y= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by BN0PR10MB5078.namprd10.prod.outlook.com (2603:10b6:408:129::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.12; Tue, 6 Sep 2022 16:55:38 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::ec55:981e:3693:b37]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::ec55:981e:3693:b37%4]) with mapi id 15.20.5588.018; Tue, 6 Sep 2022 16:55:38 +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, vbabka@suse.cz, william.kucharski@oracle.com, dhowells@redhat.com, peterx@redhat.com, arnd@arndb.de, ccross@google.com, hughd@google.com, ebiederm@xmission.com, Sidhartha Kumar Subject: [PATCH v2 5/6] hugetlbfs: convert hugetlb_delete_from_page_cache() to use folios Date: Tue, 6 Sep 2022 09:54:44 -0700 Message-Id: <20220906165445.146913-6-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220906165445.146913-1-sidhartha.kumar@oracle.com> References: <20220906165445.146913-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BYAPR05CA0105.namprd05.prod.outlook.com (2603:10b6:a03:e0::46) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 726a9731-bc31-4f6f-121e-08da90289fee X-MS-TrafficTypeDiagnostic: BN0PR10MB5078:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: g75iLYjvvIUTRlQNdNznjb+5wvbUWLbRYgkjtvzX/0zaHGKKxyfx1IuRPALHZeEkp1kQQgvU32i9asVFqhHezAcC0UGBv4t6AWVTnPae82OOx+bZXadmEYKZbzZlKn6S6BxeXlV1CAHPSwmib4ThNh86hhoEbEE1tlHjtEJmTtNZQvN3D9VXCODJXd5jDS4Vdxq8kE2Dt8+UqRbF/RuEWc2QAcKvcoTttl5HFLenaOviEYLEoWAQGHRj+5rwCBsAGztOXmyX9exmofEuDrM/Hl26jrQxpirpg8nVzxqDK8nRwrUUzcUS4cfl18wRNN6ZH2s2vqO4u8tOM48koonxugl84BuyDpCdWUmXmdoM475wezRcMm2XlqhkQWwzAMKOhoWGD2bmXdv3ASRgOcIqYZ/f2CyJR7nfK3lL27ZMQ1MycE28uakiiopxFAHefJ1LWi5MUsMhYou2K4/7IltGVC7r/GBRRluSTK8Gjz0D4x+/pjH96nRA299E9BRQAzTpuD9bOTeSxcP674VkXB6zydm34wFgaHR6/5uWoZh/aRoRM4efe8gIDranRD+PCqkEepcCI9LW7rv9DausUHaZdjAytvQKQVA6oCg1ApGxOrej7+H3sVP955NegN8e20Kjy+PSuz36CNfQFeFxP53vdOnGDjvTQCa4JVT0qHeuY3mmL5fsyir/Ju/BQN8d5ObswbJru1GHXmoiKIVdm53vgQ== 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:(13230016)(346002)(376002)(136003)(39860400002)(366004)(396003)(186003)(1076003)(7416002)(8936002)(83380400001)(2616005)(44832011)(5660300002)(2906002)(26005)(41300700001)(6666004)(107886003)(6512007)(36756003)(6506007)(86362001)(6486002)(478600001)(38100700002)(4326008)(8676002)(66476007)(66556008)(66946007)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: te8KJtzEKZV8e2OAMtcC0VY4iyM6TIjva7RmhxypdpDaa51/OpjCIPhsAsOYW6S/IlYukU++i/74ctg9CU1VQdlrymkXRt6xb62hjaP5k4tmKTrp1c9bwWa5ljUdJ66Mvc+DKTRAppszfCW8ajT34ORRHrXOItogSu/AiZdryTtGyVJXli4lafj3VQPCFprA/UTebxe4A4Y3rct+zhCK7y+55pBEf0fDQmxM53KDXJH3cCzdF2OyrtGQsN2lV7C2moVlAVO1LqLUMyNZh1YYQG2XNPy8Dd6D0XwOR0OewchzJp+SbllL0McWjSF3lzTOYatoXK5x40B9iQKvAeHhnf2IhJd3Jdmu2InDfGDhR0iarsvaX/GqaMwkYKlc9Ls0HauQJ55OgIxT8A8rxEH6Z+uG8W+UMBG5cVUeBtSLskfEEUQZe6YUNHWb9PiUG1ZZSqlXnwX96piUQUpZPLSuBP9ZGMNcz3iozMu1iM5GjNqVjpKmpZU/wnYRX6cjXjqZ//Xk1cpNQYhxudOrxUjJ0JdBK39ICj6NmBDoWfsLhPfsaVYWYFzSkZiX2xKQ/iv4MJ1L5LXnaMrIVwNHFyqzXSgqF7LF3VqXu3mWDOEvc7p2P71wA22cyWRFnYPRO17RP5AkcvTCUUm8eQ7Ap7H3Ue8vwFpCj8O8RMykRPw8lOYtLENDBQv//tz5L2Vd4/5Xzs3Yex0ZGWezwTkF8XirmqQn4FTAAvMcxORhxbU7WPWE6vHw79y/4/ZJ1JCDGjr66wJ2tKVzyqAlMzQ1IE+pVMzhFWjak11hCI9gxoP74SbfVeNKi1YO43eS2BOeawxvxyG5J4UgSUmclOzcaoDTIl6AJPnQn5PEuovp3MBCu/g0vH61ebRTOCQ2O7Osrd1bRkkxv/zcCuq326wF69xWTb05WMejKvROS3BQzcG8gnLDYj3SY7Q9Q/ck7O1aH4Gf92937nneNTMCCt1sc+RmnXouz2iboOZmNHfB+Cvet3Fx2UnZFBtzyyaJq5v4RrSjt3Xo3dyoSr+VSEH//hw1mTdZ9krcu1PgLdsFAp8puhBq/V1Ffhlr27flMGOkteCdD5Wb+8EdxiISTc4tZ09rSRZi3j0ckzZYXel2m5n0Qb3aKwb87uItQEVZUGdRYewW7napfCH9NVfzhQEVYHys+NQBU1SUT21eLF+yPW1bJmnWGNubaJpLhwwdUowO0u8rwuwwRUOB+Y9FmHpo2BVEv1BV5tpBAT0+Zj/DO5gzucLNUSkeuZTxbK0kN1QzJLsx/TRT9inpNpvMawKWyS7xtMCNg80j7id4WrtXbj7eIWqiUtoaLkk7pK1D+YF/HuxGTGIXsl7jEnofOJ5+z6ya4HXEYpaeg4Oar0NJGFTyHHSqBfe71DnZsu+f/9BhgD8tmqse78q8zF3QJzP/Q9k0CghW6I7Sr1KFX73H0VWI2VQFPMG7q4QO6QixdxZJBXSTeEjNAL+KZDKtmnqNoTVG8ZKB38GWvPxhBh80NPD1FCTUbxqBo2r4PQGDfGKRhoEQxbaT5GbWEDgXDQw9iOKxBX4+kBiKGHBT2HZvFzzLjqmEA5dpsY7m0OW5uS1av+cst46xhn3f4G4CGP/p64YS+w== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 726a9731-bc31-4f6f-121e-08da90289fee X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Sep 2022 16:55:38.4648 (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: vnKPcRHVQ46KkLttFLO3TaPB6pPL2EIkrvSoja/6ZMWNftN6R36h91sJl9brJnKpfShiZibQjUutiBXsw1vsJpw6dFngyI03cb6BXvtFFOM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR10MB5078 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-06_09,2022-09-06_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 phishscore=0 mlxlogscore=999 spamscore=0 adultscore=0 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2209060078 X-Proofpoint-GUID: hW3y4Pe25TwbP5cjQUYodJlw6Wo2JRTc X-Proofpoint-ORIG-GUID: hW3y4Pe25TwbP5cjQUYodJlw6Wo2JRTc ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1662483356; a=rsa-sha256; cv=pass; b=HkdLzTV0zMpDiy5MDKW2VDNnWQtA7KZVZJrIsIRD/y8KeoN3nxxPMzcqW/UgozHtY/sssn M2K/yAKiyXDCe6WBIi9/4Y2ALRuCfa3fZl6ohMquI/qtoa3MWji/AUn1cK/9KoJgIRouyb di+kJr574a/R1hTBmUCFUz1zULrzvic= ARC-Authentication-Results: i=2; imf24.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b="BK/rCAui"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Th2Adoqy; spf=pass (imf24.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=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=1662483356; 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=2ZwJE9Txg9PnDua1OpfpI2XWocK+C9Mzt8dlocRPfIc=; b=RAffKLP69F9bz2ivbWlS8R+WdK7rcpYXgqmR4se3cbmg10+uDm6VumHMohPKABt3Jqt8uw /WlUtaKoAh/M+00ufgS155nYbYY+ev4XO4q7A6MwUX/gJ2nrK7KbD4BhYiq3kgeFR4qibT T1eXddjndwULyENA891ny2FNpJLbHPU= X-Stat-Signature: huwzkjqo4swpz5bhbwy7geycwe3w93as X-Rspamd-Queue-Id: 2F09C18009B X-Rspam-User: Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b="BK/rCAui"; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Th2Adoqy; spf=pass (imf24.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=pass ("microsoft.com:s=arcselector9901:i=1") X-Rspamd-Server: rspam08 X-HE-Tag: 1662483355-59685 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: Removes the last caller of delete_from_page_cache() by converting the code to its folio equivalent. Signed-off-by: Sidhartha Kumar --- fs/hugetlbfs/inode.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index d9e08c445e2f..38920702765e 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c @@ -364,11 +364,11 @@ static int hugetlbfs_write_end(struct file *file, struct address_space *mapping, return -EINVAL; } -static void hugetlb_delete_from_page_cache(struct page *page) +static void hugetlb_delete_from_page_cache(struct folio *folio) { - ClearPageDirty(page); - ClearPageUptodate(page); - delete_from_page_cache(page); + folio_clear_dirty(folio); + folio_clear_uptodate(folio); + filemap_remove_folio(folio); } /* @@ -562,8 +562,8 @@ static bool remove_inode_single_folio(struct hstate *h, struct inode *inode, * map could fail. Correspondingly, the subpool and global * reserve usage count can need to be adjusted. */ - VM_BUG_ON(HPageRestoreReserve(&folio->page)); - hugetlb_delete_from_page_cache(&folio->page); + VM_BUG_ON_FOLIO(folio_test_hugetlb_restore_reserve(folio), folio); + hugetlb_delete_from_page_cache(folio); ret = true; if (!truncate_op) { if (unlikely(hugetlb_unreserve_pages(inode, index, @@ -1174,7 +1174,7 @@ static int hugetlbfs_error_remove_page(struct address_space *mapping, struct inode *inode = mapping->host; pgoff_t index = page->index; - hugetlb_delete_from_page_cache(page); + hugetlb_delete_from_page_cache(page_folio(page)); if (unlikely(hugetlb_unreserve_pages(inode, index, index + 1, 1))) hugetlb_fix_reserve_counts(inode);