30/10/2022 10:09, Morten Brørup: > > From: Morten Brørup [mailto:m...@smartsharesystems.com] > > Sent: Friday, 28 October 2022 08.42 > > > > When built with debug enabled (RTE_LIBRTE_MEMPOOL_DEBUG defined), the > > performance of mempools with caches is improved as follows. > > > > Accessing objects in the mempool is likely to increment either the > > put_bulk and put_objs or the get_success_bulk and get_success_objs > > debug statistics counters. > > > > By adding an alternative set of these counters to the mempool cache > > structure, accessing the dedicated debug statistics structure is > > avoided in > > the likely cases where these counters are incremented. > > > > The trick here is that the cache line holding the mempool cache > > structure > > is accessed anyway, in order to update the "len" field. Updating some > > debug statistics counters in the same cache line has lower performance > > cost than accessing the debug statistics counters in the dedicated > > debug > > statistics structure, i.e. in another cache line. > > > > Running mempool_perf_autotest on a VMware virtual server shows an avg. > > increase of 6.4 % in rate_persec for the tests with cache. (Only when > > built with debug enabled, obviously!) > > > > For the tests without cache, the avg. increase in rate_persec is 0.8 %. > > I > > assume this is noise from the test environment. > > > > v4: > > * Fix spelling and repeated word in commit message, caught by > > checkpatch. > > v3: > > * Try to fix git reference by making part of a series. > > * Add --in-reply-to v1 when sending email. > > v2: > > * Fix spelling and repeated word in commit message, caught by > > checkpatch. > > > > Signed-off-by: Morten Brørup <m...@smartsharesystems.com> > > I am retracting this second part of the patch series, and reopening the > original patch instead. This second part is probably not going to make it to > 22.11 anyway.
Indeed, I have decided to take patch 1 only, which is reviewed. > Instead, I am going to provide another patch series (after 22.11) to split > the current RTE_LIBRTE_MEMPOOL_DEBUG define in two: RTE_LIBRTE_MEMPOOL_STATS > for statistics, and RTE_LIBRTE_MEMPOOL_DEBUG for debugging. And then this > patch can be added to the RTE_LIBRTE_MEMPOOL_STATS.