Lines Matching defs:pos_ratio
141 unsigned long pos_ratio;
827 long long pos_ratio;
832 pos_ratio = x;
833 pos_ratio = pos_ratio * x >> RATELIMIT_CALC_SHIFT;
834 pos_ratio = pos_ratio * x >> RATELIMIT_CALC_SHIFT;
835 pos_ratio += 1 << RATELIMIT_CALC_SHIFT;
837 return clamp(pos_ratio, 0LL, 2LL << RATELIMIT_CALC_SHIFT);
850 * pos_ratio = 1 << RATELIMIT_CALC_SHIFT
852 * if (dirty < setpoint) scale up pos_ratio
853 * if (dirty > setpoint) scale down pos_ratio
855 * if (wb_dirty < wb_setpoint) scale up pos_ratio
856 * if (wb_dirty > wb_setpoint) scale down pos_ratio
858 * task_ratelimit = dirty_ratelimit * pos_ratio >> RATELIMIT_CALC_SHIFT
862 * ^ pos_ratio
883 * ^ pos_ratio
909 * The wb control line won't drop below pos_ratio=1/4, so that wb_dirty can
926 long long pos_ratio; /* for scaling up/down the rate limit */
929 dtc->pos_ratio = 0;
940 pos_ratio = pos_ratio_polynom(setpoint, dtc->dirty, limit);
952 * Here, in wb_position_ratio(), we calculate pos_ratio based on
971 dtc->pos_ratio = min_t(long long, pos_ratio * 2,
990 * and pos_ratio >> wb_pos_ratio. In the other words global
993 * important case when global pos_ratio should get precedence:
997 * "pos_ratio * wb_pos_ratio" would work for the case above,
1003 * control system. Normally, pos_ratio value can be well over 3
1005 * setpoint). Now the maximum pos_ratio in the same situation
1009 dtc->pos_ratio = min(pos_ratio, wb_pos_ratio);
1014 * We have computed basic pos_ratio above based on global situation. If
1016 * pos_ratio further down/up. That is done by the following mechanism.
1038 * fluctuation range for pos_ratio.
1042 * yields 100% pos_ratio fluctuation on suddenly doubled wb_thresh.
1072 pos_ratio = div64_u64(pos_ratio * (x_intercept - dtc->wb_dirty),
1075 pos_ratio /= 4;
1085 pos_ratio = div_u64(pos_ratio * x_intercept,
1088 pos_ratio *= 8;
1091 dtc->pos_ratio = pos_ratio;
1226 dtc->pos_ratio >> RATELIMIT_CALC_SHIFT;
1237 * but also takes pos_ratio into account:
1238 * rate_(i+1) = rate_(i) * (write_bw / dirty_rate) * pos_ratio (2)
1240 * (1) is not realistic because pos_ratio also takes part in balancing
1242 * pos_ratio = 0.5 (3)
1246 * task_ratelimit = pos_ratio * rate = (write_bw / N) (5)
1254 * regardless of the value of pos_ratio. As long as (8) is satisfied,
1255 * pos_ratio is able to drive itself to 1.0, which is not only where
1257 * pos_ratio is most flat and hence task_ratelimit is least fluctuated.
1279 * = (pos_ratio - 1) * dirty_ratelimit
1305 * and limits (starting from pos_ratio = wb_position_ratio() and up to
1681 * Calculate global domain's pos_ratio and select the
1707 * pos_ratio. @wb should satisfy constraints from
1709 * w/ lower pos_ratio.
1729 if (mdtc->pos_ratio < gdtc->pos_ratio)
1745 task_ratelimit = ((u64)dirty_ratelimit * sdtc->pos_ratio) >>