Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274361
b: refs/heads/master
c: 57fc978
h: refs/heads/master
i:
  274359: fcd09d5
v: v3
  • Loading branch information
Wu Fengguang committed Oct 3, 2011
1 parent 5c0a330 commit 069734f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 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: c8462cc9de9e92264ec647903772f6036a99b286
refs/heads/master: 57fc978cfb61ed40a7bbfe5a569359159ba31abd
20 changes: 19 additions & 1 deletion trunk/mm/page-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,10 @@ static void balance_dirty_pages(struct address_space *mapping,
task_ratelimit = (u64)dirty_ratelimit *
pos_ratio >> RATELIMIT_CALC_SHIFT;
pause = (HZ * pages_dirtied) / (task_ratelimit | 1);
if (unlikely(pause <= 0)) {
pause = 1; /* avoid resetting nr_dirtied_pause below */
break;
}
pause = min(pause, max_pause);

pause:
Expand All @@ -1107,7 +1111,21 @@ static void balance_dirty_pages(struct address_space *mapping,
bdi->dirty_exceeded = 0;

current->nr_dirtied = 0;
current->nr_dirtied_pause = dirty_poll_interval(nr_dirty, dirty_thresh);
if (pause == 0) { /* in freerun area */
current->nr_dirtied_pause =
dirty_poll_interval(nr_dirty, dirty_thresh);
} else if (pause <= max_pause / 4 &&
pages_dirtied >= current->nr_dirtied_pause) {
current->nr_dirtied_pause = clamp_val(
dirty_ratelimit * (max_pause / 2) / HZ,
pages_dirtied + pages_dirtied / 8,
pages_dirtied * 4);
} else if (pause >= max_pause) {
current->nr_dirtied_pause = 1 | clamp_val(
dirty_ratelimit * (max_pause / 2) / HZ,
pages_dirtied / 4,
pages_dirtied - pages_dirtied / 8);
}

if (writeback_in_progress(bdi))
return;
Expand Down

0 comments on commit 069734f

Please sign in to comment.