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