Lines Matching refs:rqd
110 bool rq_depth_calc_max_depth(struct rq_depth *rqd)
122 if (rqd->queue_depth == 1) {
123 if (rqd->scale_step > 0)
124 rqd->max_depth = 1;
126 rqd->max_depth = 2;
137 depth = min_t(unsigned int, rqd->default_depth,
138 rqd->queue_depth);
139 if (rqd->scale_step > 0)
140 depth = 1 + ((depth - 1) >> min(31, rqd->scale_step));
141 else if (rqd->scale_step < 0) {
142 unsigned int maxd = 3 * rqd->queue_depth / 4;
144 depth = 1 + ((depth - 1) << -rqd->scale_step);
151 rqd->max_depth = depth;
158 bool rq_depth_scale_up(struct rq_depth *rqd)
163 if (rqd->scaled_max)
166 rqd->scale_step--;
168 rqd->scaled_max = rq_depth_calc_max_depth(rqd);
177 bool rq_depth_scale_down(struct rq_depth *rqd, bool hard_throttle)
184 if (rqd->max_depth == 1)
187 if (rqd->scale_step < 0 && hard_throttle)
188 rqd->scale_step = 0;
190 rqd->scale_step++;
192 rqd->scaled_max = false;
193 rq_depth_calc_max_depth(rqd);