Lines Matching full: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(hrt, hrt->base->get_time(), 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()
198 static int ot_init_cpu_item(struct ot_item *item, in ot_init_cpu_item() argument
203 memset(item, 0, sizeof(*item)); in ot_init_cpu_item()
204 item->pool = pool; in ot_init_cpu_item()
205 item->test = test; in ot_init_cpu_item()
206 item->worker = worker; in ot_init_cpu_item()
208 item->bulk[0] = test->bulk_normal; in ot_init_cpu_item()
209 item->bulk[1] = test->bulk_irq; in ot_init_cpu_item()
210 item->delay = test->delay; in ot_init_cpu_item()
213 ot_init_hrtimer(item, item->test->hrtimer); in ot_init_cpu_item()
219 struct ot_item *item = arg; in ot_thread_worker() local
220 struct ot_test *test = item->test; in ot_thread_worker()
227 ot_start_hrtimer(item); in ot_thread_worker()
232 item->worker(item, 0); in ot_thread_worker()
234 ot_stop_hrtimer(item); in ot_thread_worker()
235 item->duration = (u64) ktime_us_delta(ktime_get(), start); in ot_thread_worker()
251 struct ot_item *item = per_cpu_ptr(&ot_pcup_items, cpu); in ot_perf_report() local
252 if (!item->duration) in ot_perf_report()
254 normal.nhits += item->stat[0].nhits; in ot_perf_report()
255 normal.nmiss += item->stat[0].nmiss; in ot_perf_report()
256 irq.nhits += item->stat[1].nhits; in ot_perf_report()
257 irq.nmiss += item->stat[1].nmiss; in ot_perf_report()
258 pr_info("CPU: %d duration: %lluus\n", cpu, item->duration); in ot_perf_report()
260 item->stat[0].nhits, item->stat[0].nmiss); in ot_perf_report()
262 item->stat[1].nhits, item->stat[1].nmiss); in ot_perf_report()
264 item->stat[0].nhits + item->stat[1].nhits, in ot_perf_report()
265 item->stat[0].nmiss + item->stat[1].nmiss); in ot_perf_report()
325 static void ot_bulk_sync(struct ot_item *item, int irq) in ot_bulk_sync() argument
330 for (i = 0; i < item->bulk[irq]; i++) in ot_bulk_sync()
331 nods[i] = objpool_pop(item->pool); in ot_bulk_sync()
333 if (!irq && (item->delay || !(++(item->niters) & 0x7FFF))) in ot_bulk_sync()
334 msleep(item->delay); in ot_bulk_sync()
340 objpool_push(on, item->pool); in ot_bulk_sync()
341 item->stat[irq].nhits++; in ot_bulk_sync()
343 item->stat[irq].nmiss++; in ot_bulk_sync()
365 struct ot_item *item = per_cpu_ptr(&ot_pcup_items, cpu); in ot_start_sync() local
368 ot_init_cpu_item(item, test, &sop->pool, ot_bulk_sync); in ot_start_sync()
374 work = kthread_create_on_node(ot_thread_worker, item, in ot_start_sync()
505 static void ot_bulk_async(struct ot_item *item, int irq) in ot_bulk_async() argument
507 struct ot_test *test = item->test; in ot_bulk_async()
511 for (i = 0; i < item->bulk[irq]; i++) in ot_bulk_async()
512 nods[i] = objpool_pop(item->pool); in ot_bulk_async()
515 if (item->delay || !(++(item->niters) & 0x7FFF)) in ot_bulk_async()
516 msleep(item->delay); in ot_bulk_async()
528 ot_nod_recycle(on, item->pool, stop); in ot_bulk_async()
529 item->stat[irq].nhits++; in ot_bulk_async()
531 item->stat[irq].nmiss++; in ot_bulk_async()
556 struct ot_item *item = per_cpu_ptr(&ot_pcup_items, cpu); in ot_start_async() local
559 ot_init_cpu_item(item, test, &sop->pool, ot_bulk_async); in ot_start_async()
565 work = kthread_create_on_node(ot_thread_worker, item, in ot_start_async()