Skip to content

Commit

Permalink
mempool: add cache guard to per-lcore debug statistics
Browse files Browse the repository at this point in the history
The per-lcore debug statistics, if enabled, are frequently written by
their individual lcores, so add a cache guard to prevent false sharing
in case the CPU employs a next-N-lines (or similar) hardware prefetcher.

Signed-off-by: Morten Brørup <[email protected]>
Reviewed-by: Andrew Rybchenko <[email protected]>
  • Loading branch information
MortenBroerup authored and tmonjalo committed Oct 11, 2023
1 parent 0b765b4 commit a193421
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/mempool/rte_mempool.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a193421

Please sign in to comment.