patch 'test: add pause to synchronization spinloops' has been queued to stable release 25.11.1
Kevin Traynor
ktraynor at redhat.com
Thu Mar 19 11:03:10 CET 2026
Hi,
FYI, your patch has been queued to stable release 25.11.1
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 03/23/26. So please
shout if anyone has objections.
Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.
Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable
This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/dadadc90513db11ec0da9bc23e20a0e07b9df6ce
Thanks.
Kevin
---
>From dadadc90513db11ec0da9bc23e20a0e07b9df6ce Mon Sep 17 00:00:00 2001
From: Stephen Hemminger <stephen at networkplumber.org>
Date: Thu, 5 Mar 2026 09:50:55 -0800
Subject: [PATCH] test: add pause to synchronization spinloops
[ upstream commit 0df23c6d0714d5aa676c06b8c6037a0810222607 ]
The atomic and thread tests use tight spinloops to synchronize.
These spinloops lack rte_pause() which causes problems on high core
count systems, particularly AMD Zen architectures where:
- Tight spinloops without pause can starve SMT sibling threads
- Memory ordering and store-buffer forwarding behave differently
- Higher core counts amplify timing windows for race conditions
This manifests as sporadic test failures on systems with 32+ cores
that don't reproduce on smaller core count systems.
Add rte_pause() to all seven synchronization spinloops to allow
proper CPU resource sharing and improve memory ordering behavior.
Fixes: af75078fece3 ("first public release")
Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
app/test/test_atomic.c | 15 ++++++++-------
app/test/test_threads.c | 17 +++++++++--------
2 files changed, 17 insertions(+), 15 deletions(-)
diff --git a/app/test/test_atomic.c b/app/test/test_atomic.c
index 3f26ce88d9..c24bc5fdd2 100644
--- a/app/test/test_atomic.c
+++ b/app/test/test_atomic.c
@@ -16,4 +16,5 @@
#include <rte_eal.h>
#include <rte_lcore.h>
+#include <rte_pause.h>
#include <rte_random.h>
#include <rte_hash_crc.h>
@@ -115,5 +116,5 @@ test_atomic_usual(__rte_unused void *arg)
while (rte_atomic32_read(&synchro) == 0)
- ;
+ rte_pause();
for (i = 0; i < N; i++)
@@ -151,5 +152,5 @@ test_atomic_tas(__rte_unused void *arg)
{
while (rte_atomic32_read(&synchro) == 0)
- ;
+ rte_pause();
if (rte_atomic16_test_and_set(&a16))
@@ -172,5 +173,5 @@ test_atomic_addsub_and_return(__rte_unused void *arg)
while (rte_atomic32_read(&synchro) == 0)
- ;
+ rte_pause();
for (i = 0; i < N; i++) {
@@ -211,5 +212,5 @@ test_atomic_inc_and_test(__rte_unused void *arg)
{
while (rte_atomic32_read(&synchro) == 0)
- ;
+ rte_pause();
if (rte_atomic16_inc_and_test(&a16)) {
@@ -238,5 +239,5 @@ test_atomic_dec_and_test(__rte_unused void *arg)
{
while (rte_atomic32_read(&synchro) == 0)
- ;
+ rte_pause();
if (rte_atomic16_dec_and_test(&a16))
@@ -270,5 +271,5 @@ test_atomic128_cmp_exchange(__rte_unused void *arg)
while (rte_atomic32_read(&synchro) == 0)
- ;
+ rte_pause();
expected = count128;
@@ -408,5 +409,5 @@ test_atomic_exchange(__rte_unused void *arg)
/* Wait until all of the other threads have been dispatched */
while (rte_atomic32_read(&synchro) == 0)
- ;
+ rte_pause();
/*
diff --git a/app/test/test_threads.c b/app/test/test_threads.c
index 6d6881a4f6..629f8aaf85 100644
--- a/app/test/test_threads.c
+++ b/app/test/test_threads.c
@@ -8,4 +8,5 @@
#include <rte_debug.h>
#include <rte_stdatomic.h>
+#include <rte_pause.h>
#include "test.h"
@@ -24,5 +25,5 @@ thread_main(void *arg)
while (rte_atomic_load_explicit(&thread_id_ready, rte_memory_order_acquire) == 1)
- ;
+ rte_pause();
return 0;
@@ -40,5 +41,5 @@ test_thread_create_join(void)
while (rte_atomic_load_explicit(&thread_id_ready, rte_memory_order_acquire) == 0)
- ;
+ rte_pause();
RTE_TEST_ASSERT(rte_thread_equal(thread_id, thread_main_id) != 0,
@@ -64,5 +65,5 @@ test_thread_create_detach(void)
while (rte_atomic_load_explicit(&thread_id_ready, rte_memory_order_acquire) == 0)
- ;
+ rte_pause();
RTE_TEST_ASSERT(rte_thread_equal(thread_id, thread_main_id) != 0,
@@ -88,5 +89,5 @@ test_thread_priority(void)
while (rte_atomic_load_explicit(&thread_id_ready, rte_memory_order_acquire) == 0)
- ;
+ rte_pause();
priority = RTE_THREAD_PRIORITY_NORMAL;
@@ -140,5 +141,5 @@ test_thread_affinity(void)
while (rte_atomic_load_explicit(&thread_id_ready, rte_memory_order_acquire) == 0)
- ;
+ rte_pause();
RTE_TEST_ASSERT(rte_thread_get_affinity_by_id(thread_id, &cpuset0) == 0,
@@ -193,5 +194,5 @@ test_thread_attributes_affinity(void)
while (rte_atomic_load_explicit(&thread_id_ready, rte_memory_order_acquire) == 0)
- ;
+ rte_pause();
RTE_TEST_ASSERT(rte_thread_get_affinity_by_id(thread_id, &cpuset1) == 0,
@@ -222,5 +223,5 @@ test_thread_attributes_priority(void)
while (rte_atomic_load_explicit(&thread_id_ready, rte_memory_order_acquire) == 0)
- ;
+ rte_pause();
RTE_TEST_ASSERT(rte_thread_get_priority(thread_id, &priority) == 0,
@@ -246,5 +247,5 @@ test_thread_control_create_join(void)
while (rte_atomic_load_explicit(&thread_id_ready, rte_memory_order_acquire) == 0)
- ;
+ rte_pause();
RTE_TEST_ASSERT(rte_thread_equal(thread_id, thread_main_id) != 0,
--
2.53.0
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2026-03-19 10:01:09.160120136 +0000
+++ 0072-test-add-pause-to-synchronization-spinloops.patch 2026-03-19 10:01:07.129673958 +0000
@@ -1 +1 @@
-From 0df23c6d0714d5aa676c06b8c6037a0810222607 Mon Sep 17 00:00:00 2001
+From dadadc90513db11ec0da9bc23e20a0e07b9df6ce Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 0df23c6d0714d5aa676c06b8c6037a0810222607 ]
+
@@ -21 +22,0 @@
-Cc: stable at dpdk.org
@@ -31 +32 @@
-index 8160a33e0e..b1a0d40ece 100644
+index 3f26ce88d9..c24bc5fdd2 100644
@@ -90 +91 @@
-index 5cd8bd4559..e2700b4a92 100644
+index 6d6881a4f6..629f8aaf85 100644
More information about the stable
mailing list