Lines Matching defs:pos_ratio
141 unsigned long pos_ratio;
913 long long pos_ratio;
918 pos_ratio = x;
919 pos_ratio = pos_ratio * x >> RATELIMIT_CALC_SHIFT;
920 pos_ratio = pos_ratio * x >> RATELIMIT_CALC_SHIFT;
921 pos_ratio += 1 << RATELIMIT_CALC_SHIFT;
923 return clamp(pos_ratio, 0LL, 2LL << RATELIMIT_CALC_SHIFT);
936 * pos_ratio = 1 << RATELIMIT_CALC_SHIFT
938 * if (dirty < setpoint) scale up pos_ratio
939 * if (dirty > setpoint) scale down pos_ratio
941 * if (wb_dirty < wb_setpoint) scale up pos_ratio
942 * if (wb_dirty > wb_setpoint) scale down pos_ratio
944 * task_ratelimit = dirty_ratelimit * pos_ratio >> RATELIMIT_CALC_SHIFT
948 * ^ pos_ratio
969 * ^ pos_ratio
995 * The wb control line won't drop below pos_ratio=1/4, so that wb_dirty can
1012 long long pos_ratio; /* for scaling up/down the rate limit */
1015 dtc->pos_ratio = 0;
1026 pos_ratio = pos_ratio_polynom(setpoint, dtc->dirty, limit);
1038 * Here, in wb_position_ratio(), we calculate pos_ratio based on
1057 dtc->pos_ratio = min_t(long long, pos_ratio * 2,
1076 * and pos_ratio >> wb_pos_ratio. In the other words global
1079 * important case when global pos_ratio should get precedence:
1083 * "pos_ratio * wb_pos_ratio" would work for the case above,
1089 * control system. Normally, pos_ratio value can be well over 3
1091 * setpoint). Now the maximum pos_ratio in the same situation
1095 dtc->pos_ratio = min(pos_ratio, wb_pos_ratio);
1100 * We have computed basic pos_ratio above based on global situation. If
1102 * pos_ratio further down/up. That is done by the following mechanism.
1124 * fluctuation range for pos_ratio.
1128 * yields 100% pos_ratio fluctuation on suddenly doubled wb_thresh.
1158 pos_ratio = div64_u64(pos_ratio * (x_intercept - dtc->wb_dirty),
1161 pos_ratio /= 4;
1171 pos_ratio = div_u64(pos_ratio * x_intercept,
1174 pos_ratio *= 8;
1177 dtc->pos_ratio = pos_ratio;
1312 dtc->pos_ratio >> RATELIMIT_CALC_SHIFT;
1323 * but also takes pos_ratio into account:
1324 * rate_(i+1) = rate_(i) * (write_bw / dirty_rate) * pos_ratio (2)
1326 * (1) is not realistic because pos_ratio also takes part in balancing
1328 * pos_ratio = 0.5 (3)
1332 * task_ratelimit = pos_ratio * rate = (write_bw / N) (5)
1340 * regardless of the value of pos_ratio. As long as (8) is satisfied,
1341 * pos_ratio is able to drive itself to 1.0, which is not only where
1343 * pos_ratio is most flat and hence task_ratelimit is least fluctuated.
1365 * = (pos_ratio - 1) * dirty_ratelimit
1391 * and limits (starting from pos_ratio = wb_position_ratio() and up to
1793 * Calculate global domain's pos_ratio and select the
1819 * pos_ratio. @wb should satisfy constraints from
1821 * w/ lower pos_ratio.
1841 if (mdtc->pos_ratio < gdtc->pos_ratio)
1854 task_ratelimit = ((u64)dirty_ratelimit * sdtc->pos_ratio) >>