Lines Matching refs:rqd
116 bool rq_depth_calc_max_depth(struct rq_depth *rqd) in rq_depth_calc_max_depth() argument
128 if (rqd->queue_depth == 1) { in rq_depth_calc_max_depth()
129 if (rqd->scale_step > 0) in rq_depth_calc_max_depth()
130 rqd->max_depth = 1; in rq_depth_calc_max_depth()
132 rqd->max_depth = 2; in rq_depth_calc_max_depth()
143 depth = min_t(unsigned int, rqd->default_depth, in rq_depth_calc_max_depth()
144 rqd->queue_depth); in rq_depth_calc_max_depth()
145 if (rqd->scale_step > 0) in rq_depth_calc_max_depth()
146 depth = 1 + ((depth - 1) >> min(31, rqd->scale_step)); in rq_depth_calc_max_depth()
147 else if (rqd->scale_step < 0) { in rq_depth_calc_max_depth()
148 unsigned int maxd = 3 * rqd->queue_depth / 4; in rq_depth_calc_max_depth()
150 depth = 1 + ((depth - 1) << -rqd->scale_step); in rq_depth_calc_max_depth()
157 rqd->max_depth = depth; in rq_depth_calc_max_depth()
164 bool rq_depth_scale_up(struct rq_depth *rqd) in rq_depth_scale_up() argument
169 if (rqd->scaled_max) in rq_depth_scale_up()
172 rqd->scale_step--; in rq_depth_scale_up()
174 rqd->scaled_max = rq_depth_calc_max_depth(rqd); in rq_depth_scale_up()
183 bool rq_depth_scale_down(struct rq_depth *rqd, bool hard_throttle) in rq_depth_scale_down() argument
190 if (rqd->max_depth == 1) in rq_depth_scale_down()
193 if (rqd->scale_step < 0 && hard_throttle) in rq_depth_scale_down()
194 rqd->scale_step = 0; in rq_depth_scale_down()
196 rqd->scale_step++; in rq_depth_scale_down()
198 rqd->scaled_max = false; in rq_depth_scale_down()
199 rq_depth_calc_max_depth(rqd); in rq_depth_scale_down()