[Cluster-devel] [PATCH v2 12/19] btrfs: Convert btrfs_migratepage to migrate_folio

2022-06-08 Thread Matthew Wilcox (Oracle)
Use filemap_migrate_folio() to do the bulk of the work, and then copy the ordered flag across if needed. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/btrfs/inode.c | 26 +- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/fs

[Cluster-devel] [PATCH v2 16/19] hugetlb: Convert to migrate_folio

2022-06-08 Thread Matthew Wilcox (Oracle)
This involves converting migrate_huge_page_move_mapping(). We also need a folio variant of hugetlb_set_page_subpool(), but that's for a later patch. Signed-off-by: Matthew Wilcox (Oracle) --- fs/hugetlbfs/inode.c| 23 ++- include/linux/migrate.h | 6 +++--- mm

[Cluster-devel] [PATCH v2 07/19] mm/migrate: Convert expected_page_refs() to folio_expected_refs()

2022-06-08 Thread Matthew Wilcox (Oracle)
Now that both callers have a folio, convert this function to take a folio & rename it. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- mm/migrate.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/mm/migrate.c b/mm/migra

[Cluster-devel] [PATCH v2 10/19] mm/migrate: Convert migrate_page() to migrate_folio()

2022-06-08 Thread Matthew Wilcox (Oracle)
Convert all callers to pass a folio. Most have the folio already available. Switch all users from aops->migratepage to aops->migrate_folio. Also turn the documentation into kerneldoc. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- drivers/gpu/drm/i9

[Cluster-devel] [PATCH v2 14/19] f2fs: Convert to filemap_migrate_folio()

2022-06-08 Thread Matthew Wilcox (Oracle)
filemap_migrate_folio() fits f2fs's needs perfectly. Signed-off-by: Matthew Wilcox (Oracle) --- fs/f2fs/checkpoint.c | 4 +--- fs/f2fs/data.c | 40 +--- fs/f2fs/f2fs.h | 4 fs/f2fs/node.c | 4 +--- 4 files changed, 3 insertions

[Cluster-devel] [PATCH v2 00/19] Convert aops->migratepage to aops->migrate_folio

2022-06-08 Thread Matthew Wilcox (Oracle)
the conversions of balloon, zsmalloc and z3fold - Fix the build errors with hugetlbfs - Fix the kerneldoc errors - Fix the ;; typo Matthew Wilcox (Oracle) (19): secretmem: Remove isolate_page mm: Convert all PageMovable users to movable_operations fs: Add aops->migrate_folio m

[Cluster-devel] [PATCH v2 08/19] btrfs: Convert btree_migratepage to migrate_folio

2022-06-08 Thread Matthew Wilcox (Oracle)
Use a folio throughout this function. migrate_page() will be converted later. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig --- fs/btrfs/disk-io.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs

[Cluster-devel] [PATCH v2 11/19] mm/migrate: Add filemap_migrate_folio()

2022-06-08 Thread Matthew Wilcox (Oracle)
There is nothing iomap-specific about iomap_migratepage(), and it fits a pattern used by several other filesystems, so move it to mm/migrate.c, convert it to be filemap_migrate_folio() and convert the iomap filesystems to use it. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph

Re: [Cluster-devel] [PATCH 14/20] hugetlb: Convert to migrate_folio

2022-06-07 Thread Matthew Wilcox
On Tue, Jun 07, 2022 at 02:13:26PM +0800, kernel test robot wrote: >fs/hugetlbfs/inode.c: In function 'hugetlbfs_migrate_folio': > >> fs/hugetlbfs/inode.c:990:17: error: implicit declaration of function > >> 'folio_migrate_copy' [-Werror=implicit-function-declaration] > 990 |

Re: [Cluster-devel] [PATCH 04/20] mm/migrate: Convert buffer_migrate_page() to buffer_migrate_folio()

2022-06-07 Thread Matthew Wilcox
On Tue, Jun 07, 2022 at 11:37:45AM +0800, kernel test robot wrote: > All warnings (new ones prefixed by >>): > > >> mm/migrate.c:775: warning: expecting prototype for > >> buffer_migrate_folio_noref(). Prototype was for > >> buffer_migrate_folio_norefs() instead No good deed (turning

Re: [Cluster-devel] [PATCH 15/20] balloon: Convert to migrate_folio

2022-06-07 Thread Matthew Wilcox
On Tue, Jun 07, 2022 at 09:36:21AM +0200, David Hildenbrand wrote: > On 06.06.22 22:40, Matthew Wilcox (Oracle) wrote: > > const struct address_space_operations balloon_aops = { > > - .migratepage = balloon_page_migrate, > > + .migrate_folio = balloon_migrate_folio,

Re: [Cluster-devel] [PATCH 05/20] mm/migrate: Convert expected_page_refs() to folio_expected_refs()

2022-06-07 Thread Matthew Wilcox
On Tue, Jun 07, 2022 at 09:41:57AM -0400, Brian Foster wrote: > On Mon, Jun 06, 2022 at 09:40:35PM +0100, Matthew Wilcox (Oracle) wrote: > > -static int expected_page_refs(struct address_space *mapping, struct page > > *page) > > +static int folio_expected_refs(struct a

[Cluster-devel] [PATCH 05/20] mm/migrate: Convert expected_page_refs() to folio_expected_refs()

2022-06-06 Thread Matthew Wilcox (Oracle)
Now that both callers have a folio, convert this function to take a folio & rename it. Signed-off-by: Matthew Wilcox (Oracle) --- mm/migrate.c | 19 --- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 77b8c662c9ca..e0a593e5

[Cluster-devel] [PATCH 07/20] nfs: Convert to migrate_folio

2022-06-06 Thread Matthew Wilcox (Oracle)
Use a folio throughout this function. migrate_page() will be converted later. Signed-off-by: Matthew Wilcox (Oracle) --- fs/nfs/file.c | 4 +--- fs/nfs/internal.h | 6 -- fs/nfs/write.c| 16 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/fs/nfs

[Cluster-devel] [PATCH 14/20] hugetlb: Convert to migrate_folio

2022-06-06 Thread Matthew Wilcox (Oracle)
This involves converting migrate_huge_page_move_mapping(). We also need a folio variant of hugetlb_set_page_subpool(), but that's for a later patch. Signed-off-by: Matthew Wilcox (Oracle) --- fs/hugetlbfs/inode.c| 19 ++- include/linux/migrate.h | 6 +++--- mm/migrate.c

[Cluster-devel] [PATCH 16/20] secretmem: Convert to migrate_folio

2022-06-06 Thread Matthew Wilcox (Oracle)
This is little more than changing the types over; there's no real work being done in this function. Signed-off-by: Matthew Wilcox (Oracle) --- mm/secretmem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/secretmem.c b/mm/secretmem.c index 206ed6b40c1d

[Cluster-devel] [PATCH 20/20] mm/folio-compat: Remove migration compatibility functions

2022-06-06 Thread Matthew Wilcox (Oracle)
migrate_page_move_mapping(), migrate_page_copy() and migrate_page_states() are all now unused after converting all the filesystems from aops->migratepage() to aops->migrate_folio(). Signed-off-by: Matthew Wilcox (Oracle) --- include/linux/migrate.h | 11 --- mm/folio-compat.c

[Cluster-devel] [PATCH 06/20] btrfs: Convert btree_migratepage to migrate_folio

2022-06-06 Thread Matthew Wilcox (Oracle)
Use a folio throughout this function. migrate_page() will be converted later. Signed-off-by: Matthew Wilcox (Oracle) --- fs/btrfs/disk-io.c | 22 ++ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index 12b11e645c14

[Cluster-devel] [PATCH 10/20] btrfs: Convert btrfs_migratepage to migrate_folio

2022-06-06 Thread Matthew Wilcox (Oracle)
Use filemap_migrate_folio() to do the bulk of the work, and then copy the ordered flag across if needed. Signed-off-by: Matthew Wilcox (Oracle) --- fs/btrfs/inode.c | 26 +- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/fs/btrfs/inode.c b/fs/btrfs

[Cluster-devel] [PATCH 08/20] mm/migrate: Convert migrate_page() to migrate_folio()

2022-06-06 Thread Matthew Wilcox (Oracle)
Convert all callers to pass a folio. Most have the folio already available. Switch all users from aops->migratepage to aops->migrate_folio. Also turn the documentation into kerneldoc. Signed-off-by: Matthew Wilcox (Oracle) --- drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 4 +-- fs

[Cluster-devel] [PATCH 02/20] mm/migrate: Convert fallback_migrate_page() to fallback_migrate_folio()

2022-06-06 Thread Matthew Wilcox (Oracle)
Use a folio throughout. migrate_page() will be converted to migrate_folio() later. Signed-off-by: Matthew Wilcox (Oracle) --- mm/migrate.c | 19 +-- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 75cb6aa38988..d772ce63d7e2

[Cluster-devel] [PATCH 04/20] mm/migrate: Convert buffer_migrate_page() to buffer_migrate_folio()

2022-06-06 Thread Matthew Wilcox (Oracle)
Use a folio throughout __buffer_migrate_folio(), add kernel-doc for buffer_migrate_folio() and buffer_migrate_folio_norefs(), move their declarations to buffer.h and switch all filesystems that have wired them up. Signed-off-by: Matthew Wilcox (Oracle) --- block/fops.c| 2

[Cluster-devel] [PATCH 01/20] fs: Add aops->migrate_folio

2022-06-06 Thread Matthew Wilcox (Oracle)
Provide a folio-based replacement for aops->migratepage. Update the documentation to document migrate_folio instead of migratepage. Signed-off-by: Matthew Wilcox (Oracle) --- Documentation/filesystems/locking.rst | 5 ++-- Documentation/filesystems/vfs.rst | 13 ++- Documentat

[Cluster-devel] [PATCH 09/20] mm/migrate: Add filemap_migrate_folio()

2022-06-06 Thread Matthew Wilcox (Oracle)
There is nothing iomap-specific about iomap_migratepage(), and it fits a pattern used by several other filesystems, so move it to mm/migrate.c, convert it to be filemap_migrate_folio() and convert the iomap filesystems to use it. Signed-off-by: Matthew Wilcox (Oracle) --- fs/gfs2/aops.c

[Cluster-devel] [PATCH 17/20] z3fold: Convert to migrate_folio

2022-06-06 Thread Matthew Wilcox (Oracle)
z3fold doesn't really use folios, but it needs to be called like this in order to migrate an individual page. Convert from a folio back to a page until we decide how to handle migration better for z3fold. Signed-off-by: Matthew Wilcox (Oracle) --- mm/z3fold.c | 8 +--- 1 file changed, 5

[Cluster-devel] [PATCH 18/20] zsmalloc: Convert to migrate_folio

2022-06-06 Thread Matthew Wilcox (Oracle)
zsmalloc doesn't really use folios, but it needs to be called like this in order to migrate an individual page. Convert from a folio back to a page until we decide how to handle migration better for zsmalloc. Signed-off-by: Matthew Wilcox (Oracle) --- mm/zsmalloc.c | 8 +--- 1 file changed

[Cluster-devel] [PATCH 13/20] aio: Convert to migrate_folio

2022-06-06 Thread Matthew Wilcox (Oracle)
Use a folio throughout this function. Signed-off-by: Matthew Wilcox (Oracle) --- fs/aio.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/fs/aio.c b/fs/aio.c index 3c249b938632..a1911e86859c 100644 --- a/fs/aio.c +++ b/fs/aio.c

[Cluster-devel] [PATCH 11/20] ubifs: Convert to filemap_migrate_folio()

2022-06-06 Thread Matthew Wilcox (Oracle)
filemap_migrate_folio() is a little more general than ubifs really needs, but it's better to share the code. Signed-off-by: Matthew Wilcox (Oracle) --- fs/ubifs/file.c | 29 ++--- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/fs/ubifs/file.c b/fs/ubifs

[Cluster-devel] [PATCH 12/20] f2fs: Convert to filemap_migrate_folio()

2022-06-06 Thread Matthew Wilcox (Oracle)
filemap_migrate_folio() fits f2fs's needs perfectly. Signed-off-by: Matthew Wilcox (Oracle) --- fs/f2fs/checkpoint.c | 4 +--- fs/f2fs/data.c | 40 +--- fs/f2fs/f2fs.h | 4 fs/f2fs/node.c | 4 +--- 4 files changed, 3 insertions

[Cluster-devel] [PATCH 03/20] mm/migrate: Convert writeout() to take a folio

2022-06-06 Thread Matthew Wilcox (Oracle)
Use a folio throughout this function. Signed-off-by: Matthew Wilcox (Oracle) --- mm/migrate.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index d772ce63d7e2..f19246c12fe9 100644 --- a/mm/migrate.c +++ b/mm/migrate.c

Re: [Cluster-devel] [syzbot] WARNING in folio_account_dirtied

2022-05-22 Thread Matthew Wilcox
On Sun, May 22, 2022 at 01:13:22PM -0700, syzbot wrote: > HEAD commit:ef1302160bfb Merge tag 'sound-5.18' of git://git.kernel.or.. > git tree: upstream > console output: https://syzkaller.appspot.com/x/log.txt?x=17626629f0 > kernel config:

Re: [Cluster-devel] [PATCH 3/3] fs: Change the type of filler_t

2022-05-08 Thread Matthew Wilcox
On Tue, May 03, 2022 at 07:23:13AM -0700, Christoph Hellwig wrote: > > @@ -3504,9 +3504,9 @@ static struct folio *do_read_cache_folio(struct > > address_space *mapping, > > > > filler: > > if (filler) > > - err = filler(data, >page); > > + err =

[Cluster-devel] [PATCH 0/3] Unify filler_t and read_folio

2022-05-01 Thread Matthew Wilcox (Oracle)
of the read_folio() patchset that I posted recently and can be found at git://git.infradead.org/users/willy/pagecache.git for-next Matthew Wilcox (Oracle) (3): jffs2: Pass the file pointer to jffs2_do_readpage_unlock() nfs: Pass the file pointer to nfs_symlink_filler() fs: Change the type

[Cluster-devel] [PATCH 2/3] nfs: Pass the file pointer to nfs_symlink_filler()

2022-05-01 Thread Matthew Wilcox (Oracle)
In preparation for unifying the read_cache_page() and read_folio() implementations, make nfs_symlink_filler() get the inode from the page instead of passing it in from read_cache_page(). Signed-off-by: Matthew Wilcox (Oracle) --- fs/nfs/symlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2

Re: [Cluster-devel] [REPORT] kernel BUG at fs/ext4/inode.c:2620 - page_buffers()

2022-02-17 Thread Matthew Wilcox
On Thu, Feb 17, 2022 at 09:54:30PM -0500, Theodore Ts'o wrote: > process_vm_writev() uses [un]pin_user_pages_remote() which is the same > interface uses for RDMA. But it's not clear this is ever supposed to > work for memory which is mmap'ed region backed by a file. > pin_user_pages_remote()

Re: [Cluster-devel] [PATCH 1/1] Revert "iomap: fall back to buffered writes for invalidation failures"

2022-02-14 Thread Matthew Wilcox
On Mon, Feb 14, 2022 at 02:11:46PM +, Lee Jones wrote: > On Mon, 14 Feb 2022, Christoph Hellwig wrote: > > > Let me repeat myself: Please send a proper bug report to the linux-ext4 > > list. Thanks! > > Okay, so it is valid. Question answered, thanks. > > I still believe that I am

Re: [Cluster-devel] [PATCH 1/1] Revert "iomap: fall back to buffered writes for invalidation failures"

2022-02-11 Thread Matthew Wilcox
On Thu, Feb 10, 2022 at 10:15:52AM +, Lee Jones wrote: > On Wed, 09 Feb 2022, Darrick J. Wong wrote: > > > On Wed, Feb 09, 2022 at 08:52:43AM +, Lee Jones wrote: > > > This reverts commit 60263d5889e6dc5987dc51b801be4955ff2e4aa7. > > > > > > Reverting since this commit opens a potential

Re: [Cluster-devel] [PATCH 1/1] Revert "iomap: fall back to buffered writes for invalidation failures"

2022-02-09 Thread Matthew Wilcox
On Wed, Feb 09, 2022 at 03:59:48PM +, Lee Jones wrote: > On Wed, 09 Feb 2022, Christoph Hellwig wrote: > > > On Wed, Feb 09, 2022 at 08:52:43AM +, Lee Jones wrote: > > > This reverts commit 60263d5889e6dc5987dc51b801be4955ff2e4aa7. > > > > > > Reverting since this commit opens a

Re: [Cluster-devel] [PATCH v7 03/19] gup: Turn fault_in_pages_{readable, writeable} into fault_in_{readable, writeable}

2021-09-28 Thread Matthew Wilcox
On Tue, Sep 28, 2021 at 05:02:43PM +0200, Andreas Gruenbacher wrote: > On Fri, Sep 3, 2021 at 4:57 PM Filipe Manana wrote: > > On Fri, Aug 27, 2021 at 5:52 PM Andreas Gruenbacher > > wrote: > > > +size_t fault_in_writeable(char __user *uaddr, size_t size) > > > +{ > > > + char __user

Re: [Cluster-devel] [PATCH v7 05/19] iov_iter: Introduce fault_in_iov_iter_writeable

2021-08-28 Thread Matthew Wilcox
On Sat, Aug 28, 2021 at 03:20:58PM -0700, Tony Luck wrote: > On Sat, Aug 28, 2021 at 3:12 PM Al Viro wrote: > > BTW, is #MC triggered on stored to a poisoned cacheline? Existence of > > CLZERO > > would seem to argue against that... > > No #MC on stores. Just on loads. Note that you can't

Re: [Cluster-devel] [PATCH v6 10/19] gfs2: Introduce flag for glock holder auto-demotion

2021-08-23 Thread Matthew Wilcox
On Mon, Aug 23, 2021 at 05:18:12PM +0200, Andreas Gruenbacher wrote: > On Mon, Aug 23, 2021 at 10:14 AM Steven Whitehouse > wrote: > > If the goal here is just to allow the glock to be held for a longer > > period of time, but with occasional interruptions to prevent > > starvation, then we have

Re: [Cluster-devel] [PATCH v3 2/3] iomap: Don't create iomap_page objects for inline files

2021-07-09 Thread Matthew Wilcox
On Thu, Jul 08, 2021 at 09:27:37PM -0700, Darrick J. Wong wrote: > On Wed, Jul 07, 2021 at 03:28:47PM +0100, Matthew Wilcox wrote: > > On Wed, Jul 07, 2021 at 01:55:23PM +0200, Andreas Gruenbacher wrote: > > > @@ -252,6 +253,7 @@ iomap_readpage_actor(struct inode *inode, loff_t

Re: [Cluster-devel] [PATCH v3 2/3] iomap: Don't create iomap_page objects for inline files

2021-07-07 Thread Matthew Wilcox
On Wed, Jul 07, 2021 at 01:55:23PM +0200, Andreas Gruenbacher wrote: > @@ -252,6 +253,7 @@ iomap_readpage_actor(struct inode *inode, loff_t pos, > loff_t length, void *data, > } > > /* zero post-eof blocks as the page may be mapped */ > + iop = iomap_page_create(inode, page); >

Re: [Cluster-devel] [PATCH v3 3/3] iomap: Don't create iomap_page objects in iomap_page_mkwrite_actor

2021-07-07 Thread Matthew Wilcox
On Wed, Jul 07, 2021 at 01:55:24PM +0200, Andreas Gruenbacher wrote: > Now that we create those objects in iomap_writepage_map when needed, > there's no need to pre-create them in iomap_page_mkwrite_actor anymore. > > Signed-off-by: Andreas Gruenbacher Reviewed-by: Matthew Wi

Re: [Cluster-devel] [PATCH 0/2] iomap: small block problems

2021-06-30 Thread Matthew Wilcox
eating the iop in some cases. The only current case we do that for is pages with inline data, but it can be extended to pages which are entirely within an extent. It also allows for an iop to be removed from pages in the future (eg page split). > Suggested-by: Matthew Wilcox > Signed-off-by: A

Re: [Cluster-devel] [PATCH 1/2] iomap: Don't create iomap_page objects for inline files

2021-06-30 Thread Matthew Wilcox
; > To prevent this kind of bug from occurring in the future, make sure the > page doesn't have private data attached in iomap_read_inline_data. > > Signed-off-by: Andreas Gruenbacher Reviewed-by: Matthew Wilcox (Oracle)

Re: [Cluster-devel] [PATCH 0/2] iomap: small block problems

2021-06-28 Thread Matthew Wilcox
On Mon, Jun 28, 2021 at 06:47:58PM +0100, Christoph Hellwig wrote: > On Mon, Jun 28, 2021 at 06:39:09PM +0100, Matthew Wilcox wrote: > > Not hugely happy with either of these options, tbh. I'd rather we apply > > a patch akin to this one (plucked from the folio tree), so won't a

Re: [Cluster-devel] [PATCH 0/2] iomap: small block problems

2021-06-28 Thread Matthew Wilcox
On Mon, Jun 28, 2021 at 07:27:25PM +0200, Andreas Gruenbacher wrote: > (1) In iomap_readpage_actor, an iomap_page is attached to the page even > for inline inodes. This is unnecessary because inline inodes don't need > iomap_page objects. That alone wouldn't cause any real issues, but when >

Re: [Cluster-devel] [PATCH] [RFC] Trigger retry from fault vm operation

2021-05-11 Thread Matthew Wilcox
On Tue, May 11, 2021 at 04:01:13PM +0200, Andreas Gruenbacher wrote: > we have a locking problem in gfs2 that I don't have a proper solution for, so > I'm looking for suggestions. > > What's happening is that a page fault triggers during a read or write > operation, while we're holding a glock

Re: [Cluster-devel] [RFC] MAINTAINERS tag for cleanup robot

2020-11-22 Thread Matthew Wilcox
On Sun, Nov 22, 2020 at 06:46:46AM -0800, Tom Rix wrote: > > On 11/21/20 7:23 PM, Matthew Wilcox wrote: > > On Sat, Nov 21, 2020 at 08:50:58AM -0800, t...@redhat.com wrote: > >> The fixer review is > >> https://reviews.llvm.org/D91789 > >> > >> A

Re: [Cluster-devel] [RFC] MAINTAINERS tag for cleanup robot

2020-11-21 Thread Matthew Wilcox
On Sat, Nov 21, 2020 at 08:50:58AM -0800, t...@redhat.com wrote: > The fixer review is > https://reviews.llvm.org/D91789 > > A run over allyesconfig for x86_64 finds 62 issues, 5 are false positives. > The false positives are caused by macros passed to other macros and by > some macro expansions

Re: [Cluster-devel] [PATCH RFC PKS/PMEM 33/58] fs/cramfs: Utilize new kmap_thread()

2020-10-13 Thread Matthew Wilcox
On Tue, Oct 13, 2020 at 11:44:29AM -0700, Dan Williams wrote: > On Fri, Oct 9, 2020 at 12:52 PM wrote: > > > > From: Ira Weiny > > > > The kmap() calls in this FS are localized to a single thread. To avoid > > the over head of global PKRS updates use the new kmap_thread() call. > > > > Cc:

Re: [Cluster-devel] [PATCH RFC PKS/PMEM 22/58] fs/f2fs: Utilize new kmap_thread()

2020-10-12 Thread Matthew Wilcox
On Mon, Oct 12, 2020 at 12:53:54PM -0700, Ira Weiny wrote: > On Mon, Oct 12, 2020 at 05:44:38PM +0100, Matthew Wilcox wrote: > > On Mon, Oct 12, 2020 at 09:28:29AM -0700, Dave Hansen wrote: > > > kmap_atomic() is always preferred over kmap()/kmap_thread(). > > > k

Re: [Cluster-devel] [PATCH RFC PKS/PMEM 22/58] fs/f2fs: Utilize new kmap_thread()

2020-10-12 Thread Matthew Wilcox
On Mon, Oct 12, 2020 at 09:28:29AM -0700, Dave Hansen wrote: > kmap_atomic() is always preferred over kmap()/kmap_thread(). > kmap_atomic() is _much_ more lightweight since its TLB invalidation is > always CPU-local and never broadcast. > > So, basically, unless you *must* sleep while the mapping

Re: [Cluster-devel] [PATCH RFC PKS/PMEM 22/58] fs/f2fs: Utilize new kmap_thread()

2020-10-09 Thread Matthew Wilcox
On Fri, Oct 09, 2020 at 02:34:34PM -0700, Eric Biggers wrote: > On Fri, Oct 09, 2020 at 12:49:57PM -0700, ira.we...@intel.com wrote: > > The kmap() calls in this FS are localized to a single thread. To avoid > > the over head of global PKRS updates use the new kmap_thread() call. > > > > @@

Re: [Cluster-devel] RFC: iomap write invalidation

2020-07-21 Thread Matthew Wilcox
On Tue, Jul 21, 2020 at 05:42:40PM +0200, Christoph Hellwig wrote: > On Tue, Jul 21, 2020 at 04:31:36PM +0100, Matthew Wilcox wrote: > > > Umm, no. -ENOTBLK is internal - the file systems will retry using > > > buffered I/O and the error shall never escape to userspace (

Re: [Cluster-devel] RFC: iomap write invalidation

2020-07-21 Thread Matthew Wilcox
On Tue, Jul 21, 2020 at 05:16:16PM +0200, Christoph Hellwig wrote: > On Tue, Jul 21, 2020 at 04:14:37PM +0100, Matthew Wilcox wrote: > > On Tue, Jul 21, 2020 at 05:06:15PM +0200, Christoph Hellwig wrote: > > > On Tue, Jul 21, 2020 at 04:04:32PM +0100, Matthew Wilcox wrote: >

Re: [Cluster-devel] RFC: iomap write invalidation

2020-07-21 Thread Matthew Wilcox
On Tue, Jul 21, 2020 at 05:06:15PM +0200, Christoph Hellwig wrote: > On Tue, Jul 21, 2020 at 04:04:32PM +0100, Matthew Wilcox wrote: > > I thought you were going to respin this with EREMCHG changed to ENOTBLK? > > Oh, true. I'll do that ASAP. Michael, could we add this to manpage

Re: [Cluster-devel] RFC: iomap write invalidation

2020-07-21 Thread Matthew Wilcox
On Tue, Jul 21, 2020 at 04:53:13PM +0200, Christoph Hellwig wrote: > On Mon, Jul 20, 2020 at 04:51:25PM -0500, Goldwyn Rodrigues wrote: > > Hi Christoph, > > > > On 9:46 13/07, Christoph Hellwig wrote: > > > Hi all, > > > > > > this series has two parts: the first one picks up Dave's patch to

Re: [Cluster-devel] [PATCH 2/2] iomap: fall back to buffered writes for invalidation failures

2020-07-13 Thread Matthew Wilcox
On Mon, Jul 13, 2020 at 09:46:33AM +0200, Christoph Hellwig wrote: > Failing to invalid the page cache means data in incoherent, which is > a very bad state for the system. Always fall back to buffered I/O > through the page cache if we can't invalidate mappings. Is that the right approach

Re: [Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-09 Thread Matthew Wilcox
_iter > > *iter, > > if (ret) > > goto out_free_dio; > > > > - /* > > -* Try to invalidate cache pages for the range we're direct > > -* writing. If this invalidation fails, tough, the write will > > -* still work, b

Re: [Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-08 Thread Matthew Wilcox
On Wed, Jul 08, 2020 at 06:54:12PM +0200, Christoph Hellwig wrote: > On Wed, Jul 08, 2020 at 02:54:37PM +0100, Matthew Wilcox wrote: > > Direct I/O isn't deterministic though. If the file isn't shared, then > > it works great, but as soon as you get mixed buffered and direct I/O,

Re: [Cluster-devel] always fall back to buffered I/O after invalidation failures, was: Re: [PATCH 2/6] iomap: IOMAP_DIO_RWF_NO_STALE_PAGECACHE return if page invalidation fails

2020-07-07 Thread Matthew Wilcox
On Tue, Jul 07, 2020 at 07:43:46AM -0500, Goldwyn Rodrigues wrote: > On 9:53 01/07, Christoph Hellwig wrote: > > On Mon, Jun 29, 2020 at 02:23:49PM -0500, Goldwyn Rodrigues wrote: > > > From: Goldwyn Rodrigues > > > > > > For direct I/O, add the flag IOMAP_DIO_RWF_NO_STALE_PAGECACHE to indicate

Re: [Cluster-devel] [PATCH 2/2] gfs2: Rework read and page fault locking

2020-06-19 Thread Matthew Wilcox
On Fri, Jun 19, 2020 at 11:39:16AM +0200, Andreas Gruenbacher wrote: > static int gfs2_readpage(struct file *file, struct page *page) > { > - struct address_space *mapping = page->mapping; > - struct gfs2_inode *ip = GFS2_I(mapping->host); > - struct gfs2_holder gh; > int

Re: [Cluster-devel] [PATCH v11 16/25] fs: Convert mpage_readpages to mpage_readahead

2020-06-18 Thread Matthew Wilcox
On Thu, Jun 18, 2020 at 02:46:03PM +0200, Andreas Gruenbacher wrote: > On Wed, Jun 17, 2020 at 4:22 AM Matthew Wilcox wrote: > > On Wed, Jun 17, 2020 at 02:57:14AM +0200, Andreas Grünbacher wrote: > > > Right, the approach from the following thread might fix this:

Re: [Cluster-devel] [PATCH v11 16/25] fs: Convert mpage_readpages to mpage_readahead

2020-06-16 Thread Matthew Wilcox
On Wed, Jun 17, 2020 at 02:57:14AM +0200, Andreas Grünbacher wrote: > Am Mi., 17. Juni 2020 um 02:33 Uhr schrieb Matthew Wilcox > : > > > > On Wed, Jun 17, 2020 at 12:36:13AM +0200, Andreas Gruenbacher wrote: > > > Am Mi., 15. Apr. 2020 um 23:39 Uhr schrieb Matthew W

Re: [Cluster-devel] [PATCH v11 16/25] fs: Convert mpage_readpages to mpage_readahead

2020-06-16 Thread Matthew Wilcox
On Wed, Jun 17, 2020 at 12:36:13AM +0200, Andreas Gruenbacher wrote: > Am Mi., 15. Apr. 2020 um 23:39 Uhr schrieb Matthew Wilcox > : > > From: "Matthew Wilcox (Oracle)" > > > > Implement the new readahead aop and convert all callers (block_dev, > >

Re: [Cluster-devel] [Ocfs2-devel] [PATCH 27/33] sctp: export sctp_setsockopt_bindx

2020-05-16 Thread Matthew Wilcox
On Sat, May 16, 2020 at 03:11:40PM +, David Laight wrote: > From: David Howells > > Sent: 15 May 2020 16:20 > > Christoph Hellwig wrote: > > > > > > The advantage on using kernel_setsockopt here is that sctp module will > > > > only be loaded if dlm actually creates a SCTP socket. With this

Re: [Cluster-devel] [Ocfs2-devel] remove kernel_setsockopt and kernel_getsockopt

2020-05-14 Thread Matthew Wilcox
On Thu, May 14, 2020 at 11:11:34AM +, David Laight wrote: > From: 'Christoph Hellwig' > > Sent: 14 May 2020 11:35 > > On Thu, May 14, 2020 at 10:26:41AM +, David Laight wrote: > > > From: Christoph Hellwig > > > > Only for those were we have users, and all those are covered. > > > > > >

Re: [Cluster-devel] [PATCH v11 24/25] fuse: Convert from readpages to readahead

2020-04-20 Thread Matthew Wilcox
On Mon, Apr 20, 2020 at 01:14:17PM +0200, Miklos Szeredi wrote: > > + for (;;) { > > + struct fuse_io_args *ia; > > + struct fuse_args_pages *ap; > > + > > + nr_pages = readahead_count(rac) - nr_pages; > > Hmm. I see what's going on here, but it's

Re: [Cluster-devel] [PATCH v11 05/25] mm: Add new readahead_control API

2020-04-15 Thread Matthew Wilcox
On Tue, Apr 14, 2020 at 09:56:16PM -0700, Andrew Morton wrote: > On Tue, 14 Apr 2020 19:18:08 -0700 Matthew Wilcox wrote: > > Hmm. They don't seem that big to me. > > They're really big! v5.7-rc1: 11636 636 224 1249630d0 fs/iomap/buffered-io.o readah

Re: [Cluster-devel] [PATCH v11 05/25] mm: Add new readahead_control API

2020-04-14 Thread Matthew Wilcox
On Tue, Apr 14, 2020 at 06:17:05PM -0700, Andrew Morton wrote: > On Tue, 14 Apr 2020 08:02:13 -0700 Matthew Wilcox wrote: > > From: "Matthew Wilcox (Oracle)" > > > > Filesystems which implement the upcoming ->readahead method will get > &g

[Cluster-devel] [PATCH v11 16/25] fs: Convert mpage_readpages to mpage_readahead

2020-04-14 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Implement the new readahead aop and convert all callers (block_dev, exfat, ext2, fat, gfs2, hpfs, isofs, jfs, nilfs2, ocfs2, omfs, qnx6, reiserfs & udf). The callers are all trivial except for GFS2 & OCFS2. Signed-off-by: Matthew Wilcox

[Cluster-devel] [PATCH v11 18/25] erofs: Convert uncompressed files from readpages to readahead

2020-04-14 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in erofs Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Gao Xiang Reviewed-by: William Kucharski Reviewed-by: Chao Yu --- fs/erofs/data.c | 39 +--- fs/ero

[Cluster-devel] [PATCH v11 24/25] fuse: Convert from readpages to readahead

2020-04-14 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Implement the new readahead operation in fuse by using __readahead_batch() to fill the array of pages in fuse_args_pages directly. This lets us inline fuse_readpages_fill() into fuse_readahead(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Da

[Cluster-devel] [PATCH v11 21/25] ext4: Pass the inode to ext4_mpage_readpages

2020-04-14 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This function now only uses the mapping argument to look up the inode, and both callers already have the inode, so just pass the inode instead of the mapping. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski Reviewed-by: Er

[Cluster-devel] [PATCH v11 07/25] mm: Rename various 'offset' parameters to 'index'

2020-04-14 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" The word 'offset' is used ambiguously to mean 'byte offset within a page', 'byte offset from the start of the file' and 'page offset from the start of the file'. Use 'index' to mean 'page offset from the start of the file' throughout the readahead cod

[Cluster-devel] [PATCH v11 25/25] iomap: Convert from readpages to readahead

2020-04-14 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in iomap. Convert XFS and ZoneFS to use it. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Reviewed-by: William Kucharski --- fs/iomap/buffered

[Cluster-devel] [PATCH v11 09/25] mm: Remove 'page_offset' from readahead loop

2020-04-14 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Replace the page_offset variable with 'index + i'. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: John Hubbard Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski --- mm/readahead.c | 8 +++- 1 file changed, 3 insertions(+), 5

[Cluster-devel] [PATCH v11 15/25] mm: Use memalloc_nofs_save in readahead path

2020-04-14 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Ensure that memory allocations in the readahead path do not attempt to reclaim file-backed pages, which could lead to a deadlock. It is possible, though unlikely this is the root cause of a problem observed by Cong Wang. Signed-off-by: Matthew Wilc

[Cluster-devel] [PATCH v11 06/25] mm: Use readahead_control to pass arguments

2020-04-14 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" In this patch, only between __do_page_cache_readahead() and read_pages(), but it will be extended in upcoming patches. The read_pages() function becomes aops centric, as this makes the most sense by the end of the patchset. Signed-off-by: Matthew Wilc

[Cluster-devel] [PATCH v11 08/25] mm: rename readahead loop variable to 'i'

2020-04-14 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Change the type of page_idx to unsigned long, and rename it -- it's just a loop counter, not a page index. Suggested-by: John Hubbard Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Dave Chinner Reviewed-by: William Kucharski --- mm/reada

[Cluster-devel] [PATCH v11 04/25] mm: Move readahead nr_pages check into read_pages

2020-04-14 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Simplify the callers by moving the check for nr_pages and the BUG_ON into read_pages(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Zi Yan Reviewed-by: John Hubbard Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski --- mm/r

[Cluster-devel] [PATCH v11 01/25] mm: Move readahead prototypes from mm.h

2020-04-14 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" The readahead code is part of the page cache so should be found in the pagemap.h file. force_page_cache_readahead is only used within mm, so move it to mm/internal.h instead. Remove the parameter names where they add no value, and rename the ones

[Cluster-devel] [PATCH v11 19/25] erofs: Convert compressed files from readpages to readahead

2020-04-14 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in erofs. Signed-off-by: Matthew Wilcox (Oracle) Acked-by: Gao Xiang Reviewed-by: Dave Chinner Reviewed-by: William Kucharski Reviewed-by: Chao Yu --- fs/erofs/zdata.c | 29 + 1 file

[Cluster-devel] [PATCH v11 03/25] mm: Ignore return value of ->readpages

2020-04-14 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" We used to assign the return value to a variable, which we then ignored. Remove the pretence of caring. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Christoph Hellwig Reviewed-by: Dave Chinner Reviewed-by: John Hubbard Reviewed-by: William

[Cluster-devel] [PATCH v11 00/25] Change readahead API

2020-04-14 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This series adds a readahead address_space operation to replace the readpages operation. The key difference is that pages are added to the page cache as they are allocated (and then looked up by the filesystem) instead of passing them on a list to the

[Cluster-devel] [PATCH v11 17/25] btrfs: Convert from readpages to readahead

2020-04-14 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Implement the new readahead method in btrfs using the new readahead_page_batch() function. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski --- fs/btrfs/extent_io.c | 43 --- fs/btrfs/e

[Cluster-devel] [PATCH v11 22/25] f2fs: Convert from readpages to readahead

2020-04-14 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in f2fs Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski Reviewed-by: Eric Biggers Reviewed-by: Chao Yu Acked-by: Jaegeuk Kim --- fs/f2fs/data.c

[Cluster-devel] [PATCH v11 11/25] mm: Add readahead address space operation

2020-04-14 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This replaces ->readpages with a saner interface: - Return void instead of an ignored error code. - Page cache is already populated with locked pages when ->readahead is called. - New arguments can be passed to the implementation without

[Cluster-devel] [PATCH v11 05/25] mm: Add new readahead_control API

2020-04-14 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Filesystems which implement the upcoming ->readahead method will get their pages by calling readahead_page() or readahead_page_batch(). These functions support large pages, even though none of the filesystems to be converted do yet. Signed-off-by: M

[Cluster-devel] [PATCH v11 23/25] f2fs: Pass the inode to f2fs_mpage_readpages

2020-04-14 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This function now only uses the mapping argument to look up the inode, and both callers already have the inode, so just pass the inode instead of the mapping. Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski Reviewed-by: Er

[Cluster-devel] [PATCH v11 02/25] mm: Return void from various readahead functions

2020-04-14 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" ondemand_readahead has two callers, neither of which use the return value. That means that both ra_submit and __do_page_cache_readahead() can return void, and we don't need to worry that a present page in the readahead window causes us to return a smalle

[Cluster-devel] [PATCH v11 20/25] ext4: Convert from readpages to readahead

2020-04-14 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Use the new readahead operation in ext4 Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: William Kucharski Reviewed-by: Eric Biggers --- fs/ext4/ext4.h | 3 +-- fs/ext4/inode.c| 21 + fs/ext4/readp

[Cluster-devel] [PATCH v11 10/25] mm: Put readahead pages in cache earlier

2020-04-14 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" When populating the page cache for readahead, mappings that use ->readpages must populate the page cache themselves as the pages are passed on a linked list which would normally be used for the page cache's LRU. For mappings that use ->readpage

Re: [Cluster-devel] [PATCH v10 24/25] fuse: Convert from readpages to readahead

2020-03-25 Thread Matthew Wilcox
On Wed, Mar 25, 2020 at 03:43:02PM +0100, Miklos Szeredi wrote: > > > > - while ((page = readahead_page(rac))) { > > - if (fuse_readpages_fill(, page) != 0) > > + nr_pages = min(readahead_count(rac), fc->max_pages); > > Missing fc->max_read clamp. Yeah, I

Re: [Cluster-devel] [PATCH v10 24/25] fuse: Convert from readpages to readahead

2020-03-25 Thread Matthew Wilcox
On Wed, Mar 25, 2020 at 10:42:56AM +0100, Miklos Szeredi wrote: > > + while ((page = readahead_page(rac))) { > > + if (fuse_readpages_fill(, page) != 0) > > Shouldn't this unlock + put page on error? We're certainly inconsistent between the two error exits from

[Cluster-devel] [PATCH v10 04/25] mm: Move readahead nr_pages check into read_pages

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Simplify the callers by moving the check for nr_pages and the BUG_ON into read_pages(). Signed-off-by: Matthew Wilcox (Oracle) Reviewed-by: Zi Yan Reviewed-by: John Hubbard Reviewed-by: Christoph Hellwig Reviewed-by: William Kucharski --- mm/r

[Cluster-devel] [PATCH v10 16/25] fs: Convert mpage_readpages to mpage_readahead

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" Implement the new readahead aop and convert all callers (block_dev, exfat, ext2, fat, gfs2, hpfs, isofs, jfs, nilfs2, ocfs2, omfs, qnx6, reiserfs & udf). The callers are all trivial except for GFS2 & OCFS2. Signed-off-by: Matthew Wilcox

[Cluster-devel] [PATCH v10 00/25] Change readahead API

2020-03-23 Thread Matthew Wilcox
From: "Matthew Wilcox (Oracle)" This series adds a readahead address_space operation to replace the readpages operation. The key difference is that pages are added to the page cache as they are allocated (and then looked up by the filesystem) instead of passing them on a list to the

<    1   2   3   4   5   >