> -----Original Message----- > From: Brian Brooks [mailto:brian.bro...@linaro.org] > Sent: Saturday, September 17, 2016 1:05 AM > To: Elo, Matias (Nokia - FI/Espoo) <matias....@nokia-bell-labs.com> > Cc: lng-odp@lists.linaro.org > Subject: Re: [lng-odp] [PATCH v2 1/2] test: perf: add new scheduling latency > test > > On 09/14 11:53:06, Matias Elo wrote: > > + > > + /* Clear possible locally stored buffers */ > > + odp_schedule_pause(); > > + > > + while (1) { > > + ev = odp_schedule(&src_queue, ODP_SCHED_NO_WAIT); > > + > > + if (ev == ODP_EVENT_INVALID) > > + break; > > + > > + if (odp_queue_enq(src_queue, ev)) { > > + LOG_ERR("[%i] Queue enqueue failed.\n", thr); > > + odp_event_free(ev); > > + return -1; > > + } > > + } > > + > > + odp_schedule_resume(); > > Is it possible to skip this and go straight to draining the queues? > > Locally pre-scheduled work is an implementation detail that should be hidden > by the scheduling APIs. > > A hardware scheduler may not pre-schedule work to cores the way the current > software implementation does.
Also some HW schedulers may operate in push mode and do local cashing. Calling odp_schedule_pause() is the only ODP method to signal the scheduler to stop this. So to keep the application platform agnostic (and follow the API documentation), this step cannot be skipped. -Matias > The ODP implementation for that environment > would have to turn the scheduling call into a nop for that core if it is > paused by use of these APIs. Another way to implement it would be to remove > this core from all queue scheduling groups and leave the schedule call as-is. > If implemented by the first method, the application writer could simply just > not call the API to schedule work. If implemented by the second method, there > are already scheduling group APIs to do this. The ODP implementation is free to choose how it implements these calls. For example adding a single 'if (odp_unlikely(x))' to odp_schedule() to make it a NOP after odp_schedule_pause() has been called shouldn't cause a significant overhead. > > Are odp_schedule_pause() and odp_schedule_resume() deprecated? Nope. > > > + odp_barrier_wait(&globals->barrier); > > + > > + clear_sched_queues();