Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217463
b: refs/heads/master
c: 4cbec4c
h: refs/heads/master
i:
  217461: a7061d0
  217459: 275cb8a
  217455: a5b8ae7
v: v3
  • Loading branch information
Wu Fengguang authored and Linus Torvalds committed Oct 26, 2010
1 parent edcdb1c commit c6acc3b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0e093d99763eb4cea09f8ca4f1d01f34e121d10b
refs/heads/master: 4cbec4c8b9fda9ec784086fe7f74cd32a8adda95
2 changes: 1 addition & 1 deletion trunk/fs/fs-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/*
Expand Down
16 changes: 5 additions & 11 deletions trunk/mm/page-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c6acc3b

Please sign in to comment.