Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 274362
b: refs/heads/master
c: 8927f66
h: refs/heads/master
v: v3
  • Loading branch information
Wu Fengguang committed Oct 3, 2011
1 parent 069734f commit 3a4b969
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 57fc978cfb61ed40a7bbfe5a569359159ba31abd
refs/heads/master: 8927f66c4ede9a18b4b58f7e6f9debca67065f6b
15 changes: 15 additions & 0 deletions trunk/mm/page-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@ static unsigned long bdi_position_ratio(struct backing_dev_info *bdi,
*/
if (unlikely(bdi_thresh > thresh))
bdi_thresh = thresh;
bdi_thresh = max(bdi_thresh, (limit - dirty) / 8);
/*
* scale global setpoint to bdi's:
* bdi_setpoint = setpoint * bdi_thresh / thresh
Expand All @@ -622,6 +623,20 @@ static unsigned long bdi_position_ratio(struct backing_dev_info *bdi,
} else
pos_ratio /= 4;

/*
* bdi reserve area, safeguard against dirty pool underrun and disk idle
* It may push the desired control point of global dirty pages higher
* than setpoint.
*/
x_intercept = bdi_thresh / 2;
if (bdi_dirty < x_intercept) {
if (bdi_dirty > x_intercept / 8) {
pos_ratio *= x_intercept;
do_div(pos_ratio, bdi_dirty);
} else
pos_ratio *= 8;
}

return pos_ratio;
}

Expand Down

0 comments on commit 3a4b969

Please sign in to comment.