> -----Original Message----- > From: Morten Brørup <[email protected]> > Sent: Wednesday, September 7, 2022 9:41 AM > To: mattias.ronnblom <[email protected]>; Van Haaren, Harry > <[email protected]> > Cc: [email protected]; Honnappa Nagarahalli <[email protected]>; nd > <[email protected]> > Subject: RE: [PATCH 4/6] service: tweak cycle statistics semantics > > > From: Mattias Rönnblom [mailto:[email protected]] > > Sent: Tuesday, 6 September 2022 18.14 > > > > As a part of its service function, a service usually polls some kind > > of source (e.g., an RX queue, a ring, an eventdev port, or a timer > > wheel) to retrieve one or more items of work. > > > > In low-load situations, the service framework reports a significant > > amount of cycles spent for all running services, despite the fact they > > have performed little or no actual work. > > > > The per-call cycle expenditure for an idle service (i.e., a service > > currently without pending jobs) is typically very low. Polling an > > empty ring or RX queue is inexpensive. However, since the service > > function call frequency on an idle or lightly loaded lcore is going to > > be very high indeed, the service function calls' cycles adds up to a > > significant amount. The only thing preventing the idle services' > > cycles counters to make up 100% of the available CPU cycles is the > > overhead of the service framework itself. > > > > If the RTE_SERVICE_ATTR_CYCLES or RTE_SERVICE_LCORE_ATTR_CYCLES are > > used to estimate service core load, the cores may look very busy when > > the system is mostly doing nothing useful at all. > > > > This patch allows for an idle service to indicate that no actual work > > was performed during a particular service function call (by returning > > -EAGAIN). In such cases the RTE_SERVICE_ATTR_CYCLES and > > RTE_SERVICE_LCORE_ATTR_CYCLES values are not incremented. > > > > The convention of returning -EAGAIN for idle services may in the > > future also be used to have the lcore enter a short sleep, or reduce > > its operating frequency, in case all services are currently idle. > > > > This change is backward-compatible. > > > > Signed-off-by: Mattias Rönnblom <[email protected]> > > --- > > This entire series contains a bunch of good improvements. > > Returning -EAGAIN is a step in the right direction towards measuring CPU > usage, and > a great way to make it backwards compatible. > > Series-Acked-by: Morten Brørup <[email protected]>
Agreed, thanks Mattias for authoring & Morten for review/ack; I've left 2 minor comments on individual patches, but for the remaining 4 patches; Series-Acked-by: Harry van Haaren <[email protected]>

