From patchwork Tue Sep 10 04:14:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Popple X-Patchwork-Id: 13797881 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 823D6EB64DE for ; Tue, 10 Sep 2024 04:16:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 11C276B0287; Tue, 10 Sep 2024 00:16:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0A5D78D000E; Tue, 10 Sep 2024 00:16:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E128F6B0289; Tue, 10 Sep 2024 00:16:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id C288D6B0287 for ; Tue, 10 Sep 2024 00:16:32 -0400 (EDT) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 59D2D160852 for ; Tue, 10 Sep 2024 04:16:32 +0000 (UTC) X-FDA: 82547517024.02.CD0EF1B Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2072.outbound.protection.outlook.com [40.107.236.72]) by imf12.hostedemail.com (Postfix) with ESMTP id 9123D4000D for ; Tue, 10 Sep 2024 04:16:29 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=ZxE+uGPn; spf=pass (imf12.hostedemail.com: domain of apopple@nvidia.com designates 40.107.236.72 as permitted sender) smtp.mailfrom=apopple@nvidia.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); dmarc=pass (policy=reject) header.from=nvidia.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1725941762; 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=DcVLiuWZMyEaidTz8honbOf5KmaLeUplBoucWssgGrM=; b=qvLzXdNeVnkECgiIWkEDCh7rx86GcxKoupGDwLOUCv3/tDlU5KchZk3iTewgFze5JURfY1 EnSzB9IGgkZY6pFYJ3+FFKZ8BoIpfOBzOAEDW0j0AU3TnnseqWyIefFY1VCrMIPsaxkWwc APfzKnlMwII2w2EdiZa91huEZTwPj08= ARC-Authentication-Results: i=2; imf12.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=ZxE+uGPn; spf=pass (imf12.hostedemail.com: domain of apopple@nvidia.com designates 40.107.236.72 as permitted sender) smtp.mailfrom=apopple@nvidia.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); dmarc=pass (policy=reject) header.from=nvidia.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1725941762; a=rsa-sha256; cv=pass; b=gq5dieXp/OSzgSzjRRCJXWQgCh/Vf0NoHxQ4KMuioZtP8eiQk+bxmjKMyCWj6Hm7bVsqeL 1AsH2dLAy/t0tQV0PvJs2IdYGjkO9TvEcE2hCwsetHBkn31EAwMiQho2CVqZlFMZw+FQey QQDKvruf1vdzhqGroxlQp5mEjU6zhq8= ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=t2SozdAz0QW77S4Bhen0zVnlZiEc0HshNK1GWuqMEiYPUoRt1pYfO1buoRti9bMy1Mt2ACk6p26eJm9ovnB33Sr4cRrZIBKewtcVIbkW7AxRBOzVj8B8lcimsq0nJSquvnk30zEf7eQ+4OSzw6se+khh6SiwAo/nZTfevxElHwEVHiPO5E+XzM+1R/KQFAMrlAowGJPqDd9Cxkr5daAyQclsIfW7f38kb08zSgoWs/fu7X41abFsVh+/qpiHvP8Rl0nXZpVCSK82cyD8MYYM4ZY0bSl55TKqU7U4R5+7YWudPXyMBjPqNzWI+xMghpfq6qgmPaTq2EFXfV6iaAY/SA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=DcVLiuWZMyEaidTz8honbOf5KmaLeUplBoucWssgGrM=; b=QH4FkoYmzX9F3/OmPMSfLp5aJZVueAyJjoMsPcbGP7xb3w6GmPJdK7JWOHZ3hY+Jr/Xbw6HX56YXw2i7YZCN5zqm933Om+cBtJC73TnWYrHV78GdOqQlwHM2O16uVVTcONpvpGpgjgjK9Grn5mInE4S+LSN7fUjW26GYf9a563j2RqEl5CKFN+Qd0D+FBFDQa/E5wG55Wup8byTYd7dZZ00kpTr11v8ExpD2MPsucpOIzRxTZeFrDej04d2uDEiVzwv46z505ikkQvR3QRVq4g9GFhxy5NJbqTmKjYhOav3KxLjQl2GDoKyWy9ZZ0aNq1Fq4xH+Lr41rtys0x+NKfQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=DcVLiuWZMyEaidTz8honbOf5KmaLeUplBoucWssgGrM=; b=ZxE+uGPniGIgT2BiDLKyfJcnXdqtBsRz2bLD8IzpIPtqgV4/5hcCPhVbvMR6AmfX0IZiHDSVmcfx89opEcc/7I8C+tUObMm/7YmFwls5CkM8HeVnW5iBaLI095T8BaQgDK5muSsDahrJWDmG7azWT537paZpARkjnvJVNeqha4Cwbec2XJ7At/H3TWEZAO/UemappX351N4dqzgDBd75tXby72MzOwgPvlBbiBXRfyEF8e4Qrs4KxTruzXWPs0OUGr/R9s+NSveq350yYVaRJC0sN2Lej4fldEDYZyaD6fdJOrFK3VuuKZmY23RT4D726tLbSqTydKNYiHKX+1/dfw== Received: from DS0PR12MB7726.namprd12.prod.outlook.com (2603:10b6:8:130::6) by BY5PR12MB4148.namprd12.prod.outlook.com (2603:10b6:a03:208::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20; Tue, 10 Sep 2024 04:15:08 +0000 Received: from DS0PR12MB7726.namprd12.prod.outlook.com ([fe80::953f:2f80:90c5:67fe]) by DS0PR12MB7726.namprd12.prod.outlook.com ([fe80::953f:2f80:90c5:67fe%3]) with mapi id 15.20.7918.024; Tue, 10 Sep 2024 04:15:08 +0000 From: Alistair Popple To: dan.j.williams@intel.com, linux-mm@kvack.org Cc: Alistair Popple , vishal.l.verma@intel.com, dave.jiang@intel.com, logang@deltatee.com, bhelgaas@google.com, jack@suse.cz, jgg@ziepe.ca, catalin.marinas@arm.com, will@kernel.org, mpe@ellerman.id.au, npiggin@gmail.com, dave.hansen@linux.intel.com, ira.weiny@intel.com, willy@infradead.org, djwong@kernel.org, tytso@mit.edu, linmiaohe@huawei.com, david@redhat.com, peterx@redhat.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, jhubbard@nvidia.com, hch@lst.de, david@fromorbit.com Subject: [PATCH 03/12] fs/dax: Refactor wait for dax idle page Date: Tue, 10 Sep 2024 14:14:28 +1000 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: X-ClientProxiedBy: SY5P282CA0134.AUSP282.PROD.OUTLOOK.COM (2603:10c6:10:209::19) To DS0PR12MB7726.namprd12.prod.outlook.com (2603:10b6:8:130::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR12MB7726:EE_|BY5PR12MB4148:EE_ X-MS-Office365-Filtering-Correlation-Id: 74cb772a-8d46-480e-5af6-08dcd14f27e9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|7416014|1800799024; X-Microsoft-Antispam-Message-Info: iqrbVvURPQEAKv3k9135doCKU+t/lEH0CJVPgHV21AOQ3++/eXpr3/QSqvEKiDeC8sGe1xrf9efOOjAaOc+rJg274pfGqHRI95A/0HuG3F1bJ9haAMVWT77IGMDDUTPTHES7mIQBy8fxHDSAxFk8dTxLkZo1O1Y4KdQQE30+CbiYP2HaQwyJscC77gugvNQKDYIwbJMwey+qbcdg/VNfuymnDaflbF+UeymRBVdDCNgogIJFIE0tkhNNMmM59LrlMin6EdVwGX6fPwAh4CGBU3bNDBvexTUP/DiZn1xBr3qcuS1Lv94gt5scgDuuggPpz0yvNPbAKHtk33Xy1VFpgqxRuhFvcsZ9DI6jCTn4q775A3EqvStJCoo02YQbHqMaQG1DUtX85JWq2Slxaz5nIT6aH9ZFVBJJN05SySHt4NRTZJITeVAnMr8VPvM5LK4BlyZIlh54+7UmL5SEzhTnlmnyYhXV1SSJ7ZG3I8mEAdfPO3FxR/9bq9t5aXgxmpzKClh7XSDwiZK9tRExFJ6GUVq9x17KayuzZBORIS918adysDiajM5uKIELRDbhgWMByVhfz3G5GpThr4KVJDc0mtGEOe5mMpiu9MrPbtsXKl8Nn6CuNmU8BeDQ+z5hzTYbMBpJftyHJJ23/6SfTH15DIyMnrir/9r3OZp3sfXAMlnfCxnsTTbLOqR+ge8a9Us9ObOtAl+rh345DRVLS2p95eeEssMIYrCtIouDdXl+ZS5rKdI+MTPHhbKc7HVO4+VCdqN1L96Fk8lWvzz9qaIYzpoyE/Eo419ycjI9uSioQG9o1T0RcJL2eOjyho+nVYHqgkvQk3dUm1kRsL+KP62Ld5y8exIMBlTToBviO6d7hhKYJTnNXqq2bM6eKXWKX7bERleDi4IZWmc7bhdhQ9n37+GI8zpSNPZHKPmxZFKJRYbu/8eHbpPW7uQAOReP5miSFTwe7QppDCUQvTx1PByWozgJ+X+2qhXjDAoaLg8NEVY4qCYjLB/mNYgd6vr8s8+Wcpcxa+OWFh1IV5BJPO7NQHxQScq9CeW0hKDvfdUrxOg/QBi3EmCecfYQetSpfPcNSTsrh64b3mYeydwDU1k1UHvn4S2Wu70PCG7quBjgvohPvZAjRYix96T74EuiFbm9iXchDf3eJct+EzhC9JZ0RUxbafYfW3r1drGOMdGgkPcsEpPT2F0AHgDLfvICPfJerDZpBLU+kmGIK9vjtLGBM8B+jfEGRNsM7wI1nk/rEQ8a0tEmWbHkO6HuY2XpdJbuYfaQArD3/xu0XIZ3C0ubGR3oQNAKFWJVGidZm90+dVyh4tsID/7sS9+dRT0djCbCqLAuMiogEkbCcUO9XUuQeg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR12MB7726.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(376014)(7416014)(1800799024);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qobh2u4tGTkyr9iETtnsUD2llXgvH6z/LiXINDUYu2dlFluk//wfK0kv3AIVGn9G4eWyyz05KEM4kCxX3woauWbHLzI36htYslHeRY+CRyGclrzZPYUqYo6u308NNa7jZi5v2A+579LaSd5eRoqTDCbyCUgyd8CmI9zLMXR+yumkMelvSS52FRc1KmixMGbrEtG6XGMQC+fgYhtunDwH9Fjgdx3bz0KX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bfKpy2r0S7CG77fUPbxQtEVKUSlVgo97H4ch2DlJO2/ivRnL/rnn9iS/ZYRRDjIIl6q+GvCIlpE102m/xhmXUNwOLh7MSxNl68M2WpggnYEq7tbbjePvZzz7lVeT+2GZdc+U6Lam9jYgXsHy9qJMQnecsE0A2FI4AjV1bQDGgCk9GiMMqRBNF242iVGD1skVmRpN7WELdPcXHC0bD+Vxczq1HHNrSzB2iNhPDh7fzlSNYLazHLCRxe14ycv05eLdK8/qUJk1jTVoklKGl/qF7HUl8rSpn7I X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 74cb772a-8d46-480e-5af6-08dcd14f27e9 X-MS-Exchange-CrossTenant-AuthSource: DS0PR12MB7726.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2024 04:15:08.4801 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: uO/UtzO3M9SgVZdkYJBej9eFJooqbZV8U6tFNLamjzPW6rAMXhDCSNufl4gCixR+lykbb6TqLLmW9TcXabCd5g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4148 X-Rspam-User: X-Stat-Signature: s8fiu9acjmy1zq6z3hr6bpxe58wyzez6 X-Rspamd-Queue-Id: 9123D4000D X-Rspamd-Server: rspam11 X-HE-Tag: 1725941789-452249 X-HE-Meta: U2FsdGVkX18Qq3djAdB/hDjGpx6ruXfXLhXKyYiuuiUuCu0PwuO4DQIHSOgK+AHHm4vqGaQ4uAn1DOV3xtgB+hmf1nGojoaTcBQcEUaDU1j1x0/Hcm0DJl+P9il7Qg6qxEOWCZZlTiU819oXcykU2pwqyFRS41P/a4wT6oSedzRGBMAVqauEZ2e8wmexQJ81StLjvd/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Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: A FS DAX page is considered idle when its refcount drops to one. This is currently open-coded in all file systems supporting FS DAX. Move the idle detection to a common function to make future changes easier. Signed-off-by: Alistair Popple Reviewed-by: Jan Kara Reviewed-by: Christoph Hellwig Reviewed-by: Dan Williams --- fs/ext4/inode.c | 5 +---- fs/fuse/dax.c | 4 +--- fs/xfs/xfs_inode.c | 4 +--- include/linux/dax.h | 8 ++++++++ 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 941c1c0..367832a 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3923,10 +3923,7 @@ int ext4_break_layouts(struct inode *inode) if (!page) return 0; - error = ___wait_var_event(&page->_refcount, - atomic_read(&page->_refcount) == 1, - TASK_INTERRUPTIBLE, 0, 0, - ext4_wait_dax_page(inode)); + error = dax_wait_page_idle(page, ext4_wait_dax_page, inode); } while (error == 0); return error; diff --git a/fs/fuse/dax.c b/fs/fuse/dax.c index 12ef91d..da50595 100644 --- a/fs/fuse/dax.c +++ b/fs/fuse/dax.c @@ -676,9 +676,7 @@ static int __fuse_dax_break_layouts(struct inode *inode, bool *retry, return 0; *retry = true; - return ___wait_var_event(&page->_refcount, - atomic_read(&page->_refcount) == 1, TASK_INTERRUPTIBLE, - 0, 0, fuse_wait_dax_page(inode)); + return dax_wait_page_idle(page, fuse_wait_dax_page, inode); } /* dmap_end == 0 leads to unmapping of whole file */ diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 7dc6f32..7e27ba1 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -3071,9 +3071,7 @@ xfs_break_dax_layouts( return 0; *retry = true; - return ___wait_var_event(&page->_refcount, - atomic_read(&page->_refcount) == 1, TASK_INTERRUPTIBLE, - 0, 0, xfs_wait_dax_page(inode)); + return dax_wait_page_idle(page, xfs_wait_dax_page, inode); } int diff --git a/include/linux/dax.h b/include/linux/dax.h index 9d3e332..773dfc4 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -213,6 +213,14 @@ int dax_zero_range(struct inode *inode, loff_t pos, loff_t len, bool *did_zero, int dax_truncate_page(struct inode *inode, loff_t pos, bool *did_zero, const struct iomap_ops *ops); +static inline int dax_wait_page_idle(struct page *page, + void (cb)(struct inode *), + struct inode *inode) +{ + return ___wait_var_event(page, page_ref_count(page) == 1, + TASK_INTERRUPTIBLE, 0, 0, cb(inode)); +} + #if IS_ENABLED(CONFIG_DAX) int dax_read_lock(void); void dax_read_unlock(int id);