[dpdk-dev] 回复: [PATCH v2 1/1] app/test: collect perf data after worker threads exit
Feifei Wang
Feifei.Wang2 at arm.com
Tue Mar 9 10:06:18 CET 2021
Hi, Jerin
Sorry to disturb you. Would you please help review this patch when you are free?
Thanks very much.
Best Regards
Feifei
> -----邮件原件-----
> 发件人: Feifei Wang <feifei.wang2 at arm.com>
> 发送时间: 2021年2月25日 17:32
> 收件人: jerinj at marvell.com; Sunil Kumar Kori <skori at marvell.com>; David
> Marchand <david.marchand at redhat.com>
> 抄送: dev at dpdk.org; nd <nd at arm.com>; Feifei Wang
> <Feifei.Wang2 at arm.com>; stable at dpdk.org; Honnappa Nagarahalli
> <Honnappa.Nagarahalli at arm.com>; Honnappa Nagarahalli
> <Honnappa.Nagarahalli at arm.com>; Ruifeng Wang
> <Ruifeng.Wang at arm.com>
> 主题: [PATCH v2 1/1] app/test: collect perf data after worker threads exit
>
> 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 at marvell.com
> Cc: stable at dpdk.org
>
> Suggested-by: Honnappa Nagarahalli <honnappa.nagarahalli at arm.com>
> Signed-off-by: Feifei Wang <feifei.wang2 at arm.com>
> Reviewed-by: Honnappa Nagarahalli <Honnappa.Nagarahalli at arm.com>
> Reviewed-by: Ruifeng Wang <ruifeng.wang at 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.25.1
More information about the dev
mailing list