patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH v1 2/2] app/test: collect perf data after worker threads exit
       [not found] <20201222063054.44429-1-feifei.wang2@arm.com>
@ 2020-12-22  6:30 ` Feifei Wang
       [not found] ` <20210310021241.19057-1-feifei.wang2@arm.com>
       [not found] ` <20210310021527.19305-1-feifei.wang2@arm.com>
  2 siblings, 0 replies; 4+ messages in thread
From: Feifei Wang @ 2020-12-22  6:30 UTC (permalink / raw)
  To: Jerin Jacob, Sunil Kumar Kori, David Marchand
  Cc: dev, nd, Honnappa.Nagarahalli, ruifeng.wang, Feifei Wang, stable

The measure_perf function should be excuted after worker threads exit
to collect correct perf data. Otherwise, while workers are running, the
main thread may get incomplete data from workers.

In the meanwhile, remove unnecessary barrier in the test.
For signal variables "ldata.done" and "ldata.start", no operations
should keep the order that being executed after them. So the wmb after
them can be moved.

Fixes: 16a277a24c9f ("test/trace: add performance test cases")
Cc: jerinj@marvell.com
Cc: stable@dpdk.org

Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
---
 app/test/test_trace_perf.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/app/test/test_trace_perf.c b/app/test/test_trace_perf.c
index e1ad8e6f5..46ae7d807 100644
--- a/app/test/test_trace_perf.c
+++ b/app/test/test_trace_perf.c
@@ -79,7 +79,6 @@ signal_workers_to_finish(struct test_data *data)
 
 	for (workers = 0; workers < data->nb_workers; workers++) {
 		data->ldata[workers].done = 1;
-		rte_smp_wmb();
 	}
 }
 
@@ -102,7 +101,6 @@ worker_fn_##func(void *arg) \
 { \
 	struct lcore_data *ldata = arg; \
 	ldata->started = 1; \
-	rte_smp_wmb(); \
 	__worker_##func(ldata); \
 	return 0; \
 }
@@ -137,11 +135,12 @@ run_test(const char *str, lcore_function_t f, struct test_data *data, size_t sz)
 
 	wait_till_workers_are_ready(data);
 	rte_delay_ms(100); /* Wait for some time to accumulate the stats */
-	measure_perf(str, data);
 	signal_workers_to_finish(data);
 
 	RTE_LCORE_FOREACH_WORKER(id)
 		rte_eal_wait_lcore(id);
+
+	measure_perf(str, data);
 }
 
 static int
-- 
2.17.1


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

* [dpdk-stable] [PATCH v3 1/1] test/trace: collect perf data after worker threads exit
       [not found] ` <20210310021241.19057-1-feifei.wang2@arm.com>
@ 2021-03-10  2:12   ` Feifei Wang
  0 siblings, 0 replies; 4+ messages in thread
From: Feifei Wang @ 2021-03-10  2:12 UTC (permalink / raw)
  To: Jerin Jacob, Sunil Kumar Kori, David Marchand
  Cc: dev, nd, Feifei Wang, stable, Honnappa Nagarahalli, Pavan Nikhilesh

The measure_perf function should be executed after worker threads exit
to collect correct perf data. Otherwise, while workers are running, the
main thread may get incomplete data from workers.

In the meanwhile, remove unnecessary barrier in the test.
For signal variables "ldata.done" and "ldata.start", no operations
should keep the order that being executed after them. So the wmb after
them can be moved.

Fixes: 16a277a24c9f ("test/trace: add performance test cases")
Cc: jerinj@marvell.com
Cc: stable@dpdk.org

Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
 app/test/test_trace_perf.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/app/test/test_trace_perf.c b/app/test/test_trace_perf.c
index e1ad8e6f5..46ae7d807 100644
--- a/app/test/test_trace_perf.c
+++ b/app/test/test_trace_perf.c
@@ -79,7 +79,6 @@ signal_workers_to_finish(struct test_data *data)
 
 	for (workers = 0; workers < data->nb_workers; workers++) {
 		data->ldata[workers].done = 1;
-		rte_smp_wmb();
 	}
 }
 
@@ -102,7 +101,6 @@ worker_fn_##func(void *arg) \
 { \
 	struct lcore_data *ldata = arg; \
 	ldata->started = 1; \
-	rte_smp_wmb(); \
 	__worker_##func(ldata); \
 	return 0; \
 }
@@ -137,11 +135,12 @@ run_test(const char *str, lcore_function_t f, struct test_data *data, size_t sz)
 
 	wait_till_workers_are_ready(data);
 	rte_delay_ms(100); /* Wait for some time to accumulate the stats */
-	measure_perf(str, data);
 	signal_workers_to_finish(data);
 
 	RTE_LCORE_FOREACH_WORKER(id)
 		rte_eal_wait_lcore(id);
+
+	measure_perf(str, data);
 }
 
 static int
-- 
2.25.1


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

* [dpdk-stable] [PATCH v3 1/1] test/trace: collect perf data after worker threads exit
       [not found] ` <20210310021527.19305-1-feifei.wang2@arm.com>
@ 2021-03-10  2:15   ` Feifei Wang
  2021-04-14 14:14     ` David Marchand
  0 siblings, 1 reply; 4+ messages in thread
From: Feifei Wang @ 2021-03-10  2:15 UTC (permalink / raw)
  To: Jerin Jacob, Sunil Kumar Kori, David Marchand
  Cc: dev, nd, Feifei Wang, stable, Honnappa Nagarahalli,
	Honnappa Nagarahalli, Ruifeng Wang, Pavan Nikhilesh

The measure_perf function should be executed after worker threads exit
to collect correct perf data. Otherwise, while workers are running, the
main thread may get incomplete data from workers.

In the meanwhile, remove unnecessary barrier in the test.
For signal variables "ldata.done" and "ldata.start", no operations
should keep the order that being executed after them. So the wmb after
them can be moved.

Fixes: 16a277a24c9f ("test/trace: add performance test cases")
Cc: jerinj@marvell.com
Cc: stable@dpdk.org

Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Jerin Jacob <jerinj@marvell.com>
---
 app/test/test_trace_perf.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/app/test/test_trace_perf.c b/app/test/test_trace_perf.c
index e1ad8e6f5..46ae7d807 100644
--- a/app/test/test_trace_perf.c
+++ b/app/test/test_trace_perf.c
@@ -79,7 +79,6 @@ signal_workers_to_finish(struct test_data *data)
 
 	for (workers = 0; workers < data->nb_workers; workers++) {
 		data->ldata[workers].done = 1;
-		rte_smp_wmb();
 	}
 }
 
@@ -102,7 +101,6 @@ worker_fn_##func(void *arg) \
 { \
 	struct lcore_data *ldata = arg; \
 	ldata->started = 1; \
-	rte_smp_wmb(); \
 	__worker_##func(ldata); \
 	return 0; \
 }
@@ -137,11 +135,12 @@ run_test(const char *str, lcore_function_t f, struct test_data *data, size_t sz)
 
 	wait_till_workers_are_ready(data);
 	rte_delay_ms(100); /* Wait for some time to accumulate the stats */
-	measure_perf(str, data);
 	signal_workers_to_finish(data);
 
 	RTE_LCORE_FOREACH_WORKER(id)
 		rte_eal_wait_lcore(id);
+
+	measure_perf(str, data);
 }
 
 static int
-- 
2.25.1


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

* Re: [dpdk-stable] [PATCH v3 1/1] test/trace: collect perf data after worker threads exit
  2021-03-10  2:15   ` Feifei Wang
@ 2021-04-14 14:14     ` David Marchand
  0 siblings, 0 replies; 4+ messages in thread
From: David Marchand @ 2021-04-14 14:14 UTC (permalink / raw)
  To: Feifei Wang
  Cc: Jerin Jacob, Sunil Kumar Kori, dev, nd, dpdk stable,
	Honnappa Nagarahalli, Ruifeng Wang, Pavan Nikhilesh

On Wed, Mar 10, 2021 at 3:15 AM Feifei Wang <feifei.wang2@arm.com> wrote:
>
> The measure_perf function should be executed after worker threads exit
> to collect correct perf data. Otherwise, while workers are running, the
> main thread may get incomplete data from workers.
>
> In the meanwhile, remove unnecessary barrier in the test.
> For signal variables "ldata.done" and "ldata.start", no operations
> should keep the order that being executed after them. So the wmb after
> them can be moved.
>
> Fixes: 16a277a24c9f ("test/trace: add performance test cases")
> Cc: stable@dpdk.org
>
> Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>
> Signed-off-by: Feifei Wang <feifei.wang2@arm.com>
> Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
> Acked-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> Acked-by: Jerin Jacob <jerinj@marvell.com>

Applied, thanks.


-- 
David Marchand


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

end of thread, other threads:[~2021-04-14 14:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20201222063054.44429-1-feifei.wang2@arm.com>
2020-12-22  6:30 ` [dpdk-stable] [PATCH v1 2/2] app/test: collect perf data after worker threads exit Feifei Wang
     [not found] ` <20210310021241.19057-1-feifei.wang2@arm.com>
2021-03-10  2:12   ` [dpdk-stable] [PATCH v3 1/1] test/trace: " Feifei Wang
     [not found] ` <20210310021527.19305-1-feifei.wang2@arm.com>
2021-03-10  2:15   ` Feifei Wang
2021-04-14 14:14     ` David Marchand

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).