DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] eal: add cache guard to per-lcore PRNG state
@ 2023-09-04  9:26 Morten Brørup
  2023-09-04 11:57 ` Mattias Rönnblom
  0 siblings, 1 reply; 8+ messages in thread
From: Morten Brørup @ 2023-09-04  9:26 UTC (permalink / raw)
  To: thomas, david.marchand, mattias.ronnblom, bruce.richardson
  Cc: olivier.matz, andrew.rybchenko, honnappa.nagarahalli,
	konstantin.v.ananyev, dev, Morten Brørup

The per-lcore random state is frequently updated 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 <mb@smartsharesystems.com>
---
 lib/eal/common/rte_random.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/eal/common/rte_random.c b/lib/eal/common/rte_random.c
index 565f2401ce..3df0c7004a 100644
--- a/lib/eal/common/rte_random.c
+++ b/lib/eal/common/rte_random.c
@@ -18,6 +18,7 @@ struct rte_rand_state {
 	uint64_t z3;
 	uint64_t z4;
 	uint64_t z5;
+	RTE_CACHE_GUARD;
 } __rte_cache_aligned;
 
 /* One instance each for every lcore id-equipped thread, and one
-- 
2.17.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-10-11 22:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-04  9:26 [PATCH] eal: add cache guard to per-lcore PRNG state Morten Brørup
2023-09-04 11:57 ` Mattias Rönnblom
2023-09-06 16:25   ` Stephen Hemminger
2023-10-11 16:07     ` Thomas Monjalon
2023-10-11 16:55       ` Morten Brørup
2023-10-11 22:49         ` Thomas Monjalon
2023-10-11 20:41       ` Mattias Rönnblom
2023-09-29 18:55   ` Morten Brørup

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).