public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Konstantin Ananyev <konstantin.ananyev@huawei.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	"stable@dpdk.org" <stable@dpdk.org>,
	Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>,
	Phil Yang <phil.yang@arm.com>, Gavin Hu <gahu@nvidia.com>
Subject: Re: [PATCH v3 03/14] test/mcslock: scale test based on number of cores
Date: Tue, 27 Jan 2026 12:31:20 -0800	[thread overview]
Message-ID: <20260127123120.1d636ac9@phoenix.local> (raw)
In-Reply-To: <a2a269c7f13043d0b948fa67769d88d2@huawei.com>

On Thu, 22 Jan 2026 10:41:04 +0000
Konstantin Ananyev <konstantin.ananyev@huawei.com> wrote:

> > This test uses loops to synchronize but has problems on systems
> > with high number of cores. Scale iterations to the number of
> > cores.
> > 
> > Fixes: 32dcb9fd2a22 ("test/mcslock: add MCS queued lock unit test")
> > Cc: stable@dpdk.org
> > 
> > Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> > ---
> >  app/test/test_mcslock.c | 10 +++++++---
> >  1 file changed, 7 insertions(+), 3 deletions(-)
> > 
> > diff --git a/app/test/test_mcslock.c b/app/test/test_mcslock.c
> > index 245df99a5d..b182da72f1 100644
> > --- a/app/test/test_mcslock.c
> > +++ b/app/test/test_mcslock.c
> > @@ -42,6 +42,10 @@ RTE_ATOMIC(rte_mcslock_t *) p_ml_perf;
> > 
> >  static unsigned int count;
> > 
> > +#define MAX_LOOP_BASE  1000000u
> > +#define MAX_LOOP_MIN   10000u
> > +static unsigned int max_loop;
> > +
> >  static RTE_ATOMIC(uint32_t) synchro;
> > 
> >  static int
> > @@ -60,8 +64,6 @@ test_mcslock_per_core(__rte_unused void *arg)
> > 
> >  static uint64_t time_count[RTE_MAX_LCORE] = {0};
> > 
> > -#define MAX_LOOP 1000000
> > -
> >  static int
> >  load_loop_fn(void *func_param)
> >  {
> > @@ -78,7 +80,7 @@ load_loop_fn(void *func_param)
> >  	rte_wait_until_equal_32((uint32_t *)(uintptr_t)&synchro, 1,
> > rte_memory_order_relaxed);
> > 
> >  	begin = rte_get_timer_cycles();
> > -	while (lcount < MAX_LOOP) {
> > +	while (lcount < max_loop) {
> >  		if (use_lock)
> >  			rte_mcslock_lock(&p_ml_perf, &ml_perf_me);
> > 
> > @@ -175,6 +177,8 @@ test_mcslock(void)
> >  	rte_mcslock_t ml_me;
> >  	rte_mcslock_t ml_try_me;
> > 
> > +	max_loop = test_scale_iterations(MAX_LOOP_BASE, MAX_LOOP_MIN);
> > +  
> 
> Here, and in other similar cases, would it make sense to terminate by timeout
> (i.e. number of cycles passed since start of the test)?
>  

Thought about that but there are couple of issues:
 1. The act of reading the TSC value would change CPU behavior and reduce
    the amount of contention. Potentially hiding bugs.
 2. If the test suddenly had much worse performance, the number of iterations
    would be much less but if test was based on timeout it wouldn't see it.

Conclusion: keep original iteration based limits

  reply	other threads:[~2026-01-27 20:31 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-18 20:09 [PATCH 0/6] test: fix sporadic failures on high core count systems Stephen Hemminger
2026-01-18 20:09 ` [PATCH 1/6] test: add pause to synchronization spinloops Stephen Hemminger
2026-01-18 20:09 ` [PATCH 2/6] test: fix timeout for atomic test on high core count systems Stephen Hemminger
2026-01-18 20:09 ` [PATCH 3/6] test: fix race condition in ELF load tests Stephen Hemminger
2026-01-19 11:42   ` Marat Khalili
2026-01-20  0:03     ` Stephen Hemminger
2026-01-20 10:30       ` Marat Khalili
2026-01-19 18:24   ` Stephen Hemminger
2026-01-18 20:09 ` [PATCH 4/6] test: fix unsupported BPF instructions in elf load test Stephen Hemminger
2026-01-19 11:43   ` Marat Khalili
2026-01-18 20:09 ` [PATCH 5/6] test: add file-prefix for all fast-tests on Linux Stephen Hemminger
2026-01-19 13:06   ` Marat Khalili
2026-01-19 14:01     ` Bruce Richardson
2026-01-18 20:09 ` [PATCH 6/6] test: fix trace_autotest_with_traces parallel execution Stephen Hemminger
2026-01-19 13:13   ` Marat Khalili
2026-01-20  0:07     ` Stephen Hemminger
2026-01-20 11:36       ` Marat Khalili
2026-01-22  0:50 ` [PATCH v3 00/14] test: fix test failures on high cores Stephen Hemminger
2026-01-22  0:50   ` [PATCH v3 01/14] test: add pause to synchronization spinloops Stephen Hemminger
2026-01-22  0:50   ` [PATCH v3 02/14] test: scale atomic test based on core count Stephen Hemminger
2026-01-22  0:50   ` [PATCH v3 03/14] test/mcslock: scale test based on number of cores Stephen Hemminger
2026-01-22 10:41     ` Konstantin Ananyev
2026-01-27 20:31       ` Stephen Hemminger [this message]
2026-01-22  0:50   ` [PATCH v3 04/14] test/stack: " Stephen Hemminger
2026-01-22  0:50   ` [PATCH v3 05/14] test/timer: " Stephen Hemminger
2026-01-22  0:50   ` [PATCH v3 06/14] test/bpf: fix error handling in ELF load tests Stephen Hemminger
2026-01-22  0:50   ` [PATCH v3 07/14] test/bpf: fix unsupported BPF instructions in ELF load test Stephen Hemminger
2026-01-22 10:33     ` Konstantin Ananyev
2026-01-22  0:50   ` [PATCH v3 08/14] test/bpf: skip ELF test if null PMD disabled Stephen Hemminger
2026-01-23 11:56     ` Marat Khalili
2026-01-22  0:50   ` [PATCH v3 09/14] test: add file-prefix for all fast-tests on Linux Stephen Hemminger
2026-01-22  0:50   ` [PATCH v3 10/14] test: fix trace_autotest_with_traces parallel execution Stephen Hemminger
2026-01-22  0:50   ` [PATCH v3 11/14] test/eventdev: skip test if eventdev driver disabled Stephen Hemminger
2026-01-22 20:40     ` Stephen Hemminger
2026-01-23  9:06       ` Bruce Richardson
2026-01-22  0:50   ` [PATCH v3 12/14] test/pcapng: skip test if null driver missing Stephen Hemminger
2026-01-22  0:50   ` [PATCH v3 13/14] test/vdev: skip test if no null PMD Stephen Hemminger
2026-01-22  0:50   ` [PATCH v3 14/14] test/bpf: pass correct size for Rx/Tx load tests Stephen Hemminger
2026-01-23 11:50     ` Marat Khalili
2026-03-05 16:39   ` [PATCH v3 00/14] test: fix test failures on high cores David Marchand
2026-03-05 17:50 ` [PATCH v4 00/11] test: fix test failures on high core count systems Stephen Hemminger
2026-03-05 17:50   ` [PATCH v4 01/11] test: add pause to synchronization spinloops Stephen Hemminger
2026-03-05 17:50   ` [PATCH v4 02/11] test/atomic: scale test based on core count Stephen Hemminger
2026-03-05 17:50   ` [PATCH v4 03/11] test/mcslock: scale test based on number of cores Stephen Hemminger
2026-03-05 17:50   ` [PATCH v4 04/11] test/stack: " Stephen Hemminger
2026-03-05 17:50   ` [PATCH v4 05/11] test/timer: " Stephen Hemminger
2026-03-05 17:51   ` [PATCH v4 06/11] test/timer: replace volatile with C11 atomics Stephen Hemminger
2026-03-05 17:51   ` [PATCH v4 07/11] test: add file-prefix for all fast-tests on Linux Stephen Hemminger
2026-03-05 17:51   ` [PATCH v4 08/11] test: fix trace_autotest_with_traces parallel execution Stephen Hemminger
2026-03-05 17:51   ` [PATCH v4 09/11] test/bpf: fix error handling in ELF load tests Stephen Hemminger
2026-03-05 17:51   ` [PATCH v4 10/11] test/bpf: fix unsupported BPF instructions in ELF load test Stephen Hemminger
2026-03-05 17:51   ` [PATCH v4 11/11] test/bpf: pass correct size for Rx/Tx load tests Stephen Hemminger
2026-03-17 13:28   ` [PATCH v4 00/11] test: fix test failures on high core count systems Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260127123120.1d636ac9@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=gahu@nvidia.com \
    --cc=honnappa.nagarahalli@arm.com \
    --cc=konstantin.ananyev@huawei.com \
    --cc=phil.yang@arm.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox