From patchwork Thu Jun 27 00:54:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Popple X-Patchwork-Id: 13713598 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 381FDC27C4F for ; Thu, 27 Jun 2024 00:55:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C87F06B009B; Wed, 26 Jun 2024 20:55:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C5E926B009C; Wed, 26 Jun 2024 20:55:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AB1066B009D; Wed, 26 Jun 2024 20:55:11 -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 8D6716B009B for ; Wed, 26 Jun 2024 20:55:11 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 123B11617A8 for ; Thu, 27 Jun 2024 00:55:11 +0000 (UTC) X-FDA: 82274849622.27.F337998 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2056.outbound.protection.outlook.com [40.107.94.56]) by imf10.hostedemail.com (Postfix) with ESMTP id 4E210C000E for ; Thu, 27 Jun 2024 00:55:08 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=RlmP65Ek; spf=pass (imf10.hostedemail.com: domain of apopple@nvidia.com designates 40.107.94.56 as permitted sender) smtp.mailfrom=apopple@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.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=1719449695; 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=RdaMrNdetBipLgCehlxgBb33ehvAEhIIAeY4qsi3ae0=; b=HLYSCFDNvzpAZkzSHsS4dR8THcOv7PqdPTZU9oEQSbyvgR+JUkmICeuaX4L/9D10pLAHiW K8THpusCsr/47MmVFZwzDSWhbt2KVmjJ0yA3fQ3efVYp/S0PI7qTAAPVe8l73X2+4nx6aa 5uvithPYbFOVVLU9MYKaMbpdxeqkn2k= ARC-Authentication-Results: i=2; imf10.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=RlmP65Ek; spf=pass (imf10.hostedemail.com: domain of apopple@nvidia.com designates 40.107.94.56 as permitted sender) smtp.mailfrom=apopple@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1719449695; a=rsa-sha256; cv=pass; b=MKM60ILhtHsjokwLJZqwKN+b4a7xVvg3YSko59zveQ45UztjRB9OgK+H31bA1Rc0zs52jg +f3nD2wnJFyjSDnxX9YKJrwErTIUTcubWEVTpN7f86aVzQOsZvmmk8JFCmS2SY11yW4LNs 50BTbVjcFh9hQc4mUL7/c4DYo06JH+c= ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J8ootAyD+RRQDwLwUyM5oBhoGdunhvskFUj8GZnBdF1Z7pTQ9uaAaAzljuDMhZDme1aTExbO36nqTYWNzoW7t8EGDzuqDkQC9S9CjRrkN/ZpCyHfbpuhgi98p3VJNciJQB06u4/LS0FIqeNN2UMEpD9jpmImEehzNWpTiBDnM09ppMuMMUFglwulH08jP6CKQZq4Fhkge5vw9h7KG9fCO92FnIEN6fljL7LesUkrM/+5qJENkL/pYGWb7KLbFKO+7im06uIR0hJ3QdZrCADBn/OQfbv/bB3q60LUfhtPQg9kV4PZpIDO09vxN7qQxeOt9nAu/O69mWpP7MJHdNP3Bw== 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=RdaMrNdetBipLgCehlxgBb33ehvAEhIIAeY4qsi3ae0=; b=a+1n3uboHk+90sJxlZlkZor8T/XkxkfbGPpHvlhAofQ920yg8eFb7gl49TsQcroORDgrmhsTeZxurU3Y/jmt26VITtL8+T6BtwL4BRmxcj12sBAADq3SWhKzqI8ObWpiV+zWnMqfbNt5Mvro80vQZL704ac9zeltWVk7xfKBDbHZ62KxnbYshTeKVwsl32FDKHuLcADYSHfvq9EnsoRxMslP1FPTJIWlQHUvT+LznXwmnc2sovtETfe+8Yss+uG4PV1eAFEuMVCf/2fClVZscSJETNrX3t9TAiXOmw+7qIXGuFDI+hvXel8IzIV9LKXrrN31eSPD6nn+yI9JTR07zQ== 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=RdaMrNdetBipLgCehlxgBb33ehvAEhIIAeY4qsi3ae0=; b=RlmP65Ek1FtwFweaFCkSQpi6VggaOAHiotdxpEFkCL0sWCkKG07A/7I8L7Wm8L27lTW0AYjw/Li9eEBlQdyKyPe+o7U2vz6dqybNJO3DAs4pZouHr10PEk/poL5h0SHXe1h/WWB7c7vexMIqFmZFKa9J4TTrucUcgf5cun9bAYcXqmbkIaHAXujHxUyWngKbNoP/ahgzciRzWbVakow82YC3zPuV+MCGUbAm8nMFiCDd9E56RFw7GkBSnk1Mf2OdsbDs+nGHLgJw2k5PMlcIuThlUP3UOxQUEdGNj1BsU46T/Y91Wz9pOfc4GNWT3Vpi2eOsnjbuFEGZalvs+60hMw== Received: from DS0PR12MB7726.namprd12.prod.outlook.com (2603:10b6:8:130::6) by MW6PR12MB7071.namprd12.prod.outlook.com (2603:10b6:303:238::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7698.32; Thu, 27 Jun 2024 00:54:54 +0000 Received: from DS0PR12MB7726.namprd12.prod.outlook.com ([fe80::953f:2f80:90c5:67fe]) by DS0PR12MB7726.namprd12.prod.outlook.com ([fe80::953f:2f80:90c5:67fe%6]) with mapi id 15.20.7698.025; Thu, 27 Jun 2024 00:54:54 +0000 From: Alistair Popple To: dan.j.williams@intel.com, vishal.l.verma@intel.com, dave.jiang@intel.com, logang@deltatee.com, bhelgaas@google.com, jack@suse.cz, jgg@ziepe.ca Cc: 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-mm@kvack.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, jhubbard@nvidia.com, hch@lst.de, david@fromorbit.com, Alistair Popple Subject: [PATCH 04/13] fs/dax: Add dax_page_free callback Date: Thu, 27 Jun 2024 10:54:19 +1000 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: X-ClientProxiedBy: SY6PR01CA0051.ausprd01.prod.outlook.com (2603:10c6:10:e9::20) To DS0PR12MB7726.namprd12.prod.outlook.com (2603:10b6:8:130::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR12MB7726:EE_|MW6PR12MB7071:EE_ X-MS-Office365-Filtering-Correlation-Id: a501ca68-d6a0-4a5e-d600-08dc9643c1dc 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: yhKbID0mpY5O1E0F7jhhF1wN+tTNgF75ty/G7gia7/PQRbzlllDdygoS7abSg20eqhDKeeJAalcGWxLbhQWV/03nHOg6Rj64HOvFDynnm8ZTlF1nOda2+1eM0/6bCg4tpxqZOcMLx4Pmt5LPD4E5bztx4AAThCds4PZlMF1vQ7i3oa0AczZdAxXrbDa5SMALVZRnRHJtvfusFfLjipjr37kY1knTe6ufLzztUrc2DczcBNaSbV1rZJggnY7f/CDRGJYu9dZNA+uaT507+EeA19IjnGVdgGdmedyUX8bY1wnyJroUINb5qa3teIxPT9U91K9Ofyxss9FoR+qOykYVq6m/uN5Dl0B1MKhJAsMyL905uLQs0vpzDEcACZNA3f8IKib8SXbJ/0yNLxHEu4uBIQJD5+vdd1G2CtW9dpbE4XcccPh99dLd3UUGciZvefrVnYlDtZvUEdokrwp1SFNya2kNWXeeMjVham0md0y4IfLxKQry6T8RSeZm4ID6uh778AbK0GyNzOZ9F9Eu4OOWeWOtXJUXzZ212X+zj75ZO/GdQ7oCcEZo+czEjgGhbXaTnT9hQON7NNhHPo0H67XZlFWWzR5wvMG9zhtkwb5RU5gHHOI88+UxwMHLC51fTaDtcodRIuMpGL3Gi/1E+cSyaH+LbNDAPTlIPymnnQsCgN7Qf54dzKMSGr1/1uRTMG16EM/Yt2igGgn1+4/6j5I44xL+1k0K1XwC2nTODXd1GrNsw8Mjb42KRB1KE3AsgwIGDfsmoC3/syllH/xVGE1TG8N3Z9jIPHaw1YRFdkKBFsKhnv/E062opJxgGy6aFEX4XchVQt8WlcklnIPyJ64ebCl+JDLqNljQJ1Zl+JR3BhhXN0Ll6B/baeMmq4BrGNetWuXwrMhRsqVA+4bLVOVov30J21GgguFpSjfNDErjDc0mocJ64ezRkP638/wINDNHiLSZwpjXN9W3YhWJqOem6A4kcFBs6B3BNeeSjkHHSDZrXp3GiOlkg42FnJrZhC4pk9SkMUx48v6oEqw2vG3IEzFnaZ9qBeiJnUnpKiIaOyxk5B4Ff0QxwrIQwCUjlFZBwD57ED9010YFhqg5QVAGbnoSPFbHRlt01alLyjgGIvn45vFdlQZ2MiRG99xWHs8z0RLHY5EXf/oA3mgwFzWzpWN86d2ONOu70ODqQeX3JC3OTzgLr4trosIk3FDtcFjAnF4Sl2eOhQOriqpkWB3Z+F7z3ZJev1nUCjx/VrksVuPKMVv6Q8UPPiydsi7bj7hnWvyMAXaaEKJ00DDOf3IWvmSlmXn1w6qfp2vZ+rHopGaMFN1AnW13aMjkgNcgmmxGEmvAF6cwlSVY+qL6rCXNag== 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: hqAKZ2kOGKIRQRgT3v95sa3KVSFkwhYhSkYqTnDmiRAmTyGCR2x14IOexjIyDcqu1udqGqKrATThwp9Blq35yM4gSpgCVTbN2k9RmGxayznt1MfJRtq0rFLS0TyQvPBTRtTezAcsK9HzjlVpcYQjVGYiGjYSysSbB5eh9xFE8pE/xFmr8aHN7Zmw1FKpkJvJjs9LS62yUgwCq6dYgYlVX0309fcFB69BD9uJxaYmg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S9sQTBbPo1Uw8JDJzZdhA2ThLmcB7sgKgwABZN3aC2DY0ytkHwBvfVihp6R7Bd/ethAcEL/RcwCpkIpJwELdS9jK90Lk23a85CM12p4NX4M739U4w2XnSqnSPXjcn/cksclfyAbShd5XeuhW6bmkGkOl1mCxW9oPQyXPwMad/e+3xXkVWsSym+WbUOwYrVPcha02t0aJFh5aBlJdjrxiwNho7qEX3+2ZfiOHqzR2uTXXnEbhgSzBEwhp7TUwLySAcB4nuN25UdLcDFF/ayJ2vAezHLZUClA+wQsOoey X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: a501ca68-d6a0-4a5e-d600-08dc9643c1dc X-MS-Exchange-CrossTenant-AuthSource: DS0PR12MB7726.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Jun 2024 00:54:54.0440 (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: jJ7K/ej0IRlpqr8wppnObRDmF9WRwpr/K80S3Lbu/T8ShxlvDA3eRpdOaq1DBJRkum4N/OI8hI6G0JrRi/6P0w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB7071 X-Stat-Signature: re6juhmenq4xkdqpbgotddjar8trdkkr X-Rspam-User: X-Rspamd-Queue-Id: 4E210C000E X-Rspamd-Server: rspam02 X-HE-Tag: 1719449708-674045 X-HE-Meta: U2FsdGVkX1+rUxRpYNy87tk3ysrrqXgWBrR5eQhx15sKtdKfzq83Y1+a0PWKCyQMVAjYPMjdnahxu5od00rzASF+pgXWSlaDnyTuk7yseOP4k2Fp2tNgRqNXytfPUrBagzKuEn8EYRjyreUGmKmZFxjwt3xlAwXYghkpR45rdt4V6Mykcz4acO07RddSQzsoUbDpeE9Dg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ests=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: When a fs dax page is freed it has to notify filesystems that the page has been unpinned/unmapped and is free. Currently this involves special code in the page free paths to detect a transition of refcount from 2 to 1 and to call some fs dax specific code. A future change will require this to happen when the page refcount drops to zero. In this case we can use the existing pgmap->ops->page_free() callback so wire that up for all devices that support FS DAX (nvdimm and virtio). Signed-off-by: Alistair Popple --- drivers/nvdimm/pmem.c | 1 + fs/dax.c | 6 ++++++ fs/fuse/virtio_fs.c | 5 +++++ include/linux/dax.h | 1 + 4 files changed, 13 insertions(+) diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index 598fe2e..cafadd0 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c @@ -444,6 +444,7 @@ static int pmem_pagemap_memory_failure(struct dev_pagemap *pgmap, static const struct dev_pagemap_ops fsdax_pagemap_ops = { .memory_failure = pmem_pagemap_memory_failure, + .page_free = dax_page_free, }; static int pmem_attach_disk(struct device *dev, diff --git a/fs/dax.c b/fs/dax.c index becb4a6..f93afd7 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -2065,3 +2065,9 @@ int dax_remap_file_range_prep(struct file *file_in, loff_t pos_in, pos_out, len, remap_flags, ops); } EXPORT_SYMBOL_GPL(dax_remap_file_range_prep); + +void dax_page_free(struct page *page) +{ + wake_up_var(page); +} +EXPORT_SYMBOL_GPL(dax_page_free); diff --git a/fs/fuse/virtio_fs.c b/fs/fuse/virtio_fs.c index 1a52a51..6e90a4b 100644 --- a/fs/fuse/virtio_fs.c +++ b/fs/fuse/virtio_fs.c @@ -909,6 +909,10 @@ static void virtio_fs_cleanup_dax(void *data) DEFINE_FREE(cleanup_dax, struct dax_dev *, if (!IS_ERR_OR_NULL(_T)) virtio_fs_cleanup_dax(_T)) +static const struct dev_pagemap_ops fsdax_pagemap_ops = { + .page_free = dax_page_free, +}; + static int virtio_fs_setup_dax(struct virtio_device *vdev, struct virtio_fs *fs) { struct dax_device *dax_dev __free(cleanup_dax) = NULL; @@ -948,6 +952,7 @@ static int virtio_fs_setup_dax(struct virtio_device *vdev, struct virtio_fs *fs) return -ENOMEM; pgmap->type = MEMORY_DEVICE_FS_DAX; + pgmap->ops = &fsdax_pagemap_ops; /* Ideally we would directly use the PCI BAR resource but * devm_memremap_pages() wants its own copy in pgmap. So diff --git a/include/linux/dax.h b/include/linux/dax.h index 773dfc4..adbafc8 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -213,6 +213,7 @@ 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); +void dax_page_free(struct page *page); static inline int dax_wait_page_idle(struct page *page, void (cb)(struct inode *), struct inode *inode)