- fio_gettime(&tv, NULL);
- if (mtime_since(&td->epoch, &tv) >= td->o.ramp_time * 1000) {
- td->ramp_time_over = 1;
- memcpy(&td->start, &tv, sizeof(tv));
- return 1;
+bool ramp_time_over(struct thread_data *td)
+{
+ if (!td->o.ramp_time || td->ramp_time_over)
+ return true;
+
+ if (utime_since_now(&td->epoch) >= td->o.ramp_time) {
+ td->ramp_time_over = true;
+ reset_all_stats(td);
+ td_set_runstate(td, TD_RAMP);
+
+ /*
+ * If we have a parent, the parent isn't doing IO. Hence
+ * the parent never enters do_io(), which will switch us
+ * from RAMP -> RUNNING. Do this manually here.
+ */
+ if (parent_update_ramp(td))
+ td_set_runstate(td, TD_RUNNING);
+
+ return true;