From c6acc3b972b8c3d46b4d4f2b5170e6e7c1ae9136 Mon Sep 17 00:00:00 2001 From: Wu Fengguang Date: Tue, 26 Oct 2010 14:21:45 -0700 Subject: [PATCH] --- yaml --- r: 217463 b: refs/heads/master c: 4cbec4c8b9fda9ec784086fe7f74cd32a8adda95 h: refs/heads/master i: 217461: a7061d0eaf93955655e9c2473b01b507ece40796 217459: 275cb8a5f2c4e7dabb57979e88fbb8a920a58694 217455: a5b8ae74dc53cdf252cfe289d06a126c4f965cf0 v: v3 --- [refs] | 2 +- trunk/fs/fs-writeback.c | 2 +- trunk/mm/page-writeback.c | 16 +++++----------- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index 2e952bb24707..8fe0fd9f8849 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 0e093d99763eb4cea09f8ca4f1d01f34e121d10b +refs/heads/master: 4cbec4c8b9fda9ec784086fe7f74cd32a8adda95 diff --git a/trunk/fs/fs-writeback.c b/trunk/fs/fs-writeback.c index ab38fef1c9a1..97d2951bd4d1 100644 --- a/trunk/fs/fs-writeback.c +++ b/trunk/fs/fs-writeback.c @@ -582,7 +582,7 @@ static inline bool over_bground_thresh(void) global_dirty_limits(&background_thresh, &dirty_thresh); return (global_page_state(NR_FILE_DIRTY) + - global_page_state(NR_UNSTABLE_NFS) >= background_thresh); + global_page_state(NR_UNSTABLE_NFS) > background_thresh); } /* diff --git a/trunk/mm/page-writeback.c b/trunk/mm/page-writeback.c index 4dd91f7fd39f..b840afa89761 100644 --- a/trunk/mm/page-writeback.c +++ b/trunk/mm/page-writeback.c @@ -415,14 +415,8 @@ void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty) if (vm_dirty_bytes) dirty = DIV_ROUND_UP(vm_dirty_bytes, PAGE_SIZE); - else { - int dirty_ratio; - - dirty_ratio = vm_dirty_ratio; - if (dirty_ratio < 5) - dirty_ratio = 5; - dirty = (dirty_ratio * available_memory) / 100; - } + else + dirty = (vm_dirty_ratio * available_memory) / 100; if (dirty_background_bytes) background = DIV_ROUND_UP(dirty_background_bytes, PAGE_SIZE); @@ -510,7 +504,7 @@ static void balance_dirty_pages(struct address_space *mapping, * catch-up. This avoids (excessively) small writeouts * when the bdi limits are ramping up. */ - if (nr_reclaimable + nr_writeback < + if (nr_reclaimable + nr_writeback <= (background_thresh + dirty_thresh) / 2) break; @@ -542,8 +536,8 @@ static void balance_dirty_pages(struct address_space *mapping, * the last resort safeguard. */ dirty_exceeded = - (bdi_nr_reclaimable + bdi_nr_writeback >= bdi_thresh) - || (nr_reclaimable + nr_writeback >= dirty_thresh); + (bdi_nr_reclaimable + bdi_nr_writeback > bdi_thresh) + || (nr_reclaimable + nr_writeback > dirty_thresh); if (!dirty_exceeded) break;