On Mon, Jul 11, 2022 at 3:18 PM Harry van Haaren <harry.van.haa...@intel.com> wrote: > > This commit fixes a potential racey-add that could occur if > multiple service-lcores were executing the same MT-safe service > at the same time, with service statistics collection enabled. > > Because multiple threads can run and execute the service, the > stats values can have multiple writer threads, resulting in the > requirement of using atomic addition for correctness. > > Note that when a MT unsafe service is executed, a spinlock is > held, so the stats increments are protected. This fact is used > to avoid executing atomic add instructions when not required. > Regular reads and increments are used, and only the store is > specified as atomic, reducing perf impact on e.g. x86 arch. > > This patch causes a 1.25x increase in cycle-cost for polling a > MT safe service when statistics are enabled. No change was seen > for MT unsafe services, or when statistics are disabled.
Fixes: 21698354c832 ("service: introduce service cores concept") I did not mark for backport since the commitlog indicates a performance impact. You can still ask for backport by pinging LTS maintainers. > > Reported-by: Mattias Rönnblom <mattias.ronnb...@ericsson.com> > Suggested-by: Honnappa Nagarahalli <honnappa.nagaraha...@arm.com> > Suggested-by: Morten Brørup <m...@smartsharesystems.com> > Suggested-by: Bruce Richardson <bruce.richard...@intel.com> > Signed-off-by: Harry van Haaren <harry.van.haa...@intel.com> Series applied, thanks. -- David Marchand