Lines Matching refs:t

123 static void io_job_start(struct dm_kcopyd_throttle *t)  in io_job_start()  argument
128 if (unlikely(!t)) in io_job_start()
134 throttle = READ_ONCE(t->throttle); in io_job_start()
140 difference = now - t->last_jiffies; in io_job_start()
141 t->last_jiffies = now; in io_job_start()
142 if (t->num_io_jobs) in io_job_start()
143 t->io_period += difference; in io_job_start()
144 t->total_period += difference; in io_job_start()
149 if (unlikely(t->io_period > t->total_period)) in io_job_start()
150 t->io_period = t->total_period; in io_job_start()
152 if (unlikely(t->total_period >= (1 << ACCOUNT_INTERVAL_SHIFT))) { in io_job_start()
153 int shift = fls(t->total_period >> ACCOUNT_INTERVAL_SHIFT); in io_job_start()
155 t->total_period >>= shift; in io_job_start()
156 t->io_period >>= shift; in io_job_start()
159 skew = t->io_period - throttle * t->total_period / 100; in io_job_start()
169 t->num_io_jobs++; in io_job_start()
174 static void io_job_finish(struct dm_kcopyd_throttle *t) in io_job_finish() argument
178 if (unlikely(!t)) in io_job_finish()
183 t->num_io_jobs--; in io_job_finish()
185 if (likely(READ_ONCE(t->throttle) >= 100)) in io_job_finish()
188 if (!t->num_io_jobs) { in io_job_finish()
192 difference = now - t->last_jiffies; in io_job_finish()
193 t->last_jiffies = now; in io_job_finish()
195 t->io_period += difference; in io_job_finish()
196 t->total_period += difference; in io_job_finish()
201 if (unlikely(t->io_period > t->total_period)) in io_job_finish()
202 t->io_period = t->total_period; in io_job_finish()