David Howells
74e797d79c
mm: Provide a means of invalidation without using launder_folio
Implement a replacement for launder_folio. The key feature of
invalidate_inode_pages2() is that it locks each folio individually, unmaps
it to prevent mmap'd accesses interfering and calls the ->launder_folio()
address_space op to flush it. This has problems: firstly, each folio is
written individually as one or more small writes; secondly, adjacent folios
cannot be added so easily into the laundry; thirdly, it's yet another op to
implement.
Instead, use the invalidate lock to cause anyone wanting to add a folio to
the inode to wait, then unmap all the folios if we have mmaps, then,
conditionally, use ->writepages() to flush any dirty data back and then
discard all pages.
The invalidate lock prevents ->read_iter(), ->write_iter() and faulting
through mmap all from adding pages for the duration.
This is then used from netfslib to handle the flusing in unbuffered and
direct writes.
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Matthew Wilcox <willy@infradead.org>
cc: Miklos Szeredi <miklos@szeredi.hu>
cc: Trond Myklebust <trond.myklebust@hammerspace.com>
cc: Christoph Hellwig <hch@lst.de>
cc: Andrew Morton <akpm@linux-foundation.org>
cc: Alexander Viro <viro@zeniv.linux.org.uk>
cc: Christian Brauner <brauner@kernel.org>
cc: Jeff Layton <jlayton@kernel.org>
cc: linux-mm@kvack.org
cc: linux-fsdevel@vger.kernel.org
cc: netfs@lists.linux.dev
cc: v9fs@lists.linux.dev
cc: linux-afs@lists.infradead.org
cc: ceph-devel@vger.kernel.org
cc: linux-cifs@vger.kernel.org
cc: linux-nfs@vger.kernel.org
cc: devel@lists.orangefs.org
2024-05-01 18:07:06 +01:00
..
2024-03-04 17:01:18 -08:00
2024-03-14 17:43:30 -07:00
2023-12-05 11:17:58 +01:00
2024-02-22 10:24:41 -08:00
2024-03-11 09:38:17 -07:00
2022-08-02 12:34:03 -04:00
2023-10-25 16:47:13 -07:00
2022-09-11 20:25:50 -07:00
2024-02-22 10:24:57 -08:00
2024-02-22 10:24:57 -08:00
2024-02-22 10:24:57 -08:00
2024-03-14 17:43:30 -07:00
2024-01-08 15:27:15 -08:00
2024-02-23 17:27:13 -08:00
2024-03-06 13:04:18 -08:00
2023-04-05 19:42:38 -07:00
2023-12-05 11:17:58 +01:00
2023-06-09 16:25:56 -07:00
2023-06-23 16:59:31 -07:00
2023-06-09 16:25:23 -07:00
2022-11-22 18:50:44 -08:00
2024-05-01 18:07:06 +01:00
2023-12-29 11:58:27 -08:00
2023-06-23 16:58:19 -07:00
2022-11-08 17:37:15 -08:00
2024-04-16 15:39:48 -07:00
2023-12-29 12:22:28 -08:00
2023-08-21 13:07:20 -07:00
2024-04-16 15:39:48 -07:00
2023-10-18 14:34:17 -07:00
2023-12-12 10:57:08 -08:00
2023-10-25 16:47:14 -07:00
2024-04-25 10:07:27 -07:00
2022-10-03 14:03:05 -07:00
2023-12-12 10:11:32 +01:00
2024-04-16 15:39:48 -07:00
2023-08-18 10:12:36 -07:00
2024-03-21 14:41:00 -07:00
2024-01-22 10:31:08 +01:00
2024-03-04 17:01:26 -08:00
2023-12-12 10:57:07 -08:00
2023-12-29 11:58:56 -08:00
2024-02-22 10:24:54 -08:00
2023-04-12 17:36:23 -07:00
2024-04-16 15:39:48 -07:00
2024-03-31 11:32:26 +09:00
2023-08-24 16:20:30 -07:00
2024-02-24 15:53:40 -08:00
2024-03-04 17:01:25 -08:00
2024-03-04 17:01:21 -08:00
2024-02-22 10:24:40 -08:00
2024-04-16 15:39:50 -07:00
2024-02-22 10:24:55 -08:00
2024-04-05 11:21:31 -07:00
2024-03-06 13:04:18 -08:00
2024-03-13 18:38:13 -04:00
2023-12-29 11:58:26 -08:00
2024-03-13 12:12:21 -07:00
2023-12-29 11:58:56 -08:00
2024-02-23 17:28:43 -08:00
2023-08-21 13:07:20 -07:00
2024-03-04 17:01:22 -08:00
2024-03-06 13:04:17 -08:00
2022-10-03 14:02:43 -07:00
2021-07-23 17:43:28 -07:00
2024-03-22 10:41:13 -07:00
2024-02-22 15:27:17 -08:00
2023-08-18 10:12:41 -07:00
2023-12-12 10:57:02 -08:00
2024-02-21 16:00:03 -08:00
2023-10-18 14:34:18 -07:00
2022-09-26 19:46:25 -07:00
2024-02-23 17:48:19 -08:00
2024-03-04 17:01:16 -08:00
2024-03-14 17:43:30 -07:00
2022-09-11 20:26:01 -07:00
2023-08-18 10:12:31 -07:00
2023-01-18 17:12:52 -08:00
2023-12-29 20:22:11 -08:00
2024-03-04 17:01:27 -08:00
2024-04-16 15:39:51 -07:00
2023-12-10 16:51:50 -08:00
2024-01-08 15:27:15 -08:00
2021-06-29 10:53:47 -07:00
2023-08-24 16:20:18 -07:00
2023-12-20 14:48:12 -08:00
2024-02-23 17:48:38 -08:00
2023-12-10 16:51:53 -08:00
2023-06-19 16:19:29 -07:00
2021-07-04 18:30:17 +00:00
2022-03-08 09:30:46 -05:00
2021-07-04 18:30:17 +00:00
2023-12-14 00:23:17 -08:00
2021-05-07 00:26:35 -07:00
2023-08-18 10:12:25 -07:00
2023-12-10 16:51:39 -08:00
2024-02-22 10:24:47 -08:00
2024-03-04 17:01:19 -08:00
2024-02-22 15:27:20 -08:00
2022-10-03 14:03:05 -07:00
2023-08-21 13:38:02 -07:00
2024-03-26 11:07:23 -07:00
2024-04-16 15:39:51 -07:00
2024-01-08 15:27:15 -08:00
2023-10-04 10:32:26 -07:00
2024-01-05 09:58:32 -08:00
2022-10-03 14:03:07 -07:00
2024-01-08 15:27:15 -08:00
2024-03-14 18:03:09 -07:00
2024-03-12 10:16:56 +01:00
2024-03-12 10:16:56 +01:00
2023-08-18 10:12:53 -07:00
2024-02-21 16:00:01 -08:00
2022-10-03 14:03:36 -07:00
2024-02-22 10:24:54 -08:00
2024-03-04 17:01:26 -08:00
2024-03-12 13:07:16 -07:00
2024-02-20 14:20:48 -08:00
2024-03-14 17:43:30 -07:00
2023-12-10 16:51:42 -08:00
2023-04-12 17:36:23 -07:00
2024-03-26 11:07:23 -07:00
2024-03-14 17:43:30 -07:00
2024-04-05 11:21:30 -07:00
2023-11-28 14:08:38 +01:00
2024-03-14 17:43:30 -07:00
2024-01-08 15:27:15 -08:00
2024-02-21 11:36:50 +05:30
2024-02-23 17:48:31 -08:00
2023-06-19 16:19:27 -07:00
2023-06-19 16:19:27 -07:00
2024-03-04 17:01:28 -08:00
2024-04-24 19:34:26 -07:00