aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2007-10-17 02:25:41 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-17 11:42:44 -0400
commitc4dc4beed23827e155d7cbc2a1ffa3949eddd194 (patch)
treeb7f115c159fe26b90b7e5b7d5dcf2f9318b69bf1
parent1f7d6668c29b1dfa307a44844f9bb38356fc989b (diff)
nfs: remove congestion_end()
These patches aim to improve balance_dirty_pages() and directly address three issues: 1) inter device starvation 2) stacked device deadlocks 3) inter process starvation 1 and 2 are a direct result from removing the global dirty limit and using per device dirty limits. By giving each device its own dirty limit is will no longer starve another device, and the cyclic dependancy on the dirty limit is broken. In order to efficiently distribute the dirty limit across the independant devices a floating proportion is used, this will allocate a share of the total limit proportional to the device's recent activity. 3 is done by also scaling the dirty limit proportional to the current task's recent dirty rate. This patch: nfs: remove congestion_end(). It's redundant, clear_bdi_congested() already wakes the waiters. Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Trond Myklebust <trond.myklebust@fys.uio.no> Cc: "J. Bruce Fields" <bfields@fieldses.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--fs/nfs/write.c4
-rw-r--r--include/linux/backing-dev.h1
-rw-r--r--mm/backing-dev.c13
3 files changed, 1 insertions, 17 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index e2bb66c34406..82d7ee98c675 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -242,10 +242,8 @@ static void nfs_end_page_writeback(struct page *page)
242 struct nfs_server *nfss = NFS_SERVER(inode); 242 struct nfs_server *nfss = NFS_SERVER(inode);
243 243
244 end_page_writeback(page); 244 end_page_writeback(page);
245 if (atomic_long_dec_return(&nfss->writeback) < NFS_CONGESTION_OFF_THRESH) { 245 if (atomic_long_dec_return(&nfss->writeback) < NFS_CONGESTION_OFF_THRESH)
246 clear_bdi_congested(&nfss->backing_dev_info, WRITE); 246 clear_bdi_congested(&nfss->backing_dev_info, WRITE);
247 congestion_end(WRITE);
248 }
249} 247}
250 248
251/* 249/*
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 7011d6255593..210933c336f5 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -93,7 +93,6 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi)
93void clear_bdi_congested(struct backing_dev_info *bdi, int rw); 93void clear_bdi_congested(struct backing_dev_info *bdi, int rw);
94void set_bdi_congested(struct backing_dev_info *bdi, int rw); 94void set_bdi_congested(struct backing_dev_info *bdi, int rw);
95long congestion_wait(int rw, long timeout); 95long congestion_wait(int rw, long timeout);
96void congestion_end(int rw);
97 96
98#define bdi_cap_writeback_dirty(bdi) \ 97#define bdi_cap_writeback_dirty(bdi) \
99 (!((bdi)->capabilities & BDI_CAP_NO_WRITEBACK)) 98 (!((bdi)->capabilities & BDI_CAP_NO_WRITEBACK))
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index f50a2811f9dc..841901a95595 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -54,16 +54,3 @@ long congestion_wait(int rw, long timeout)
54 return ret; 54 return ret;
55} 55}
56EXPORT_SYMBOL(congestion_wait); 56EXPORT_SYMBOL(congestion_wait);
57
58/**
59 * congestion_end - wake up sleepers on a congested backing_dev_info
60 * @rw: READ or WRITE
61 */
62void congestion_end(int rw)
63{
64 wait_queue_head_t *wqh = &congestion_wqh[rw];
65
66 if (waitqueue_active(wqh))
67 wake_up(wqh);
68}
69EXPORT_SYMBOL(congestion_end);