Lift the 256 outstanding NFS read/write request limit.
Subsystems (2)
PATCH 1/1 Lift the 256 outstanding NFS read/write request limit.
Given the previous set of patches that integrate NFS with the VM + pdflush memory control, and add mechanisms to cope with low memory conditions, the time is now ripe to rip out the 256 outstanding request limit, as well as the associated LRU list in the superblock, and the nfs_flushd daemon.
The following patch offers a 30% speed increase on my test setup with 512MB of core memory (iozone using 4 threads each writing a 512MB file over 100Mbit to a Solaris server). Setting mem=64m, I still see a 2-3% speed increase.
Cheers,
Trond
fs/nfs/Makefile +1 -1
@@ -4,7 +4,7 @@ obj-$(CONFIG_NFS_FS) += nfs.o -nfs-y := dir.o file.o flushd.o inode.o nfs2xdr.o pagelist.o \ +nfs-y := dir.o file.o inode.o nfs2xdr.o pagelist.o \ proc.o read.o symlink.o unlink.o write.o nfs-$(CONFIG_ROOT_NFS) += nfsroot.o mount_clnt.o nfs-$(CONFIG_NFS_V3) += nfs3proc.o nfs3xdr.o
fs/nfs/flushd.c +0 -200
200 lines not on this page · raw message
fs/nfs/inode.c +0 -23
@@ -29,7 +29,6 @@#include <linux/nfs_fs.h> #include <linux/nfs_mount.h> #include <linux/nfs4_mount.h> -#include <linux/nfs_flushd.h> #include <linux/lockd/bind.h> #include <linux/smp_lock.h> #include <linux/seq_file.h>
@@ -147,18 +146,9 @@struct nfs_server *server =NFS_SB (sb);struct rpc_clnt *rpc; -/* -* First get rid of the request flushing daemon. -* Relies on rpc_shutdown_client() waiting on all -* client tasks to finish. -*/ -nfs_reqlist_exit (server); -if ((rpc = server->client) !=NULL )rpc_shutdown_client (rpc); -nfs_reqlist_free (server); -if (!(server->flags &NFS_MOUNT_NONLM ))lockd_down ();/* release rpc.lockd */ rpciod_down ();/* release rpciod */
@@ -262,10 +252,6 @@ sb->s_magic =NFS_SUPER_MAGIC ; sb->s_op = &nfs_sops; -INIT_LIST_HEAD (&server->lru_read); -INIT_LIST_HEAD (&server->lru_dirty); -INIT_LIST_HEAD (&server->lru_commit); -INIT_LIST_HEAD (&server->lru_busy);/* Did getting the root inode fail? */ root_inode =nfs_get_root (sb, &server->fh);
@@ -333,22 +319,13 @@if (sb->s_maxbytes >MAX_LFS_FILESIZE ) sb->s_maxbytes =MAX_LFS_FILESIZE ; -/* Fire up the writeback cache */ -if (nfs_reqlist_alloc (server) <0 ) { -printk (KERN_NOTICE "NFS: cannot initialize writeback cache.\n" ); - goto failure_kill_reqlist; - } -/* We're airborne Set socket buffersize */ rpc_setbufsize (server->client, server->wsize +100 , server->rsize +100 );return 0 ;/* Yargs. It didn't work out. */ -failure_kill_reqlist: -nfs_reqlist_exit (server); out_free_all:if (root_inode)iput (root_inode); -nfs_reqlist_free (server);return -EINVAL ; out_no_root:printk ("nfs_read_super: get root inode failed\n" );
fs/nfs/pagelist.c +4 -185
255 lines not on this page · raw message
fs/nfs/read.c +0 -1
@@ -28,7 +28,6 @@#include <linux/sunrpc/clnt.h> #include <linux/nfs_fs.h> #include <linux/nfs_page.h> -#include <linux/nfs_flushd.h> #include <linux/smp_lock.h> #include <asm/system.h>
fs/nfs/write.c +0 -137
185 lines not on this page · raw message
include/linux/nfs_flushd.h +0 -61
61 lines not on this page · raw message
include/linux/nfs_fs.h +0 -9
@@ -53,10 +53,6 @@* The upper limit on timeouts for the exponential backoff algorithm. */ #define NFS_MAX_RPC_TIMEOUT (6*HZ) -#define NFS_READ_DELAY (2*HZ) -#define NFS_WRITEBACK_DELAY (5*HZ) -#define NFS_WRITEBACK_LOCKDELAY (60*HZ) -#define NFS_COMMIT_DELAY (5*HZ)/* * Size of the lookup cache in units of number of entries cached.
@@ -198,7 +194,6 @@#define NFS_SERVER (inode) (NFS_SB(inode->i_sb))#define NFS_CLIENT (inode) (NFS_SERVER(inode)->client)#define NFS_PROTO (inode) (NFS_SERVER(inode)->rpc_ops) -#define NFS_REQUESTLIST (inode) (NFS_SERVER(inode)->rw_requests)#define NFS_ADDR (inode) (RPC_PEERADDR(NFS_CLIENT(inode)))#define NFS_CONGESTED (inode) (RPC_CONGESTED(NFS_CLIENT(inode)))#define NFS_COOKIEVERF (inode) (NFS_I(inode)->cookieverf)
@@ -338,13 +333,9 @@extern int nfs_sync_file (struct inode *,struct file *,unsigned long ,unsigned int ,int );extern int nfs_flush_file (struct inode *,struct file *,unsigned long ,unsigned int ,int );extern int nfs_flush_list (struct list_head *,int ,int ); -extern int nfs_scan_lru_dirty (struct nfs_server *,struct list_head *); -extern int nfs_scan_lru_dirty_timeout (struct nfs_server *,struct list_head *);#if defined(CONFIG_NFS_V3 ) || defined(CONFIG_NFS_V4 )extern int nfs_commit_file (struct inode *,struct file *,unsigned long ,unsigned int ,int );extern int nfs_commit_list (struct list_head *,int ); -extern int nfs_scan_lru_commit (struct nfs_server *,struct list_head *); -extern int nfs_scan_lru_commit_timeout (struct nfs_server *,struct list_head *);#else static inline int nfs_commit_file(struct inode *inode, struct file *file, unsigned long offset,
include/linux/nfs_fs_sb.h +0 -5
@@ -25,11 +25,6 @@unsigned int acdirmax;unsigned int namelen;char * hostname;/* remote hostname */ -struct nfs_reqlist * rw_requests;/* async read/write requests */ -struct list_head lru_read, - lru_dirty, - lru_commit, - lru_busy;struct nfs_fh fh;struct sockaddr_in addr;#if CONFIG_NFS_V4
include/linux/nfs_page.h +1 -25
@@ -23,15 +23,13 @@#define PG_BUSY 0struct nfs_page { -struct list_head wb_lru,/* superblock lru list */ - wb_list,/* Defines state of page: */ +struct list_head wb_list,/* Defines state of page: */ *wb_list_head;/* read/write/commit */ struct file *wb_file;struct inode *wb_inode;struct rpc_cred *wb_cred;struct page *wb_page;/* page to read in/write out */ wait_queue_head_t wb_wait;/* wait queue */ -unsigned long wb_timeout;/* when to read/write/commit */ unsigned long wb_index;/* Offset within mapping */ unsigned int wb_offset,/* Offset within page */ wb_bytes, /* Length of request */
@@ -52,8 +50,6 @@extern void nfs_list_add_request (struct nfs_page *,struct list_head *); -extern int nfs_scan_lru (struct list_head *,struct list_head *,int ); -extern int nfs_scan_lru_timeout (struct list_head *,struct list_head *,int );extern int nfs_scan_list (struct list_head *,struct list_head *,struct file *,unsigned long ,unsigned int ); extern int nfs_coalesce_requests(struct list_head *, struct list_head *,
@@ -124,24 +120,4 @@ return list_entry(head, struct nfs_page, wb_list); } -static inline void -__nfs_add_lru (struct list_head *head,struct nfs_page *req) -{ -list_add_tail (&req->wb_lru, head); -} - -static inline void -__nfs_del_lru (struct nfs_page *req) -{ -if (list_empty (&req->wb_lru)) -return ; -list_del_init (&req->wb_lru); -} - -static inline struct nfs_page * -nfs_lru_entry (struct list_head *head) -{ - return list_entry(head, struct nfs_page, wb_lru); -} -#endif /* _LINUX_NFS_PAGE_H */