Skip to contentSkip to conversation

NFS Patch for FSCache

PATCH Steve Dickson 4 participants 7 messages May 9, 2005 – Jun 13, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hello,

Attached is a patch that enables NFS to use David Howells' File System Caching implementation (FSCache). Also attached are two supplemental patches that are need to fixed two oops that were found during debugging (Note: these patches are also in people.redhat.com/steved/cachefs/2.6.12-rc3-mm3/)

2.6.12-rc3-mm3-nfs-fscache.patch - David and I have been working on this for sometime now and the code seems to be pretty solid. One issue is Trond's dislike of how the NFS code is dependent on FSCache calls. I did looking to changing this, but its not clear (at least to me) how we could make things better... But that's something that will need to be addressed.

The second issue is what we've been calling "NFS aliasing". The fact that two mounted NFS super blocks can point to the same page causes major fits for FSC. David has proposed some patches to resolve this issue that are still under review. But at this point, to stop a BUG() popping, when a second NFS filesystem is mounted, the 2.6.12-rc3-mm3-fscache-cookie-exist.patch is needed.

The final patch 2.6.12-rc3-mm3-cachefs-wb.patch is need to stop another BUG() from popping during NFS reads.

NFS uses FSC on a per-mount bases which means a new mount flag 'fsc' is need to activate the caching. Example:
mount -t nfs4 -o fsc server:/home /mnt/server/home

(Note: people.redhat.com/steved/cachefs/util-linux/ has the util-linux binary and source rpms with the fsc support).

To set up a mounted cachefs partition, first initialize the disk partition by:
echo "cachefs___" >/dev/hdg9
then mount the partition:
mount -t cachefs /dev/hdg9 /cache-hdg9

See Documentation/filesystems/caching in the kernel source for more details.

I'm hopeful that you'll added these patches to your tree so they will get some much needed testing. I'm also going to be pushing to get the caching code into a Fedora Core kernel, but due to the dependency on David's new vm_ops, page_mkwrite, this might take some time...
(Note: people.redhat.com/steved/cachefs/mmpatches has all of the current mm patches)

Comments?

steved.

This patch enables NFS to use file system caching (i.e. FSCache). To turn this feature on you must specifiy the -o fsc mount flag as well as have a cachefs partition mounted.

fs/nfs/file.c renamed from fs/nfs/file.c.orig +22 -0
@@ -27,9 +27,11 @@
 #include <linux/slab.h>
 #include <linux/pagemap.h>
 #include <linux/smp_lock.h>
+#include <linux/buffer_head.h>
 
 #include <asm/uaccess.h>
 #include <asm/system.h>
+#include "nfs-fscache.h"
 
 #include "delegation.h"
 
@@ -194,6 +196,12 @@ nfs_file_sendfile(struct file *filp, lof
 	return res;
 }
 
+static int nfs_file_page_mkwrite(struct vm_area_struct *vma, struct page *page)
+{
+	wait_on_page_fs_misc(page);
+	return 0;
+}
+
 static int
 nfs_file_mmap(struct file * file, struct vm_area_struct * vma)
 {
@@ -207,6 +215,10 @@ nfs_file_mmap(struct file * file, struct
 	status = nfs_revalidate_inode(NFS_SERVER(inode), inode);
 	if (!status)
 		status = generic_file_mmap(file, vma);
+
+	if (NFS_SERVER(inode)->flags & NFS_MOUNT_FSCACHE)
+		vma->vm_ops->page_mkwrite = nfs_file_page_mkwrite;
+
 	return status;
 }
 
@@ -258,6 +270,11 @@ static int nfs_commit_write(struct file 
 	return status;
 }
 
+/*
+ * since we use page->private for our own nefarious purposes when using fscache, we have to
+ * override extra address space ops to prevent fs/buffer.c from getting confused, even though we
+ * may not have asked its opinion
+ */
 struct address_space_operations nfs_file_aops = {
 	.readpage = nfs_readpage,
 	.readpages = nfs_readpages,
@@ -269,6 +286,11 @@ struct address_space_operations nfs_file
 #ifdef CONFIG_NFS_DIRECTIO
 	.direct_IO = nfs_direct_IO,
 #endif
+#ifdef CONFIG_NFS_FSCACHE
+	.sync_page	= block_sync_page,
+	.releasepage	= nfs_releasepage,
+	.invalidatepage	= nfs_invalidatepage,
+#endif
 };
 
 /* 
fs/nfs/inode.c renamed from fs/nfs/inode.c.orig +45 -0

129 lines not on this page · raw message

fs/nfs/Makefile renamed from fs/nfs/Makefile.orig +1 -0
@@ -13,4 +13,5 @@ nfs-$(CONFIG_NFS_V4)	+= nfs4proc.o nfs4x
 			   delegation.o idmap.o \
 			   callback.o callback_xdr.o callback_proc.o
 nfs-$(CONFIG_NFS_DIRECTIO) += direct.o
+nfs-$(CONFIG_NFS_FSCACHE) += nfs-fscache.o
 nfs-objs		:= $(nfs-y)
fs/nfs/nfs-fscache.c new file +191 -0

191 lines not on this page · raw message

fs/nfs/nfs-fscache.h new file +158 -0

158 lines not on this page · raw message

fs/nfs/read.c renamed from fs/nfs/read.c.orig +191 -1

237 lines not on this page · raw message

fs/nfs/write.c renamed from fs/nfs/write.c.orig +36 -0
@@ -255,6 +255,38 @@ static int wb_priority(struct writeback_
 }
 
 /*
+ * store an updated page in fscache
+ */
+#ifdef CONFIG_NFS_FSCACHE
+static void
+nfs_writepage_to_fscache_complete(void *cookie_data, struct page *page, void *data, int error)
+{
+	/* really need to synchronise the end of writeback, probably using a page flag */
+}
+static inline void
+nfs_writepage_to_fscache(struct inode *inode, struct page *page)
+{
+	int ret; 
+
+	dprintk("NFS: writepage_to_fscache (0x%p/0x%p/0x%p)\n",
+		NFS_I(inode)->fscache, page, inode);
+
+	ret =  fscache_write_page(NFS_I(inode)->fscache, page,
+		nfs_writepage_to_fscache_complete, NULL, GFP_KERNEL);
+	if (ret != 0) {
+		dprintk("NFS:    fscache_write_page error %d\n", ret);
+		fscache_uncache_page(NFS_I(inode)->fscache, page);
+	}
+}
+#else
+static inline void
+nfs_writepage_to_fscache(struct inode *inode, struct page *page)
+{
+	BUG();
+}
+#endif
+
+/*
  * Write an mmapped page to the server.
  */
 int nfs_writepage(struct page *page, struct writeback_control *wbc)
@@ -299,6 +331,10 @@ do_it:
 		err = -EBADF;
 		goto out;
 	}
+
+	if (NFS_SERVER(inode)->flags & NFS_MOUNT_FSCACHE)
+		nfs_writepage_to_fscache(inode, page);
+
 	lock_kernel();
 	if (!IS_SYNC(inode) && inode_referenced) {
 		err = nfs_writepage_async(ctx, inode, page, 0, offset);
fs/Kconfig renamed from fs/Kconfig.orig +7 -0
@@ -1456,6 +1456,13 @@ config NFS_V4
 
 	  If unsure, say N.
 
+config NFS_FSCACHE
+	bool "Provide NFS client caching support (EXPERIMENTAL)"
+	depends on NFS_FS && FSCACHE && EXPERIMENTAL
+	help
+	  Say Y here if you want NFS data to be cached locally on disc through
+	  the general filesystem cache manager
+
 config NFS_DIRECTIO
 	bool "Allow direct I/O on NFS files (EXPERIMENTAL)"
 	depends on NFS_FS && EXPERIMENTAL
include/linux/nfs_fs.h renamed from include/linux/nfs_fs.h.orig +7 -0
@@ -29,6 +29,7 @@
 #include <linux/nfs_xdr.h>
 #include <linux/rwsem.h>
 #include <linux/mempool.h>
+#include <linux/fscache.h>
 
 /*
  * Enable debugging support for nfs client.
@@ -184,6 +185,11 @@ struct nfs_inode {
 	int			 delegation_state;
 	struct rw_semaphore	rwsem;
 #endif /* CONFIG_NFS_V4*/
+
+#ifdef CONFIG_NFS_FSCACHE
+	struct fscache_cookie	*fscache;
+#endif
+
 	struct inode		vfs_inode;
 };
 
@@ -564,6 +570,7 @@ extern void * nfs_root_data(void);
 #define NFSDBG_FILE		0x0040
 #define NFSDBG_ROOT		0x0080
 #define NFSDBG_CALLBACK		0x0100
+#define NFSDBG_FSCACHE		0x0200
 #define NFSDBG_ALL		0xFFFF
 
 #ifdef __KERNEL__
include/linux/nfs_fs_sb.h renamed from include/linux/nfs_fs_sb.h.orig +5 -0
@@ -3,6 +3,7 @@
 
 #include <linux/list.h>
 #include <linux/backing-dev.h>
+#include <linux/fscache.h>
 
 /*
  * NFS client parameters stored in the superblock.
@@ -47,6 +48,10 @@ struct nfs_server {
 						   that are supported on this
 						   filesystem */
 #endif
+
+#ifdef CONFIG_NFS_FSCACHE
+	struct fscache_cookie	*fscache;	/* cache cookie */
+#endif
 };
 
 /* Server capabilities */
include/linux/nfs_mount.h renamed from include/linux/nfs_mount.h.orig +1 -0
@@ -61,6 +61,7 @@ struct nfs_mount_data {
 #define NFS_MOUNT_NOACL		0x0800	/* 4 */
 #define NFS_MOUNT_STRICTLOCK	0x1000	/* reserved for NFSv4 */
 #define NFS_MOUNT_SECFLAVOUR	0x2000	/* 5 */
+#define NFS_MOUNT_FSCACHE		0x3000
 #define NFS_MOUNT_FLAGMASK	0xFFFF
 
 #endif
include/linux/nfs4_mount.h renamed from include/linux/nfs4_mount.h.orig +1 -0
@@ -65,6 +65,7 @@ struct nfs4_mount_data {
 #define NFS4_MOUNT_NOCTO	0x0010	/* 1 */
 #define NFS4_MOUNT_NOAC		0x0020	/* 1 */
 #define NFS4_MOUNT_STRICTLOCK	0x1000	/* 1 */
+#define NFS4_MOUNT_FSCACHE	0x2000	/* 1 */
 #define NFS4_MOUNT_FLAGMASK	0xFFFF
 
 #endif

Fails a second NFS mount with EEXIST instead of oops.

fs/fscache/cookie.c renamed from fs/fscache/cookie.c.orig +5 -1
@@ -452,7 +452,11 @@ static int fscache_search_for_object(str
 		cache->ops->lock_node(node);
 
 		/* a node should only ever be attached to one cookie */
-		BUG_ON(!list_empty(&node->cookie_link));
+		if (!list_empty(&node->cookie_link)) {
+			cache->ops->unlock_node(node);
+			ret = -EEXIST;
+			goto error;
+		}
 
 		/* attach the node to the cache's node list */
 		if (list_empty(&node->cache_link)) {
fs/cachefs/journal.c renamed from fs/cachefs/journal.c.save +1 -0
@@ -682,6 +682,7 @@ static inline void cachefs_trans_batch_p
 		list_add_tail(&block->batch_link, plist);
 		block->writeback = block->page;
 		get_page(block->writeback);
+		SetPageWriteback(block->writeback);
 
 		/* make sure DMA can reach the data */
 		flush_dcache_page(block->writeback);
#1 lore raw
Quoted 3 lines · Steve Dickson

Attached is a patch that enables NFS to use David Howells' File System Caching implementation (FSCache).

Do you have any performance results for this?

#2 lore raw
Quoted 7 lines · Andrew Morton
Quoted 2 lines · Steve Dickson

Attached is a patch that enables NFS to use David Howells' File System Caching implementation (FSCache).

Do you have any performance results for this?

I haven't done any formal performance testing, but from the functionality testing I've done, I've seen a ~20% increase in reads speed (verses otw reads). Mainly due to the fact NFS only needs to do getattrs and such when the data is cached. But buyer beware... this a very rough number, so mileage may very. ;-)

I don't have a number for writes, (maybe David does) but I'm sure there will be a penalty to cache that data, but its something that can be improve over time.

But the real saving, imho, is the fact those reads were measured after the filesystem was umount then remounted. So system wise, there should be some gain due to the fact that NFS is not using the network....

steved.

#3 lore raw
Quoted 3 lines · Steve Dickson

But the real saving, imho, is the fact those reads were measured after the filesystem was umount then remounted. So system wise, there should be some gain due to the fact that NFS is not using the network....

I tested md5sum read speed also. My testbox is a dual 200MHz PPro. It's got 128MB of RAM. I've got a 100MB file on the NFS server for it to read.

	No Cache:	~14s
	Cold Cache:	~15s
	Warm Cache:	~2s

Now these numbers are approximate because they're from memory.

Note that a cold cache is worse than no cache because CacheFS (a) has to check the disk before NFS goes to the server, and (b) has to journal the allocations of new data blocks. It may also have to wait whilst pages are written to disk before it can get new ones rather than just dropping them (100MB is big enough wrt 128MB that this will happen) and 100MB is sufficient to cause it to start using single- and double-indirection pointers to find its blocks on disk, though these are cached in the page cache.

David

#4 lore raw
Quoted 16 lines · David Howells
Quoted 3 lines · Steve Dickson

But the real saving, imho, is the fact those reads were measured after the filesystem was umount then remounted. So system wise, there should be some gain due to the fact that NFS is not using the network....

I tested md5sum read speed also. My testbox is a dual 200MHz PPro. It's got 128MB of RAM. I've got a 100MB file on the NFS server for it to read.

	No Cache:	~14s
	Cold Cache:	~15s
	Warm Cache:	~2s

Now these numbers are approximate because they're from memory.

Quoted 7 lines

Note that a cold cache is worse than no cache because CacheFS (a) has to check the disk before NFS goes to the server, and (b) has to journal the allocations of new data blocks. It may also have to wait whilst pages are written to disk before it can get new ones rather than just dropping them (100MB is big enough wrt 128MB that this will happen) and 100MB is sufficient to cause it to start using single- and double-indirection pointers to find its blocks on disk, though these are cached in the page cache.

How big was the cachefs filesystem?

Now try reading a 1GB file over nfs..

I have found (with openafs), that I either need a really small cache, or a really big one.. The bigger the openafs cache gets, the slower it goes. The only place i run with a > 1GB openafs cache is on an imap server that has an 8gb cache for maildirs.

#5 lore raw
Quoted 1 line · Troy Benjegerdes

How big was the cachefs filesystem?

Several Gig. I don't remember how big, but the disk I tried it on is totally kaput unfortunately.

Quoted 1 line

Now try reading a 1GB file over nfs..

I'll give that a go at some point. However, I suspect that any size over twice the amount of pagecache available is going to scale fairly consistently until you start hitting the lid on the cache. I say twice because firstly you fill the pagecache with pages and start throwing them at the disk, and then you have to start on a rolling process of waiting for those to hit the disk before evicting them from the pagecache, which isn't going to get going smoothly until you've ejected the original load of pages.

Quoted 4 lines

I have found (with openafs), that I either need a really small cache, or a really big one.. The bigger the openafs cache gets, the slower it goes. The only place i run with a > 1GB openafs cache is on an imap server that has an 8gb cache for maildirs.

What filesystem underlies your OpenAFS cache? OpenAFS doesn't actually do its own file to disk management within the cache, but uses a host filesystem for that.

David

#6 lore raw
In reply to Steve Dickson

I notice that a number NFS patches when into 2.6.12-rc6-mm1 so I wanted to make sure the patches I posted, which allow NFS to use cachefs, had not become stale. It turns out they didn't and they still work as they did in rc3-mm3... But I figured I would repost them anyways in hopes to get them reviewed and accepted in the -mm tree....

steved.

This patch enables NFS to use file system caching (i.e. FSCache). To turn this feature on you must specifiy the -o fsc mount flag as well as have a cachefs partition mounted.

fs/nfs/file.c renamed from fs/nfs/file.c.orig +22 -0
@@ -27,9 +27,11 @@
 #include <linux/slab.h>
 #include <linux/pagemap.h>
 #include <linux/smp_lock.h>
+#include <linux/buffer_head.h>
 
 #include <asm/uaccess.h>
 #include <asm/system.h>
+#include "nfs-fscache.h"
 
 #include "delegation.h"
 
@@ -194,6 +196,12 @@ nfs_file_sendfile(struct file *filp, lof
 	return res;
 }
 
+static int nfs_file_page_mkwrite(struct vm_area_struct *vma, struct page *page)
+{
+	wait_on_page_fs_misc(page);
+	return 0;
+}
+
 static int
 nfs_file_mmap(struct file * file, struct vm_area_struct * vma)
 {
@@ -207,6 +215,10 @@ nfs_file_mmap(struct file * file, struct
 	status = nfs_revalidate_inode(NFS_SERVER(inode), inode);
 	if (!status)
 		status = generic_file_mmap(file, vma);
+
+	if (NFS_SERVER(inode)->flags & NFS_MOUNT_FSCACHE)
+		vma->vm_ops->page_mkwrite = nfs_file_page_mkwrite;
+
 	return status;
 }
 
@@ -258,6 +270,11 @@ static int nfs_commit_write(struct file 
 	return status;
 }
 
+/*
+ * since we use page->private for our own nefarious purposes when using fscache, we have to
+ * override extra address space ops to prevent fs/buffer.c from getting confused, even though we
+ * may not have asked its opinion
+ */
 struct address_space_operations nfs_file_aops = {
 	.readpage = nfs_readpage,
 	.readpages = nfs_readpages,
@@ -269,6 +286,11 @@ struct address_space_operations nfs_file
 #ifdef CONFIG_NFS_DIRECTIO
 	.direct_IO = nfs_direct_IO,
 #endif
+#ifdef CONFIG_NFS_FSCACHE
+	.sync_page	= block_sync_page,
+	.releasepage	= nfs_releasepage,
+	.invalidatepage	= nfs_invalidatepage,
+#endif
 };
 
 /* 
fs/nfs/inode.c renamed from fs/nfs/inode.c.orig +45 -0

129 lines not on this page · raw message

fs/nfs/Makefile renamed from fs/nfs/Makefile.orig +1 -0
@@ -13,4 +13,5 @@ nfs-$(CONFIG_NFS_V4)	+= nfs4proc.o nfs4x
 			   delegation.o idmap.o \
 			   callback.o callback_xdr.o callback_proc.o
 nfs-$(CONFIG_NFS_DIRECTIO) += direct.o
+nfs-$(CONFIG_NFS_FSCACHE) += nfs-fscache.o
 nfs-objs		:= $(nfs-y)
fs/nfs/nfs-fscache.c new file +191 -0

191 lines not on this page · raw message

fs/nfs/nfs-fscache.h new file +158 -0

158 lines not on this page · raw message

fs/nfs/read.c renamed from fs/nfs/read.c.orig +191 -1

237 lines not on this page · raw message

fs/nfs/write.c renamed from fs/nfs/write.c.orig +36 -0
@@ -255,6 +255,38 @@ static int wb_priority(struct writeback_
 }
 
 /*
+ * store an updated page in fscache
+ */
+#ifdef CONFIG_NFS_FSCACHE
+static void
+nfs_writepage_to_fscache_complete(void *cookie_data, struct page *page, void *data, int error)
+{
+	/* really need to synchronise the end of writeback, probably using a page flag */
+}
+static inline void
+nfs_writepage_to_fscache(struct inode *inode, struct page *page)
+{
+	int ret; 
+
+	dprintk("NFS: writepage_to_fscache (0x%p/0x%p/0x%p)\n",
+		NFS_I(inode)->fscache, page, inode);
+
+	ret =  fscache_write_page(NFS_I(inode)->fscache, page,
+		nfs_writepage_to_fscache_complete, NULL, GFP_KERNEL);
+	if (ret != 0) {
+		dprintk("NFS:    fscache_write_page error %d\n", ret);
+		fscache_uncache_page(NFS_I(inode)->fscache, page);
+	}
+}
+#else
+static inline void
+nfs_writepage_to_fscache(struct inode *inode, struct page *page)
+{
+	BUG();
+}
+#endif
+
+/*
  * Write an mmapped page to the server.
  */
 int nfs_writepage(struct page *page, struct writeback_control *wbc)
@@ -299,6 +331,10 @@ do_it:
 		err = -EBADF;
 		goto out;
 	}
+
+	if (NFS_SERVER(inode)->flags & NFS_MOUNT_FSCACHE)
+		nfs_writepage_to_fscache(inode, page);
+
 	lock_kernel();
 	if (!IS_SYNC(inode) && inode_referenced) {
 		err = nfs_writepage_async(ctx, inode, page, 0, offset);
fs/Kconfig renamed from fs/Kconfig.orig +7 -0
@@ -1495,6 +1495,13 @@ config NFS_V4
 
 	  If unsure, say N.
 
+config NFS_FSCACHE
+	bool "Provide NFS client caching support (EXPERIMENTAL)"
+	depends on NFS_FS && FSCACHE && EXPERIMENTAL
+	help
+	  Say Y here if you want NFS data to be cached locally on disc through
+	  the general filesystem cache manager
+
 config NFS_DIRECTIO
 	bool "Allow direct I/O on NFS files (EXPERIMENTAL)"
 	depends on NFS_FS && EXPERIMENTAL
include/linux/nfs_fs.h renamed from include/linux/nfs_fs.h.orig +7 -0
@@ -29,6 +29,7 @@
 #include <linux/nfs_xdr.h>
 #include <linux/rwsem.h>
 #include <linux/mempool.h>
+#include <linux/fscache.h>
 
 /*
  * Enable debugging support for nfs client.
@@ -184,6 +185,11 @@ struct nfs_inode {
 	int			 delegation_state;
 	struct rw_semaphore	rwsem;
 #endif /* CONFIG_NFS_V4*/
+
+#ifdef CONFIG_NFS_FSCACHE
+	struct fscache_cookie	*fscache;
+#endif
+
 	struct inode		vfs_inode;
 };
 
@@ -564,6 +570,7 @@ extern void * nfs_root_data(void);
 #define NFSDBG_FILE		0x0040
 #define NFSDBG_ROOT		0x0080
 #define NFSDBG_CALLBACK		0x0100
+#define NFSDBG_FSCACHE		0x0200
 #define NFSDBG_ALL		0xFFFF
 
 #ifdef __KERNEL__
include/linux/nfs_fs_sb.h renamed from include/linux/nfs_fs_sb.h.orig +5 -0
@@ -3,6 +3,7 @@
 
 #include <linux/list.h>
 #include <linux/backing-dev.h>
+#include <linux/fscache.h>
 
 /*
  * NFS client parameters stored in the superblock.
@@ -47,6 +48,10 @@ struct nfs_server {
 						   that are supported on this
 						   filesystem */
 #endif
+
+#ifdef CONFIG_NFS_FSCACHE
+	struct fscache_cookie	*fscache;	/* cache cookie */
+#endif
 };
 
 /* Server capabilities */
include/linux/nfs_mount.h renamed from include/linux/nfs_mount.h.orig +1 -0
@@ -61,6 +61,7 @@ struct nfs_mount_data {
 #define NFS_MOUNT_NOACL		0x0800	/* 4 */
 #define NFS_MOUNT_STRICTLOCK	0x1000	/* reserved for NFSv4 */
 #define NFS_MOUNT_SECFLAVOUR	0x2000	/* 5 */
+#define NFS_MOUNT_FSCACHE		0x3000
 #define NFS_MOUNT_FLAGMASK	0xFFFF
 
 #endif
include/linux/nfs4_mount.h renamed from include/linux/nfs4_mount.h.orig +1 -0
@@ -65,6 +65,7 @@ struct nfs4_mount_data {
 #define NFS4_MOUNT_NOCTO	0x0010	/* 1 */
 #define NFS4_MOUNT_NOAC		0x0020	/* 1 */
 #define NFS4_MOUNT_STRICTLOCK	0x1000	/* 1 */
+#define NFS4_MOUNT_FSCACHE	0x2000	/* 1 */
 #define NFS4_MOUNT_FLAGMASK	0xFFFF
 
 #endif

Fails a second NFS mount with EEXIST instead of oops.

fs/fscache/cookie.c renamed from fs/fscache/cookie.c.orig +5 -1
@@ -452,7 +452,11 @@ static int fscache_search_for_object(str
 		cache->ops->lock_node(node);
 
 		/* a node should only ever be attached to one cookie */
-		BUG_ON(!list_empty(&node->cookie_link));
+		if (!list_empty(&node->cookie_link)) {
+			cache->ops->unlock_node(node);
+			ret = -EEXIST;
+			goto error;
+		}
 
 		/* attach the node to the cache's node list */
 		if (list_empty(&node->cache_link)) {

This fixes a BUG() poping at mm/filemap.c:465 pops when reading a 100m file using nfs4.

fs/cachefs/journal.c renamed from fs/cachefs/journal.c.save +1 -0
@@ -682,6 +682,7 @@ static inline void cachefs_trans_batch_p
 		list_add_tail(&block->batch_link, plist);
 		block->writeback = block->page;
 		get_page(block->writeback);
+		SetPageWriteback(block->writeback);
 
 		/* make sure DMA can reach the data */
 		flush_dcache_page(block->writeback);