203dcc9cfe
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> |
||
---|---|---|
.. | ||
mempool_trace_points.c | ||
meson.build | ||
rte_mempool_ops_default.c | ||
rte_mempool_ops.c | ||
rte_mempool_trace_fp.h | ||
rte_mempool_trace.h | ||
rte_mempool.c | ||
rte_mempool.h | ||
version.map |