static void lat_target_success(struct thread_data *td) { const unsigned int qd = td->latency_qd; td->latency_qd_low = td->latency_qd; /* * If we haven't failed yet, we double up to a failing value instead * of bisecting from highest possible queue depth. If we have set * a limit other than td->o.iodepth, bisect between that. */ if (td->latency_qd_high != td->o.iodepth) td->latency_qd = (td->latency_qd + td->latency_qd_high) / 2; else td->latency_qd *= 2; if (td->latency_qd > td->o.iodepth) td->latency_qd = td->o.iodepth; dprint(FD_RATE, "Ramped up: %d %d %d\n", td->latency_qd_low, td->latency_qd, td->latency_qd_high); /* * Same as last one, we are done */ if (td->latency_qd == qd) td->done = 1; lat_new_cycle(td); }
/* * We had an IO outside the latency target. Reduce the queue depth. If we * are at QD=1, then it's time to give up. */ static int __lat_target_failed(struct thread_data *td) { if (td->latency_qd == 1) return 1; td->latency_qd_high = td->latency_qd; td->latency_qd = (td->latency_qd + td->latency_qd_low) / 2; dprint(FD_RATE, "Ramped down: %d %d %d\n", td->latency_qd_low, td->latency_qd, td->latency_qd_high); /* * When we ramp QD down, quiesce existing IO to prevent * a storm of ramp downs due to pending higher depth. */ io_u_quiesce(td); lat_new_cycle(td); return 0; }
static void lat_target_success(struct thread_data *td) { const unsigned int qd = td->latency_qd; struct thread_options *o = &td->o; td->latency_qd_low = td->latency_qd; /* * If we haven't failed yet, we double up to a failing value instead * of bisecting from highest possible queue depth. If we have set * a limit other than td->o.iodepth, bisect between that. */ if (td->latency_qd_high != o->iodepth) td->latency_qd = (td->latency_qd + td->latency_qd_high) / 2; else td->latency_qd *= 2; if (td->latency_qd > o->iodepth) td->latency_qd = o->iodepth; dprint(FD_RATE, "Ramped up: %d %d %d\n", td->latency_qd_low, td->latency_qd, td->latency_qd_high); /* * Same as last one, we are done. Let it run a latency cycle, so * we get only the results from the targeted depth. */ if (td->latency_qd == qd) { if (td->latency_end_run) { dprint(FD_RATE, "We are done\n"); td->done = 1; } else { dprint(FD_RATE, "Quiesce and final run\n"); io_u_quiesce(td); td->latency_end_run = 1; reset_all_stats(td); reset_io_stats(td); } } lat_new_cycle(td); }