Lines Matching refs:item
66 void (*worker)(struct ot_item *item, int irq);
158 struct ot_item *item = container_of(hrt, struct ot_item, hrtimer); in ot_hrtimer_handler() local
159 struct ot_test *test = item->test; in ot_hrtimer_handler()
165 item->worker(item, 1); in ot_hrtimer_handler()
167 hrtimer_forward_now(hrt, item->hrtcycle); in ot_hrtimer_handler()
171 static void ot_start_hrtimer(struct ot_item *item) in ot_start_hrtimer() argument
173 if (!item->test->hrtimer) in ot_start_hrtimer()
175 hrtimer_start(&item->hrtimer, item->hrtcycle, HRTIMER_MODE_REL); in ot_start_hrtimer()
178 static void ot_stop_hrtimer(struct ot_item *item) in ot_stop_hrtimer() argument
180 if (!item->test->hrtimer) in ot_stop_hrtimer()
182 hrtimer_cancel(&item->hrtimer); in ot_stop_hrtimer()
185 static int ot_init_hrtimer(struct ot_item *item, unsigned long hrtimer) in ot_init_hrtimer() argument
187 struct hrtimer *hrt = &item->hrtimer; in ot_init_hrtimer()
192 item->hrtcycle = ktime_set(0, hrtimer * 1000000UL); in ot_init_hrtimer()
197 static int ot_init_cpu_item(struct ot_item *item, in ot_init_cpu_item() argument
202 memset(item, 0, sizeof(*item)); in ot_init_cpu_item()
203 item->pool = pool; in ot_init_cpu_item()
204 item->test = test; in ot_init_cpu_item()
205 item->worker = worker; in ot_init_cpu_item()
207 item->bulk[0] = test->bulk_normal; in ot_init_cpu_item()
208 item->bulk[1] = test->bulk_irq; in ot_init_cpu_item()
209 item->delay = test->delay; in ot_init_cpu_item()
212 ot_init_hrtimer(item, item->test->hrtimer); in ot_init_cpu_item()
218 struct ot_item *item = arg; in ot_thread_worker() local
219 struct ot_test *test = item->test; in ot_thread_worker()
226 ot_start_hrtimer(item); in ot_thread_worker()
231 item->worker(item, 0); in ot_thread_worker()
233 ot_stop_hrtimer(item); in ot_thread_worker()
234 item->duration = (u64) ktime_us_delta(ktime_get(), start); in ot_thread_worker()
250 struct ot_item *item = per_cpu_ptr(&ot_pcup_items, cpu); in ot_perf_report() local
251 if (!item->duration) in ot_perf_report()
253 normal.nhits += item->stat[0].nhits; in ot_perf_report()
254 normal.nmiss += item->stat[0].nmiss; in ot_perf_report()
255 irq.nhits += item->stat[1].nhits; in ot_perf_report()
256 irq.nmiss += item->stat[1].nmiss; in ot_perf_report()
257 pr_info("CPU: %d duration: %lluus\n", cpu, item->duration); in ot_perf_report()
259 item->stat[0].nhits, item->stat[0].nmiss); in ot_perf_report()
261 item->stat[1].nhits, item->stat[1].nmiss); in ot_perf_report()
263 item->stat[0].nhits + item->stat[1].nhits, in ot_perf_report()
264 item->stat[0].nmiss + item->stat[1].nmiss); in ot_perf_report()
324 static void ot_bulk_sync(struct ot_item *item, int irq) in ot_bulk_sync() argument
329 for (i = 0; i < item->bulk[irq]; i++) in ot_bulk_sync()
330 nods[i] = objpool_pop(item->pool); in ot_bulk_sync()
332 if (!irq && (item->delay || !(++(item->niters) & 0x7FFF))) in ot_bulk_sync()
333 msleep(item->delay); in ot_bulk_sync()
339 objpool_push(on, item->pool); in ot_bulk_sync()
340 item->stat[irq].nhits++; in ot_bulk_sync()
342 item->stat[irq].nmiss++; in ot_bulk_sync()
364 struct ot_item *item = per_cpu_ptr(&ot_pcup_items, cpu); in ot_start_sync() local
367 ot_init_cpu_item(item, test, &sop->pool, ot_bulk_sync); in ot_start_sync()
373 work = kthread_run_on_cpu(ot_thread_worker, item, in ot_start_sync()
500 static void ot_bulk_async(struct ot_item *item, int irq) in ot_bulk_async() argument
502 struct ot_test *test = item->test; in ot_bulk_async()
506 for (i = 0; i < item->bulk[irq]; i++) in ot_bulk_async()
507 nods[i] = objpool_pop(item->pool); in ot_bulk_async()
510 if (item->delay || !(++(item->niters) & 0x7FFF)) in ot_bulk_async()
511 msleep(item->delay); in ot_bulk_async()
523 ot_nod_recycle(on, item->pool, stop); in ot_bulk_async()
524 item->stat[irq].nhits++; in ot_bulk_async()
526 item->stat[irq].nmiss++; in ot_bulk_async()
551 struct ot_item *item = per_cpu_ptr(&ot_pcup_items, cpu); in ot_start_async() local
554 ot_init_cpu_item(item, test, &sop->pool, ot_bulk_async); in ot_start_async()
560 work = kthread_run_on_cpu(ot_thread_worker, item, cpu, "ot_worker_%d"); in ot_start_async()