aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-11-07 09:59:02 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2011-11-07 09:59:02 -0800
commit6e6bc67982573c221d12cbd123d34395f9f6e22e (patch)
treea63ac571bedace9fc04515cd95da1c49a1304b68
parentff4d7fa8c32f6ec513fb792c060809ec82d53ea4 (diff)
parent3a73dbbc9bb3fc8594cd67af4db6c563175dfddb (diff)
Merge branch 'urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux
* 'urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux: writeback: fix uninitialized task_ratelimit
-rw-r--r--mm/page-writeback.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 0360d1b5a1d..a3278f00523 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -1097,13 +1097,13 @@ static void balance_dirty_pages(struct address_space *mapping,
pos_ratio = bdi_position_ratio(bdi, dirty_thresh,
background_thresh, nr_dirty,
bdi_thresh, bdi_dirty);
- if (unlikely(pos_ratio == 0)) {
+ task_ratelimit = ((u64)dirty_ratelimit * pos_ratio) >>
+ RATELIMIT_CALC_SHIFT;
+ if (unlikely(task_ratelimit == 0)) {
pause = max_pause;
goto pause;
}
- task_ratelimit = (u64)dirty_ratelimit *
- pos_ratio >> RATELIMIT_CALC_SHIFT;
- pause = (HZ * pages_dirtied) / (task_ratelimit | 1);
+ pause = HZ * pages_dirtied / task_ratelimit;
if (unlikely(pause <= 0)) {
trace_balance_dirty_pages(bdi,
dirty_thresh,