Make NFS-Client readahead tunable
Subsystems (2)
----- Original Message ----
Quoted 60 lines
From: Michael Trimarchi <[email protected]>
To: Martin Knoblauch <[email protected]>; linux-nfs list <[email protected]>
Cc: [email protected]
Sent: Wednesday, September 17, 2008 3:42:30 PM
Subject: Re: [RFC][Resend] Make NFS-Client readahead tunableHi,
...
Quoted 23 lines
Signed-off-by Martin Knoblauchdiff -urp
linux-2.6.27-rc6-git4/fs/nfs/client.clinux-2.6.27-rc6-git4-nfs_ra/fs/nfs/client.c
---linux-2.6.27-rc6-git4/fs/nfs/client.c2008-09-17 11:35:21.000000000
+0200
+++linux-2.6.27-rc6-git4-nfs_ra/fs/nfs/client.c2008-09-17
11:55:18.000000000 +0200(quoted diff) +5
-0@@ -722,6 +722,11 @@ error: } /* + * NFS Client Read-Ahead factor +*/ +unsigned int nfs_ra_factor; + +/* * Load up the server record from information gained in an fsinfo record */static void nfs_server_set_fsinfo(struct
nfs_server*server, structnfs_fsinfo*fsinfo)
Review static void nfs_server_set_fsinfo(struct · line 750
Quoted 5 lines
(quoted diff) +0
-1@@ -746,7 +751,11 @@ static void nfs_server_set_fsinfo(struct server->rsize = NFS_MAX_FILE_IO_SIZE; server->rpages = (server->rsize + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; - server->backing_dev_info.ra_pages = server->rpages *
NFS_MAX_READAHEAD;Quoted 21 lines
(quoted diff) +5
-0+ dprintk("nfs_server_set_fsinfo: rsize, wsize, rpages, \ + nfs_ra_factor, ra_pages: %d %d %d %d %d\n", + server->rsize,server->wsize,server->rpages, + nfs_ra_factor,server->rpages * nfs_ra_factor); + server->backing_dev_info.ra_pages = server->rpages * nfs_ra_factor; if (server->wsize > max_rpc_payload)server->wsize = max_rpc_payload;diff -urp
linux-2.6.27-rc6-git4/fs/nfs/inode.clinux-2.6.27-rc6-git4-nfs_ra/fs/nfs/inode.c
---linux-2.6.27-rc6-git4/fs/nfs/inode.c2008-09-17 11:35:21.000000000
+0200
+++linux-2.6.27-rc6-git4-nfs_ra/fs/nfs/inode.c2008-09-17 11:45:09.000000000 +0200(quoted diff) +2
-0@@ -53,6 +53,8 @@ /* Default is to see 64-bit inode numbers */ static int enable_ino64 = NFS_64_BIT_INODE_NUMBERS_ENABLED; +static unsigned int ra_factor __read_mostly = NFS_MAX_READAHEAD; +
Quoted 16 lines
Review static int __init init_nfs_fs(void) · line 1357
Quoted 12 lines
(quoted diff) +6
-0static void nfs_invalidate_inode(struct inode *); static int nfs_update_inode(struct inode *, struct nfs_fattr *);@@ -1347,6 +1349,12 @@ static int __init init_nfs_fs(void) #endif if ((err = register_nfs_fs()) != 0) goto out; + + if (ra_factor < 1 || ra_factor > NFS_MAX_READAHEAD) + nfs_ra_factor = NFS_MAX_READAHEAD; + else + nfs_ra_factor = ra_factor; +So, I think that this is not necessary because it is done ( ... I hope) by the
proc_dointvec_minmaxhandler. It is correct?
That is of course true if the tunable is changed via the /proc interface. The code above handles the module parameter, which is not governed by the minmax handler.
Cheers
Martin