mempool: add cache guard to per-lcore debug statistics
PATCH 1/1 mempool: add cache guard to per-lcore debug statistics
The per-lcore debug statistics, if enabled, are frequently written by their individual lcores, so add a cache guard to prevent CPU cache thrashing.
Depends-on: series-29415 ("clarify purpose of empty cache lines")
--- lib/mempool/rte_mempool.h | 1 + 1 file changed, 1 insertion(+)
lib/mempool/rte_mempool.h +1 -0
@@ -78,6 +78,7 @@ struct rte_mempool_debug_stats {uint64_t get_fail_objs;/**< Objects that failed to be allocated. */ uint64_t get_success_blks;/**< Successful allocation number of contiguous blocks. */ uint64_t get_fail_blks;/**< Failed allocation number of contiguous blocks. */ + RTE_CACHE_GUARD; } __rte_cache_aligned;#endif
Signature · 1 line
2.17.1
PING for review.
Quoted 31 lines
From: Morten Brørup [mailto:[email protected]]
Sent: Monday, 4 September 2023 11.10The per-lcore debug statistics, if enabled, are frequently written by their individual lcores, so add a cache guard to prevent CPU cache thrashing.
Depends-on: series-29415 ("clarify purpose of empty cache lines")
Signed-off-by Morten Brørup <[email protected]>--- lib/mempool/rte_mempool.h | 1 + 1 file changed, 1 insertion(+)lib/mempool/rte_mempool.h +0
-0@@ -78,6 +78,7 @@ struct rte_mempool_debug_stats {uint64_t get_fail_objs;/**< Objects that failed to be allocated. */
uint64_tget_success_blks; /**< Successful allocation number
of contiguous blocks. */
uint64_tget_fail_blks; /**< Failed allocation number of
contiguous blocks. */lib/mempool/rte_mempool.h +1
-1+ RTE_CACHE_GUARD; } __rte_cache_aligned;#endif --2.17.1
Quoted 7 lines · Morten Brørup
The per-lcore debug statistics, if enabled, are frequently written by their individual lcores, so add a cache guard to prevent CPU cache thrashing.
Depends-on: series-29415 ("clarify purpose of empty cache lines")
Signed-off-by Morten Brørup <[email protected]>
Thomas Monjalon
Applied30/09/2023 08:24, Andrew Rybchenko:
Quoted 10 lines · Morten Brørup
Quoted 7 lines
The per-lcore debug statistics, if enabled, are frequently written by their individual lcores, so add a cache guard to prevent CPU cache thrashing.
Depends-on: series-29415 ("clarify purpose of empty cache lines")
Signed-off-by Morten Brørup <[email protected]>Reviewed-by Andrew Rybchenko <[email protected]>
Applied, thanks.