numam-dpdk/lib/mempool
Morten Brørup 203dcc9cfe mempool: use cache for frequently updated stats
When built with stats enabled (RTE_LIBRTE_MEMPOOL_STATS defined),
the performance of mempools with caches is improved as follows.

When accessing objects in the mempool, either the put_bulk and put_objs or
the get_success_bulk and get_success_objs statistics counters are likely
to be incremented.

By adding an alternative set of these counters to the mempool cache
structure, accessing the dedicated 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 access the 'len' or 'flushthresh' fields.
Updating some statistics counters in the same cache line has lower
performance cost than accessing the statistics counters in the dedicated
statistics structure, which resides in another cache line.

mempool_perf_autotest with this patch shows the following improvements in
rate_persec.

The cost of enabling mempool stats (without debug) after this patch:
-6.8 % and -6.7 %, respectively without and with cache.

Signed-off-by: Morten Brørup <mb@smartsharesystems.com>
Reviewed-by: Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Reviewed-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>
Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com>
2022-11-10 17:32:54 +01:00
..
mempool_trace_points.c
meson.build mempool: add telemetry endpoint 2021-10-22 22:40:59 +02:00
rte_mempool_ops_default.c
rte_mempool_ops.c dev: hide driver object 2022-09-23 16:14:34 +02:00
rte_mempool_trace_fp.h
rte_mempool_trace.h
rte_mempool.c mempool: use cache for frequently updated stats 2022-11-10 17:32:54 +01:00
rte_mempool.h mempool: use cache for frequently updated stats 2022-11-10 17:32:54 +01:00
version.map version: 22.11-rc0 2022-07-21 12:13:48 +02:00