From mboxrd@z Thu Jan 1 00:00:00 1970 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 3DE8AE7719E for ; Mon, 13 Jan 2025 05:48:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BA9D76B0083; Mon, 13 Jan 2025 00:48:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B32816B0088; Mon, 13 Jan 2025 00:48:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 938516B0089; Mon, 13 Jan 2025 00:48:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 6C14F6B0083 for ; Mon, 13 Jan 2025 00:48:48 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 1C1EB121B94 for ; Mon, 13 Jan 2025 05:48:48 +0000 (UTC) X-FDA: 83001349536.09.389E716 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2066.outbound.protection.outlook.com [40.107.236.66]) by imf09.hostedemail.com (Postfix) with ESMTP id 1D07F14000A for ; Mon, 13 Jan 2025 05:48:44 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=Mzg08LgE; spf=pass (imf09.hostedemail.com: domain of apopple@nvidia.com designates 40.107.236.66 as permitted sender) smtp.mailfrom=apopple@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1736747325; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=nyLBBxDHcOb9935DJaPURz+sg3QRC7hdeLrMTbZsnQk=; b=W/N7Tj5MfagqVkF6m80J7EP21UZs2VjlEwis0lv9fN5F1JRljJxmLfKvFKk6LsPi802V8F Tr5OutCYhjxGnG4FiaPJowzZXcDOSB8PTc51ZBKQw4uH8u6vvCWhwU9dl1yd+mC2xUGxVI 2Am8IZ8Dg5sxmOcrIIJDiWkhn0H0hXQ= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1736747325; a=rsa-sha256; cv=pass; b=wH2Q/GUOu/2UInhbDLnezjvAs1EzKYaptOjIo0wKrqyw3JpjXUmCrnfEZEDOEcxuTRfcCA YbuU5AUFuUWAm+8YGT6f6/v6HoPLm/yZS0d13TuRuPfbEnAYwSuAdk7Z+snH/Db0XrbUPT lJXvzbNFISsIjvYJTUkds2bG5J7uUzM= ARC-Authentication-Results: i=2; imf09.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=Mzg08LgE; spf=pass (imf09.hostedemail.com: domain of apopple@nvidia.com designates 40.107.236.66 as permitted sender) smtp.mailfrom=apopple@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector10001:i=1") ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=cNB5QhAgTWkkkcRv4zPKaQ2RJdELFIiblnOHAJbubudL3LKW/4TSv9kOExawWFrNxQc6upeVb+fL2pOl1dbe4nuRU4rwItkV+LACrdHGnKJdLX0xlQFXLSIRmJ7SqPRiBLoNoQWPwiO72ztX0D5MP0mooNsmpwj6oatX1Z3DESPoe9qEOXLUtEMpQ6h6QHzWm9sjy1gy5HJiZtw23je1uZFjdLx3OE3wp5Ghux+07wQGBewXF8VWwSd8qyebyqg4cw+2YvLsTR404imWeeY94IDJLOUTBJ9DVdBLDYNtnc5xZEGz/pzUYlQVVXdaDV1mHAhEqO8AXiaD4hX5J3izqQ== 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=nyLBBxDHcOb9935DJaPURz+sg3QRC7hdeLrMTbZsnQk=; b=U0Iuz/6eM0NevbolWOCwIa3XJyVKikulCvMaOfD5JlwpK15kkon6HbcF8F6DXwkmCUX6ovGrRExK/s9TSxeO8H6BdkERzrxQ4Xj7r3G+kuNDYXfBz1lvn3IyOwLMY6euyB9ZPWcJzbYBZAIGGxfLD7D5NQ3xjF0ADdSPKfBFHZA8hVfknrgI38U64+rm+dz2d1tDzfrycPMZ6H8JShyO8L5d1draDYreee7NF/f2EugnPADsTm1Hogb3zKXoaG9FrdPZvVl4KWzVUMUXkYJmloJoukSdlC8bdcokuwjVhKHJFo1Zc8KQkoQ+FnLE+2oaKSj8mwu4JKfzVdZSRvkKzg== 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=nyLBBxDHcOb9935DJaPURz+sg3QRC7hdeLrMTbZsnQk=; b=Mzg08LgEdIXt43i3LqpEaVmIlh/H/XC9aOWT8H/P51nAQr71giXe8IDF2splDyMigHwJ9M62cYhHWBiP8LSsHQ4q4Hih+Gz0/HDKnIEb2qwmK13ku089OwYKvoluxorPjO0aM+Qfd15MgkIgkI3WIieSNCGrS7m1jkMMP6MmeLivNnZ+T4ehSWCVXFfdkfVWILFf2j4cI8P5yEvVsFGXPOOC2FUmoh2iIVqNWU17ebOJCIMtvWkarnyeNTqE11oT7lbQ+/Zc7rQHAvPrF4119okt1vQsqpV7U3LbMoH4SH3PqT6sF/uWb7Or9I9dHN+F9frbHtipRcQ1XYPxrNyjrw== Received: from DS0PR12MB7726.namprd12.prod.outlook.com (2603:10b6:8:130::6) by DS0PR12MB9446.namprd12.prod.outlook.com (2603:10b6:8:192::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8335.18; Mon, 13 Jan 2025 05:48:42 +0000 Received: from DS0PR12MB7726.namprd12.prod.outlook.com ([fe80::953f:2f80:90c5:67fe]) by DS0PR12MB7726.namprd12.prod.outlook.com ([fe80::953f:2f80:90c5:67fe%7]) with mapi id 15.20.8335.015; Mon, 13 Jan 2025 05:48:41 +0000 Date: Mon, 13 Jan 2025 16:48:31 +1100 From: Alistair Popple To: "Darrick J. Wong" Cc: akpm@linux-foundation.org, dan.j.williams@intel.com, linux-mm@kvack.org, alison.schofield@intel.com, lina@asahilina.net, zhang.lyra@gmail.com, gerald.schaefer@linux.ibm.com, 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, 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, chenhuacai@kernel.org, kernel@xen0n.name, loongarch@lists.linux.dev Subject: Re: [PATCH v6 07/26] fs/dax: Ensure all pages are idle prior to filesystem unmount Message-ID: References: <704662ae360abeb777ed00efc6f8f232a79ae4ff.1736488799.git-series.apopple@nvidia.com> <20250110165019.GK6156@frogsfrogsfrogs> <20250113024940.GW1306365@frogsfrogsfrogs> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250113024940.GW1306365@frogsfrogsfrogs> X-ClientProxiedBy: SY5PR01CA0038.ausprd01.prod.outlook.com (2603:10c6:10:1f8::17) To DS0PR12MB7726.namprd12.prod.outlook.com (2603:10b6:8:130::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR12MB7726:EE_|DS0PR12MB9446:EE_ X-MS-Office365-Filtering-Correlation-Id: c7395742-a74b-406a-6f2d-08dd3395ef48 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|7416014|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?VZlBBq5u1aZHCvb1bbWN0/Ks3S0FrFr+EwnRhjCPRvmou9yATlShZORvbbjE?= =?us-ascii?Q?IvxyyB4uf3SbJbzgOHk8ogxNv3JMaA4ywHnFZXNGShZAF925ppCPG7BeUh3x?= =?us-ascii?Q?0h/mlG/Xwp2nz1FEDbw56fzO+FT5k4onVHJeCeEda8OzIqbhWjypsntevEUG?= =?us-ascii?Q?F47WtBw1ELESko3Y2Vrbu/CBL9qboe8Zs/SGrXD8eRj1uccXC+K+Zy8EfF53?= =?us-ascii?Q?KgigDfEpSKwB7U0rFAPhCnOD6EoB/pAB6IwOB0kbFhDIIcSSOAVy3PVJhqWM?= =?us-ascii?Q?ia0Ib6VnhyrdgpBrJ0eU8srNCBbSVO1Oa1SpYxnGAyBzFz70AUdSKXVdN+cI?= =?us-ascii?Q?iFi1VoGSUFTW6s4sHcIQ6AV+YHnUAFBgErf7iCmLU7+ulxqYeNROZcNOvfOS?= =?us-asc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rPXYekr8quF?= =?us-ascii?Q?mUSYPQovZG66iP3OeCaYYNZ5Uf8Dg3LF29iJ6JkhBOxJByyrez3nfSG5icjX?= =?us-ascii?Q?NH5RLLLJzRKVanQlrbhBPfqraG3X?= 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)(1800799024)(366016)(7416014)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?vX/WYsjz3sYB/cUQfHKWGkDztq09QdiRjD6wIuKoY2ckoaFa6bNpzIqDpWVt?= =?us-ascii?Q?OkNZnf4MXuaj8gBRzVAj51ssEyqDfPCsOYlzrlMHRgeTXyYGNhBkprW5RTgl?= =?us-ascii?Q?4lvZ0SiquhivCKL/+IP9HaTPMKMzpGcpNMR/uupIInjiCGX67hPK0N+kEFpH?= =?us-ascii?Q?DMoz9xT1BTQ9NWMGnN6os62xMHNQJOjTNBYV7c4DBRP8F+oanqLvBCXJVCZL?= =?us-ascii?Q?FCznK46t69+cgbifS3WdJYSroiL9pI21umnuVeUNYXGTwWJdKZ2OodzVA3JJ?= =?us-ascii?Q?5f+CQW2nsgO/nW+Wsp4Pit5PJKD41gGm8in4ILmozJ4FzT20Aic7hcLiMjn+?= =?us-ascii?Q?Ns/c4HCtvNo44oUDw357UdotrpLg252C52+s5GiYemv2MWDHLym1sa5yxyjy?= =?us-ascii?Q?G0MtLrYfz9JAeJ97K9FiWS4v2jHy7LGmUGnllkyfY5G8II+uS+FrU9Wmq4bm?= =?us-ascii?Q?osnb+sskFad9CdaTFZmHKfUsr7z3pbarSFM+uxWwgrvVcB2sjoiO7qKka4aH?= =?us-ascii?Q?PJMnxMLVoE/KzlDRiFHz5aBKX2CpM7XnqS0lwSklN4uMQ7DVLmL8BDqNvyCy?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7Fj8be4T5fJAyR1k43xzhP6zL0Sj0TV2F16Dc5aw?= =?us-ascii?Q?Qwa9PGI5IcJqZbygsUUnpYS+Ko6u0xB7WRfbgQXM/mCLU8vARkyI8Tga+WcM?= =?us-ascii?Q?/sweEY/py7NJccRLusphg0Y40WB0frqbqZ4LmcXO?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: c7395742-a74b-406a-6f2d-08dd3395ef48 X-MS-Exchange-CrossTenant-AuthSource: DS0PR12MB7726.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jan 2025 05:48:41.9184 (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: 6PJYgRrkhtmF0bArM7LdV/HOhMSea/V1XZ391hMIt15xnleulnW+oDlJ1SYdhXsS/etbIwYblRph36qsCJaqaQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB9446 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 1D07F14000A X-Stat-Signature: wacrkjy6x8az81ttox5bp9tik697hmdt X-Rspam-User: X-HE-Tag: 1736747324-798475 X-HE-Meta: U2FsdGVkX1/y80FuCAZOT+AJspBipPstbgqYk96WUjuBDM6/1jbWn5FT5bzw9TWy4FTwuHAL7dCGp07DoIV7GrftnSGdG+Gvo7CDs90w/+E0DtxT8x0SiAZIwYQrD/g3HarddqTsdJvO2QuUOEZ9Or/jizkWIVY/TYVkxsSSqqwWsgkGnb+Z9thxI3UQ0Dbui1/19uitErQ8JSzVRSXKUOiTAVFBIvKFwalsG9zwp/0NslGNrMhB8ygWupw5cA22Bj2zcj96qvwnBwvCOMS5QbN0/EjjDzcjZ+B9ppLx2JoIxVLZ2hrtWRVk+coN1OVd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hjCJoVcwPY+15nvppjLu92V4dJ2JH9LutJAFhx95N3+B6P+A1z+A= 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: List-Subscribe: List-Unsubscribe: On Sun, Jan 12, 2025 at 06:49:40PM -0800, Darrick J. Wong wrote: > On Mon, Jan 13, 2025 at 11:57:18AM +1100, Alistair Popple wrote: > > On Fri, Jan 10, 2025 at 08:50:19AM -0800, Darrick J. Wong wrote: > > > On Fri, Jan 10, 2025 at 05:00:35PM +1100, Alistair Popple wrote: > > > > File systems call dax_break_mapping() prior to reallocating file > > > > system blocks to ensure the page is not undergoing any DMA or other > > > > accesses. Generally this is needed when a file is truncated to ensure > > > > that if a block is reallocated nothing is writing to it. However > > > > filesystems currently don't call this when an FS DAX inode is evicted. > > > > > > > > This can cause problems when the file system is unmounted as a page > > > > can continue to be under going DMA or other remote access after > > > > unmount. This means if the file system is remounted any truncate or > > > > other operation which requires the underlying file system block to be > > > > freed will not wait for the remote access to complete. Therefore a > > > > busy block may be reallocated to a new file leading to corruption. > > > > > > > > Signed-off-by: Alistair Popple > > > > > > > > --- > > > > > > > > Changes for v5: > > > > > > > > - Don't wait for pages to be idle in non-DAX mappings > > > > --- > > > > fs/dax.c | 29 +++++++++++++++++++++++++++++ > > > > fs/ext4/inode.c | 32 ++++++++++++++------------------ > > > > fs/xfs/xfs_inode.c | 9 +++++++++ > > > > fs/xfs/xfs_inode.h | 1 + > > > > fs/xfs/xfs_super.c | 18 ++++++++++++++++++ > > > > include/linux/dax.h | 2 ++ > > > > 6 files changed, 73 insertions(+), 18 deletions(-) > > > > > > > > diff --git a/fs/dax.c b/fs/dax.c > > > > index 7008a73..4e49cc4 100644 > > > > --- a/fs/dax.c > > > > +++ b/fs/dax.c > > > > @@ -883,6 +883,14 @@ static int wait_page_idle(struct page *page, > > > > TASK_INTERRUPTIBLE, 0, 0, cb(inode)); > > > > } > > > > > > > > +static void wait_page_idle_uninterruptible(struct page *page, > > > > + void (cb)(struct inode *), > > > > + struct inode *inode) > > > > +{ > > > > + ___wait_var_event(page, page_ref_count(page) == 1, > > > > + TASK_UNINTERRUPTIBLE, 0, 0, cb(inode)); > > > > +} > > > > + > > > > /* > > > > * Unmaps the inode and waits for any DMA to complete prior to deleting the > > > > * DAX mapping entries for the range. > > > > @@ -911,6 +919,27 @@ int dax_break_mapping(struct inode *inode, loff_t start, loff_t end, > > > > } > > > > EXPORT_SYMBOL_GPL(dax_break_mapping); > > > > > > > > +void dax_break_mapping_uninterruptible(struct inode *inode, > > > > + void (cb)(struct inode *)) > > > > +{ > > > > + struct page *page; > > > > + > > > > + if (!dax_mapping(inode->i_mapping)) > > > > + return; > > > > + > > > > + do { > > > > + page = dax_layout_busy_page_range(inode->i_mapping, 0, > > > > + LLONG_MAX); > > > > + if (!page) > > > > + break; > > > > + > > > > + wait_page_idle_uninterruptible(page, cb, inode); > > > > + } while (true); > > > > + > > > > + dax_delete_mapping_range(inode->i_mapping, 0, LLONG_MAX); > > > > +} > > > > +EXPORT_SYMBOL_GPL(dax_break_mapping_uninterruptible); > > > > + > > > > /* > > > > * Invalidate DAX entry if it is clean. > > > > */ > > > > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > > > > index ee8e83f..fa35161 100644 > > > > --- a/fs/ext4/inode.c > > > > +++ b/fs/ext4/inode.c > > > > @@ -163,6 +163,18 @@ int ext4_inode_is_fast_symlink(struct inode *inode) > > > > (inode->i_size < EXT4_N_BLOCKS * 4); > > > > } > > > > > > > > +static void ext4_wait_dax_page(struct inode *inode) > > > > +{ > > > > + filemap_invalidate_unlock(inode->i_mapping); > > > > + schedule(); > > > > + filemap_invalidate_lock(inode->i_mapping); > > > > +} > > > > + > > > > +int ext4_break_layouts(struct inode *inode) > > > > +{ > > > > + return dax_break_mapping_inode(inode, ext4_wait_dax_page); > > > > +} > > > > + > > > > /* > > > > * Called at the last iput() if i_nlink is zero. > > > > */ > > > > @@ -181,6 +193,8 @@ void ext4_evict_inode(struct inode *inode) > > > > > > > > trace_ext4_evict_inode(inode); > > > > > > > > + dax_break_mapping_uninterruptible(inode, ext4_wait_dax_page); > > > > + > > > > if (EXT4_I(inode)->i_flags & EXT4_EA_INODE_FL) > > > > ext4_evict_ea_inode(inode); > > > > if (inode->i_nlink) { > > > > @@ -3902,24 +3916,6 @@ int ext4_update_disksize_before_punch(struct inode *inode, loff_t offset, > > > > return ret; > > > > } > > > > > > > > -static void ext4_wait_dax_page(struct inode *inode) > > > > -{ > > > > - filemap_invalidate_unlock(inode->i_mapping); > > > > - schedule(); > > > > - filemap_invalidate_lock(inode->i_mapping); > > > > -} > > > > - > > > > -int ext4_break_layouts(struct inode *inode) > > > > -{ > > > > - struct page *page; > > > > - int error; > > > > - > > > > - if (WARN_ON_ONCE(!rwsem_is_locked(&inode->i_mapping->invalidate_lock))) > > > > - return -EINVAL; > > > > - > > > > - return dax_break_mapping_inode(inode, ext4_wait_dax_page); > > > > -} > > > > - > > > > /* > > > > * ext4_punch_hole: punches a hole in a file by releasing the blocks > > > > * associated with the given offset and length > > > > diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c > > > > index 4410b42..c7ec5ab 100644 > > > > --- a/fs/xfs/xfs_inode.c > > > > +++ b/fs/xfs/xfs_inode.c > > > > @@ -2997,6 +2997,15 @@ xfs_break_dax_layouts( > > > > return dax_break_mapping_inode(inode, xfs_wait_dax_page); > > > > } > > > > > > > > +void > > > > +xfs_break_dax_layouts_uninterruptible( > > > > + struct inode *inode) > > > > +{ > > > > + xfs_assert_ilocked(XFS_I(inode), XFS_MMAPLOCK_EXCL); > > > > + > > > > + dax_break_mapping_uninterruptible(inode, xfs_wait_dax_page); > > > > +} > > > > + > > > > int > > > > xfs_break_layouts( > > > > struct inode *inode, > > > > diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h > > > > index c4f03f6..613797a 100644 > > > > --- a/fs/xfs/xfs_inode.h > > > > +++ b/fs/xfs/xfs_inode.h > > > > @@ -594,6 +594,7 @@ xfs_itruncate_extents( > > > > } > > > > > > > > int xfs_break_dax_layouts(struct inode *inode); > > > > +void xfs_break_dax_layouts_uninterruptible(struct inode *inode); > > > > int xfs_break_layouts(struct inode *inode, uint *iolock, > > > > enum layout_break_reason reason); > > > > > > > > diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c > > > > index 8524b9d..73ec060 100644 > > > > --- a/fs/xfs/xfs_super.c > > > > +++ b/fs/xfs/xfs_super.c > > > > @@ -751,6 +751,23 @@ xfs_fs_drop_inode( > > > > return generic_drop_inode(inode); > > > > } > > > > > > > > +STATIC void > > > > +xfs_fs_evict_inode( > > > > + struct inode *inode) > > > > +{ > > > > + struct xfs_inode *ip = XFS_I(inode); > > > > + uint iolock = XFS_IOLOCK_EXCL | XFS_MMAPLOCK_EXCL; > > > > + > > > > + if (IS_DAX(inode)) { > > > > + xfs_ilock(ip, iolock); > > > > + xfs_break_dax_layouts_uninterruptible(inode); > > > > + xfs_iunlock(ip, iolock); > > > > > > If we're evicting the inode, why is it necessary to take i_rwsem and the > > > mmap invalidation lock? Shouldn't the evicting thread be the only one > > > with access to this inode? > > > > Hmm, good point. I think you're right. I can easily stop taking > > XFS_IOLOCK_EXCL. Not taking XFS_MMAPLOCK_EXCL is slightly more difficult because > > xfs_wait_dax_page() expects it to be taken. Do you think it is worth creating a > > separate callback (xfs_wait_dax_page_unlocked()?) specifically for this path or > > would you be happy with a comment explaining why we take the XFS_MMAPLOCK_EXCL > > lock here? > > There shouldn't be any other threads removing "pages" from i_mapping > during eviction, right? If so, I think you can just call schedule() > directly from dax_break_mapping_uninterruptble. Oh right, and I guess you are saying the same would apply to ext4 so no need to cycle the filemap lock there either, which I've just noticed is buggy anyway. So I can just remove the callback entirely for dax_break_mapping_uninterruptible. > (dax mappings aren't allowed supposed to persist beyond unmount / > eviction, just like regular pagecache, right??) Right they're not *supposed* to, but until at least this patch is applied they can ;-) - Alistair > --D > > > - Alistair > > > > > --D > > > > > > > + } > > > > + > > > > + truncate_inode_pages_final(&inode->i_data); > > > > + clear_inode(inode); > > > > +} > > > > + > > > > static void > > > > xfs_mount_free( > > > > struct xfs_mount *mp) > > > > @@ -1189,6 +1206,7 @@ static const struct super_operations xfs_super_operations = { > > > > .destroy_inode = xfs_fs_destroy_inode, > > > > .dirty_inode = xfs_fs_dirty_inode, > > > > .drop_inode = xfs_fs_drop_inode, > > > > + .evict_inode = xfs_fs_evict_inode, > > > > .put_super = xfs_fs_put_super, > > > > .sync_fs = xfs_fs_sync_fs, > > > > .freeze_fs = xfs_fs_freeze, > > > > diff --git a/include/linux/dax.h b/include/linux/dax.h > > > > index ef9e02c..7c3773f 100644 > > > > --- a/include/linux/dax.h > > > > +++ b/include/linux/dax.h > > > > @@ -274,6 +274,8 @@ static inline int __must_check dax_break_mapping_inode(struct inode *inode, > > > > { > > > > return dax_break_mapping(inode, 0, LLONG_MAX, cb); > > > > } > > > > +void dax_break_mapping_uninterruptible(struct inode *inode, > > > > + void (cb)(struct inode *)); > > > > int dax_dedupe_file_range_compare(struct inode *src, loff_t srcoff, > > > > struct inode *dest, loff_t destoff, > > > > loff_t len, bool *is_same, > > > > -- > > > > git-series 0.9.1 > > > > > >