linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] afs: Enable multipage folio support
@ 2022-02-25 23:53 David Howells
  2022-02-26  7:37 ` kernel test robot
  2022-04-02 22:42 ` Matthew Wilcox
  0 siblings, 2 replies; 6+ messages in thread
From: David Howells @ 2022-02-25 23:53 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: dhowells, jlayton, Marc Dionne, linux-afs, linux-fsdevel,
	linux-mm, linux-kernel

Enable multipage folio support for the afs filesystem.  This is on top of
Matthew Wilcox's for-next branch.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Matthew Wilcox <willy@infradead.org>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
---
 fs/afs/inode.c |    2 ++
 fs/afs/write.c |    2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/afs/inode.c b/fs/afs/inode.c
index 5964f8aee090..7dc7eb5f8e63 100644
--- a/fs/afs/inode.c
+++ b/fs/afs/inode.c
@@ -96,12 +96,14 @@ static int afs_inode_init_from_status(struct afs_operation *op,
 		inode->i_op	= &afs_file_inode_operations;
 		inode->i_fop	= &afs_file_operations;
 		inode->i_mapping->a_ops	= &afs_file_aops;
+		mapping_set_large_folios(inode->i_mapping);
 		break;
 	case AFS_FTYPE_DIR:
 		inode->i_mode	= S_IFDIR |  (status->mode & S_IALLUGO);
 		inode->i_op	= &afs_dir_inode_operations;
 		inode->i_fop	= &afs_dir_file_operations;
 		inode->i_mapping->a_ops	= &afs_dir_aops;
+		mapping_set_large_folios(inode->i_mapping);
 		break;
 	case AFS_FTYPE_SYMLINK:
 		/* Symlinks with a mode of 0644 are actually mountpoints. */
diff --git a/fs/afs/write.c b/fs/afs/write.c
index 5e9157d0da29..d6cc0fa44316 100644
--- a/fs/afs/write.c
+++ b/fs/afs/write.c
@@ -91,7 +91,7 @@ int afs_write_begin(struct file *file, struct address_space *mapping,
 			goto flush_conflicting_write;
 	}
 
-	*_page = &folio->page;
+	*_page = folio_file_page(folio, pos / PAGE_SIZE);
 	_leave(" = 0");
 	return 0;
 

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] afs: Enable multipage folio support
  2022-02-25 23:53 [PATCH] afs: Enable multipage folio support David Howells
@ 2022-02-26  7:37 ` kernel test robot
  2022-04-02 22:42 ` Matthew Wilcox
  1 sibling, 0 replies; 6+ messages in thread
From: kernel test robot @ 2022-02-26  7:37 UTC (permalink / raw)
  To: David Howells, Matthew Wilcox
  Cc: kbuild-all, dhowells, jlayton, Marc Dionne, linux-afs,
	linux-fsdevel, linux-mm, linux-kernel

Hi David,

I love your patch! Yet something to improve:

[auto build test ERROR on dhowells-fs/fscache-next]
[also build test ERROR on linux/master linus/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/David-Howells/afs-Enable-multipage-folio-support/20220226-075436
base:   https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git fscache-next
config: i386-randconfig-a005 (https://download.01.org/0day-ci/archive/20220226/202202261524.4tAqmT0a-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://github.com/0day-ci/linux/commit/91637acf6da0c809e1bedc59696d6bc0a8604f03
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review David-Howells/afs-Enable-multipage-folio-support/20220226-075436
        git checkout 91637acf6da0c809e1bedc59696d6bc0a8604f03
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 O=build_dir ARCH=i386 SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>, old ones prefixed by <<):

>> ERROR: modpost: "PageHeadHuge" [fs/afs/kafs.ko] undefined!

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] afs: Enable multipage folio support
  2022-02-25 23:53 [PATCH] afs: Enable multipage folio support David Howells
  2022-02-26  7:37 ` kernel test robot
@ 2022-04-02 22:42 ` Matthew Wilcox
  1 sibling, 0 replies; 6+ messages in thread
From: Matthew Wilcox @ 2022-04-02 22:42 UTC (permalink / raw)
  To: David Howells
  Cc: jlayton, Marc Dionne, linux-afs, linux-fsdevel, linux-mm, linux-kernel

On Fri, Feb 25, 2022 at 11:53:46PM +0000, David Howells wrote:
> Enable multipage folio support for the afs filesystem.  This is on top of
> Matthew Wilcox's for-next branch.
> 
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: Matthew Wilcox <willy@infradead.org>
> cc: Marc Dionne <marc.dionne@auristor.com>
> cc: linux-afs@lists.infradead.org

I can't say that I've audited AFS for its correct use of folios
everywhere, but since you've tested it, I have no objections:

Acked-by: Matthew Wilcox (Oracle) <willy@infradead.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] afs: Enable multipage folio support
@ 2022-08-10 17:52 David Howells
  0 siblings, 0 replies; 6+ messages in thread
From: David Howells @ 2022-08-10 17:52 UTC (permalink / raw)
  To: torvalds
  Cc: dhowells, Matthew Wilcox, Marc Dionne, Jeff Layton, linux-afs,
	linux-fsdevel, linux-kernel

Hi Linus,

Can you apply this please?  It enables multipage folios for afs.  Support has
already been implemented in netfslib, fscache and cachefiles and in most of
afs, but I've waited for the VM side to stabilise.

Note that it does require a change to afs_write_begin() to return the correct
subpage.  This is a "temporary" change as we're working on getting rid of the
need for ->write_begin() and ->write_end() completely, at least as far as
network filesystems are concerned - but it doesn't prevent afs from making use
of the capability.

Thanks,
David
---
Enable multipage folio support for the afs filesystem.  This makes use of
Matthew Wilcox's latest folio changes.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Tested-by: kafs-testing@auristor.com
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Link: https://lore.kernel.org/lkml/2274528.1645833226@warthog.procyon.org.uk/
---
 fs/afs/inode.c |    2 ++
 fs/afs/write.c |    2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/afs/inode.c b/fs/afs/inode.c
index 64dab70d4a4f..6d3a3dbe4928 100644
--- a/fs/afs/inode.c
+++ b/fs/afs/inode.c
@@ -104,12 +104,14 @@ static int afs_inode_init_from_status(struct afs_operation *op,
 		inode->i_op	= &afs_file_inode_operations;
 		inode->i_fop	= &afs_file_operations;
 		inode->i_mapping->a_ops	= &afs_file_aops;
+		mapping_set_large_folios(inode->i_mapping);
 		break;
 	case AFS_FTYPE_DIR:
 		inode->i_mode	= S_IFDIR |  (status->mode & S_IALLUGO);
 		inode->i_op	= &afs_dir_inode_operations;
 		inode->i_fop	= &afs_dir_file_operations;
 		inode->i_mapping->a_ops	= &afs_dir_aops;
+		mapping_set_large_folios(inode->i_mapping);
 		break;
 	case AFS_FTYPE_SYMLINK:
 		/* Symlinks with a mode of 0644 are actually mountpoints. */
diff --git a/fs/afs/write.c b/fs/afs/write.c
index 2c885b22de34..9ebdd36eaf2f 100644
--- a/fs/afs/write.c
+++ b/fs/afs/write.c
@@ -91,7 +91,7 @@ int afs_write_begin(struct file *file, struct address_space *mapping,
 			goto flush_conflicting_write;
 	}
 
-	*_page = &folio->page;
+	*_page = folio_file_page(folio, pos / PAGE_SIZE);
 	_leave(" = 0");
 	return 0;
 

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] afs: Enable multipage folio support
@ 2022-04-03 17:38 David Howells
  0 siblings, 0 replies; 6+ messages in thread
From: David Howells @ 2022-04-03 17:38 UTC (permalink / raw)
  To: torvalds
  Cc: Matthew Wilcox (Oracle),
	kafs-testing, Marc Dionne, linux-afs, dhowells, linux-fsdevel,
	linux-kernel

Enable multipage folio support for the afs filesystem.  This makes use of
Matthew Wilcox's latest folio changes.

Signed-off-by: David Howells <dhowells@redhat.com>
Acked-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Tested-by: kafs-testing@auristor.com
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
Link: https://lore.kernel.org/lkml/2274528.1645833226@warthog.procyon.org.uk/
---

 fs/afs/inode.c |    2 ++
 fs/afs/write.c |    2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/afs/inode.c b/fs/afs/inode.c
index 2fe402483ad5..c899977493b4 100644
--- a/fs/afs/inode.c
+++ b/fs/afs/inode.c
@@ -104,12 +104,14 @@ static int afs_inode_init_from_status(struct afs_operation *op,
 		inode->i_op	= &afs_file_inode_operations;
 		inode->i_fop	= &afs_file_operations;
 		inode->i_mapping->a_ops	= &afs_file_aops;
+		mapping_set_large_folios(inode->i_mapping);
 		break;
 	case AFS_FTYPE_DIR:
 		inode->i_mode	= S_IFDIR |  (status->mode & S_IALLUGO);
 		inode->i_op	= &afs_dir_inode_operations;
 		inode->i_fop	= &afs_dir_file_operations;
 		inode->i_mapping->a_ops	= &afs_dir_aops;
+		mapping_set_large_folios(inode->i_mapping);
 		break;
 	case AFS_FTYPE_SYMLINK:
 		/* Symlinks with a mode of 0644 are actually mountpoints. */
diff --git a/fs/afs/write.c b/fs/afs/write.c
index 6bcf1475511b..445a79db0192 100644
--- a/fs/afs/write.c
+++ b/fs/afs/write.c
@@ -91,7 +91,7 @@ int afs_write_begin(struct file *file, struct address_space *mapping,
 			goto flush_conflicting_write;
 	}
 
-	*_page = &folio->page;
+	*_page = folio_file_page(folio, pos / PAGE_SIZE);
 	_leave(" = 0");
 	return 0;
 



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] afs: Enable multipage folio support
@ 2022-04-02 22:56 David Howells
  0 siblings, 0 replies; 6+ messages in thread
From: David Howells @ 2022-04-02 22:56 UTC (permalink / raw)
  To: willy
  Cc: Marc Dionne, linux-afs, dhowells, kent.overstreet, asmadeus,
	linux-fsdevel, linux-kernel

Enable multipage folio support for the afs filesystem.  This is on top of
Matthew Wilcox's for-next branch.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: Matthew Wilcox <willy@infradead.org>
cc: Marc Dionne <marc.dionne@auristor.com>
cc: linux-afs@lists.infradead.org
---

 fs/afs/inode.c |    2 ++
 fs/afs/write.c |    2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/afs/inode.c b/fs/afs/inode.c
index 2fe402483ad5..c899977493b4 100644
--- a/fs/afs/inode.c
+++ b/fs/afs/inode.c
@@ -104,12 +104,14 @@ static int afs_inode_init_from_status(struct afs_operation *op,
 		inode->i_op	= &afs_file_inode_operations;
 		inode->i_fop	= &afs_file_operations;
 		inode->i_mapping->a_ops	= &afs_file_aops;
+		mapping_set_large_folios(inode->i_mapping);
 		break;
 	case AFS_FTYPE_DIR:
 		inode->i_mode	= S_IFDIR |  (status->mode & S_IALLUGO);
 		inode->i_op	= &afs_dir_inode_operations;
 		inode->i_fop	= &afs_dir_file_operations;
 		inode->i_mapping->a_ops	= &afs_dir_aops;
+		mapping_set_large_folios(inode->i_mapping);
 		break;
 	case AFS_FTYPE_SYMLINK:
 		/* Symlinks with a mode of 0644 are actually mountpoints. */
diff --git a/fs/afs/write.c b/fs/afs/write.c
index 6bcf1475511b..445a79db0192 100644
--- a/fs/afs/write.c
+++ b/fs/afs/write.c
@@ -91,7 +91,7 @@ int afs_write_begin(struct file *file, struct address_space *mapping,
 			goto flush_conflicting_write;
 	}
 
-	*_page = &folio->page;
+	*_page = folio_file_page(folio, pos / PAGE_SIZE);
 	_leave(" = 0");
 	return 0;
 



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-08-10 17:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-25 23:53 [PATCH] afs: Enable multipage folio support David Howells
2022-02-26  7:37 ` kernel test robot
2022-04-02 22:42 ` Matthew Wilcox
2022-04-02 22:56 David Howells
2022-04-03 17:38 David Howells
2022-08-10 17:52 David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).