@@ -942,33 +942,33 @@ static unsigned long __wb_calc_thresh(struct dirty_throttle_control *dtc,
942
942
wb_min_max_ratio (wb , & wb_min_ratio , & wb_max_ratio );
943
943
944
944
wb_thresh += (thresh * wb_min_ratio ) / (100 * BDI_RATIO_SCALE );
945
- wb_max_thresh = thresh * wb_max_ratio / (100 * BDI_RATIO_SCALE );
946
- if (wb_thresh > wb_max_thresh )
947
- wb_thresh = wb_max_thresh ;
948
945
949
946
/*
950
- * With strictlimit flag, the wb_thresh is treated as
951
- * a hard limit in balance_dirty_pages() and wb_position_ratio() .
952
- * It's possible that wb_thresh is close to zero, not because
953
- * the device is slow, but because it has been inactive.
954
- * To prevent occasional writes from being blocked, we raise wb_thresh .
947
+ * It's very possible that wb_thresh is close to 0 not because the
948
+ * device is slow, but that it has remained inactive for long time .
949
+ * Honour such devices a reasonable good (hopefully IO efficient)
950
+ * threshold, so that the occasional writes won't be blocked and active
951
+ * writes can rampup the threshold quickly .
955
952
*/
956
- if (unlikely (wb -> bdi -> capabilities & BDI_CAP_STRICTLIMIT )) {
957
- unsigned long limit = hard_dirty_limit (dom , dtc -> thresh );
958
- u64 wb_scale_thresh = 0 ;
959
-
960
- if (limit > dtc -> dirty )
961
- wb_scale_thresh = (limit - dtc -> dirty ) / 100 ;
962
- wb_thresh = max (wb_thresh , min (wb_scale_thresh , wb_max_thresh / 4 ));
953
+ if (thresh > dtc -> dirty ) {
954
+ if (unlikely (wb -> bdi -> capabilities & BDI_CAP_STRICTLIMIT ))
955
+ wb_thresh = max (wb_thresh , (thresh - dtc -> dirty ) / 100 );
956
+ else
957
+ wb_thresh = max (wb_thresh , (thresh - dtc -> dirty ) / 8 );
963
958
}
964
959
960
+ wb_max_thresh = thresh * wb_max_ratio / (100 * BDI_RATIO_SCALE );
961
+ if (wb_thresh > wb_max_thresh )
962
+ wb_thresh = wb_max_thresh ;
963
+
965
964
return wb_thresh ;
966
965
}
967
966
968
967
unsigned long wb_calc_thresh (struct bdi_writeback * wb , unsigned long thresh )
969
968
{
970
969
struct dirty_throttle_control gdtc = { GDTC_INIT (wb ) };
971
970
971
+ domain_dirty_avail (& gdtc , true);
972
972
return __wb_calc_thresh (& gdtc , thresh );
973
973
}
974
974
@@ -1145,12 +1145,6 @@ static void wb_position_ratio(struct dirty_throttle_control *dtc)
1145
1145
if (unlikely (wb -> bdi -> capabilities & BDI_CAP_STRICTLIMIT )) {
1146
1146
long long wb_pos_ratio ;
1147
1147
1148
- if (dtc -> wb_dirty < 8 ) {
1149
- dtc -> pos_ratio = min_t (long long , pos_ratio * 2 ,
1150
- 2 << RATELIMIT_CALC_SHIFT );
1151
- return ;
1152
- }
1153
-
1154
1148
if (dtc -> wb_dirty >= wb_thresh )
1155
1149
return ;
1156
1150
@@ -1221,14 +1215,6 @@ static void wb_position_ratio(struct dirty_throttle_control *dtc)
1221
1215
*/
1222
1216
if (unlikely (wb_thresh > dtc -> thresh ))
1223
1217
wb_thresh = dtc -> thresh ;
1224
- /*
1225
- * It's very possible that wb_thresh is close to 0 not because the
1226
- * device is slow, but that it has remained inactive for long time.
1227
- * Honour such devices a reasonable good (hopefully IO efficient)
1228
- * threshold, so that the occasional writes won't be blocked and active
1229
- * writes can rampup the threshold quickly.
1230
- */
1231
- wb_thresh = max (wb_thresh , (limit - dtc -> dirty ) / 8 );
1232
1218
/*
1233
1219
* scale global setpoint to wb's:
1234
1220
* wb_setpoint = setpoint * wb_thresh / thresh
@@ -1484,17 +1470,10 @@ static void wb_update_dirty_ratelimit(struct dirty_throttle_control *dtc,
1484
1470
* balanced_dirty_ratelimit = task_ratelimit * write_bw / dirty_rate).
1485
1471
* Hence, to calculate "step" properly, we have to use wb_dirty as
1486
1472
* "dirty" and wb_setpoint as "setpoint".
1487
- *
1488
- * We rampup dirty_ratelimit forcibly if wb_dirty is low because
1489
- * it's possible that wb_thresh is close to zero due to inactivity
1490
- * of backing device.
1491
1473
*/
1492
1474
if (unlikely (wb -> bdi -> capabilities & BDI_CAP_STRICTLIMIT )) {
1493
1475
dirty = dtc -> wb_dirty ;
1494
- if (dtc -> wb_dirty < 8 )
1495
- setpoint = dtc -> wb_dirty + 1 ;
1496
- else
1497
- setpoint = (dtc -> wb_thresh + dtc -> wb_bg_thresh ) / 2 ;
1476
+ setpoint = (dtc -> wb_thresh + dtc -> wb_bg_thresh ) / 2 ;
1498
1477
}
1499
1478
1500
1479
if (dirty < setpoint ) {
0 commit comments