diff options
| -rw-r--r-- | mm/page-writeback.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index 325f753c80ed..0802d5177997 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c | |||
| @@ -618,8 +618,8 @@ static unsigned long bdi_position_ratio(struct backing_dev_info *bdi, | |||
| 618 | x_intercept = bdi_setpoint + span; | 618 | x_intercept = bdi_setpoint + span; |
| 619 | 619 | ||
| 620 | if (bdi_dirty < x_intercept - span / 4) { | 620 | if (bdi_dirty < x_intercept - span / 4) { |
| 621 | pos_ratio *= x_intercept - bdi_dirty; | 621 | pos_ratio = div_u64(pos_ratio * (x_intercept - bdi_dirty), |
| 622 | do_div(pos_ratio, x_intercept - bdi_setpoint + 1); | 622 | x_intercept - bdi_setpoint + 1); |
| 623 | } else | 623 | } else |
| 624 | pos_ratio /= 4; | 624 | pos_ratio /= 4; |
| 625 | 625 | ||
| @@ -630,10 +630,9 @@ static unsigned long bdi_position_ratio(struct backing_dev_info *bdi, | |||
| 630 | */ | 630 | */ |
| 631 | x_intercept = bdi_thresh / 2; | 631 | x_intercept = bdi_thresh / 2; |
| 632 | if (bdi_dirty < x_intercept) { | 632 | if (bdi_dirty < x_intercept) { |
| 633 | if (bdi_dirty > x_intercept / 8) { | 633 | if (bdi_dirty > x_intercept / 8) |
| 634 | pos_ratio *= x_intercept; | 634 | pos_ratio = div_u64(pos_ratio * x_intercept, bdi_dirty); |
| 635 | do_div(pos_ratio, bdi_dirty); | 635 | else |
| 636 | } else | ||
| 637 | pos_ratio *= 8; | 636 | pos_ratio *= 8; |
| 638 | } | 637 | } |
| 639 | 638 | ||
| @@ -1010,10 +1009,10 @@ static void balance_dirty_pages(struct address_space *mapping, | |||
| 1010 | unsigned long dirty_thresh; | 1009 | unsigned long dirty_thresh; |
| 1011 | unsigned long bdi_thresh; | 1010 | unsigned long bdi_thresh; |
| 1012 | long pause = 0; | 1011 | long pause = 0; |
| 1013 | long max_pause; | 1012 | long uninitialized_var(max_pause); |
| 1014 | bool dirty_exceeded = false; | 1013 | bool dirty_exceeded = false; |
| 1015 | unsigned long task_ratelimit; | 1014 | unsigned long task_ratelimit; |
| 1016 | unsigned long dirty_ratelimit; | 1015 | unsigned long uninitialized_var(dirty_ratelimit); |
| 1017 | unsigned long pos_ratio; | 1016 | unsigned long pos_ratio; |
| 1018 | struct backing_dev_info *bdi = mapping->backing_dev_info; | 1017 | struct backing_dev_info *bdi = mapping->backing_dev_info; |
| 1019 | unsigned long start_time = jiffies; | 1018 | unsigned long start_time = jiffies; |
