diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/page-writeback.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/mm/page-writeback.c b/mm/page-writeback.c index cc351e6f9ed..6a8bb693b42 100644 --- a/mm/page-writeback.c +++ b/mm/page-writeback.c | |||
@@ -1086,6 +1086,10 @@ static void balance_dirty_pages(struct address_space *mapping, | |||
1086 | task_ratelimit = (u64)dirty_ratelimit * | 1086 | task_ratelimit = (u64)dirty_ratelimit * |
1087 | pos_ratio >> RATELIMIT_CALC_SHIFT; | 1087 | pos_ratio >> RATELIMIT_CALC_SHIFT; |
1088 | pause = (HZ * pages_dirtied) / (task_ratelimit | 1); | 1088 | pause = (HZ * pages_dirtied) / (task_ratelimit | 1); |
1089 | if (unlikely(pause <= 0)) { | ||
1090 | pause = 1; /* avoid resetting nr_dirtied_pause below */ | ||
1091 | break; | ||
1092 | } | ||
1089 | pause = min(pause, max_pause); | 1093 | pause = min(pause, max_pause); |
1090 | 1094 | ||
1091 | pause: | 1095 | pause: |
@@ -1107,7 +1111,21 @@ pause: | |||
1107 | bdi->dirty_exceeded = 0; | 1111 | bdi->dirty_exceeded = 0; |
1108 | 1112 | ||
1109 | current->nr_dirtied = 0; | 1113 | current->nr_dirtied = 0; |
1110 | current->nr_dirtied_pause = dirty_poll_interval(nr_dirty, dirty_thresh); | 1114 | if (pause == 0) { /* in freerun area */ |
1115 | current->nr_dirtied_pause = | ||
1116 | dirty_poll_interval(nr_dirty, dirty_thresh); | ||
1117 | } else if (pause <= max_pause / 4 && | ||
1118 | pages_dirtied >= current->nr_dirtied_pause) { | ||
1119 | current->nr_dirtied_pause = clamp_val( | ||
1120 | dirty_ratelimit * (max_pause / 2) / HZ, | ||
1121 | pages_dirtied + pages_dirtied / 8, | ||
1122 | pages_dirtied * 4); | ||
1123 | } else if (pause >= max_pause) { | ||
1124 | current->nr_dirtied_pause = 1 | clamp_val( | ||
1125 | dirty_ratelimit * (max_pause / 2) / HZ, | ||
1126 | pages_dirtied / 4, | ||
1127 | pages_dirtied - pages_dirtied / 8); | ||
1128 | } | ||
1111 | 1129 | ||
1112 | if (writeback_in_progress(bdi)) | 1130 | if (writeback_in_progress(bdi)) |
1113 | return; | 1131 | return; |