Commit 277866a0 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Linus Torvalds

nfs: fix congestion control: use atomic_longs

Change the atomic_t in struct nfs_server to atomic_long_t in anticipation
of machines that can handle 8+TB of (4K) pages under writeback.

However I suspect other things in NFS will start going *bang* by then.
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Trond Myklebust <trond.myklebust@fys.uio.no>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 79df3c19
...@@ -224,7 +224,7 @@ static int nfs_set_page_writeback(struct page *page) ...@@ -224,7 +224,7 @@ static int nfs_set_page_writeback(struct page *page)
struct inode *inode = page->mapping->host; struct inode *inode = page->mapping->host;
struct nfs_server *nfss = NFS_SERVER(inode); struct nfs_server *nfss = NFS_SERVER(inode);
if (atomic_inc_return(&nfss->writeback) > if (atomic_long_inc_return(&nfss->writeback) >
NFS_CONGESTION_ON_THRESH) NFS_CONGESTION_ON_THRESH)
set_bdi_congested(&nfss->backing_dev_info, WRITE); set_bdi_congested(&nfss->backing_dev_info, WRITE);
} }
...@@ -237,7 +237,7 @@ static void nfs_end_page_writeback(struct page *page) ...@@ -237,7 +237,7 @@ static void nfs_end_page_writeback(struct page *page)
struct nfs_server *nfss = NFS_SERVER(inode); struct nfs_server *nfss = NFS_SERVER(inode);
end_page_writeback(page); end_page_writeback(page);
if (atomic_dec_return(&nfss->writeback) < NFS_CONGESTION_OFF_THRESH) { if (atomic_long_dec_return(&nfss->writeback) < NFS_CONGESTION_OFF_THRESH) {
clear_bdi_congested(&nfss->backing_dev_info, WRITE); clear_bdi_congested(&nfss->backing_dev_info, WRITE);
congestion_end(WRITE); congestion_end(WRITE);
} }
......
...@@ -82,7 +82,7 @@ struct nfs_server { ...@@ -82,7 +82,7 @@ struct nfs_server {
struct rpc_clnt * client_acl; /* ACL RPC client handle */ struct rpc_clnt * client_acl; /* ACL RPC client handle */
struct nfs_iostats * io_stats; /* I/O statistics */ struct nfs_iostats * io_stats; /* I/O statistics */
struct backing_dev_info backing_dev_info; struct backing_dev_info backing_dev_info;
atomic_t writeback; /* number of writeback pages */ atomic_long_t writeback; /* number of writeback pages */
int flags; /* various flags */ int flags; /* various flags */
unsigned int caps; /* server capabilities */ unsigned int caps; /* server capabilities */
unsigned int rsize; /* read size */ unsigned int rsize; /* read size */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment