* [dpdk-users] [DPDK 20.11] rte_eal_init() appear additional thread
@ 2021-08-17 1:51 Dong, Shaojie (NSB - CN/Hangzhou)
2021-08-17 3:43 ` Stephen Hemminger
0 siblings, 1 reply; 6+ messages in thread
From: Dong, Shaojie (NSB - CN/Hangzhou) @ 2021-08-17 1:51 UTC (permalink / raw)
To: users; +Cc: Meunier, Julien (Nokia - FR/Paris-Saclay)
Hi, DPDK expert
We updated dpdk version from 18.05 to 20.11
Using following parameter to call rte_eal_init() with secondary instance
dpdk_argc=5
dpdk_argv[0]=dpdk_monitor
dpdk_argv[1]=--proc-type=secondary
dpdk_argv[2]=--file-prefix=ccsrt_0x1231
dpdk_argv[3]=
dpdk_argv[4]=--no-pci
print from “ps -eL” for 20.11 version appear additional thread of dpdk_monitor
518 518 pts/2 00:00:00 dpdk_monitor
518 519 pts/2 00:00:00 eal-intr-thread
518 520 pts/2 00:00:00 rte_mp_handle
518 521 pts/2 00:00:00 lcore-worker-1
518 522 pts/2 00:00:00 lcore-worker-2
518 523 pts/2 00:00:00 lcore-worker-3
518 524 pts/2 00:00:00 dpdk_monitor
525 525 pts/4 00:00:00 ps
print from “ps -eL” for 18.05 version only one dpdk_monitor thread
345 345 pts/1 00:00:00 dpdk_monitor
345 346 pts/1 00:00:00 eal-intr-thread
345 347 pts/1 00:00:00 rte_mp_handle
345 348 pts/1 00:00:00 lcore-slave-1
345 349 pts/1 00:00:00 lcore-slave-2
345 350 pts/1 00:00:00 lcore-slave-3
351 351 pts/3 00:00:00 ps
//related code
ret = rte_eal_init(dpdk_argc, (char**)dpdk_argv);
if (ret < 0) {
fprintf(stderr, "%s - Cannot init the DPDK EAL!, rte_eal_init returned %d\n",
__FUNCTION__, ret);
proc_info_usage(argv[0]);
return GLO_FALSE;
}
else {
fprintf(stdout, "%s - ret_eal_init() successfull - lcore_id=%u\n",
__FUNCTION__, rte_lcore_id());
}
// rte_eal_init() log
EAL: Detected 24 lcore(s)
EAL: Detected 1 NUMA nodes
EAL: Multi-process socket /var/run/dpdk/ccsrt_0x1231/mp_socket_358_6dc4bc822f72
EAL: Selected IOVA mode 'PA'
EAL: Probing VFIO support...
EAL: WARNING: Address Space Layout Randomization (ASLR) is enabled in the kernel.
EAL: This may cause issues with mapping memory into secondary processes
EAL: No legacy callbacks, legacy socket not created
main - ret_eal_init() successfull - lcore_id=0
Could you please how to avoid this additional thread ?
//Attach the primary instance log,primary instance also appear double Disp_0 threads on 20.11 version compare with 18.05 version’s one Disp_0 thread
ccs_em_init_rt_snf_env: Call rte_eal_init with options:
ccs_em_init_rt_snf_env: -argv[0]= Disp_0
ccs_em_init_rt_snf_env: -argv[1]= --lcores
ccs_em_init_rt_snf_env: -argv[2]= 0@(0,1,2,3)
ccs_em_init_rt_snf_env: -argv[3]= -v
ccs_em_init_rt_snf_env: -argv[4]= -n
ccs_em_init_rt_snf_env: -argv[5]= 2
ccs_em_init_rt_snf_env: -argv[6]= -m
ccs_em_init_rt_snf_env: -argv[7]= 3072
ccs_em_init_rt_snf_env: -argv[8]= --huge-dir
ccs_em_init_rt_snf_env: -argv[9]= /mnt/huge2M
ccs_em_init_rt_snf_env: -argv[10]= --base-virtaddr
ccs_em_init_rt_snf_env: -argv[11]= 0x6a0000000000
ccs_em_init_rt_snf_env: -argv[12]= --legacy-mem
ccs_em_init_rt_snf_env: -argv[13]=
ccs_em_init_rt_snf_env: -argv[14]= --proc-type
ccs_em_init_rt_snf_env: -argv[15]= primary
ccs_em_init_rt_snf_env: -argv[16]= --file-prefix
ccs_em_init_rt_snf_env: -argv[17]= ccsrt_0x1231
ccs_em_init_rt_snf_env: -argv[18]=
ccs_em_init_rt_snf_env: -argv[19]= -w
ccs_em_init_rt_snf_env: -argv[20]= f4:00.1
ccs_em_init_rt_snf_env: -argv[21]= -w
ccs_em_init_rt_snf_env: -argv[22]= f4:00.2
ccs_em_init_rt_snf_env: -argv[23]= -w
ccs_em_init_rt_snf_env: -argv[24]= f4:00.3
ccs_em_init_rt_snf_env: -argv[25]= -w
ccs_em_init_rt_snf_env: -argv[26]= f4:00.4
ccs_em_init_rt_snf_env: -argv[27]= -w
ccs_em_init_rt_snf_env: -argv[28]= f4:00.5
ccs_em_init_rt_snf_env: -argv[29]= -w
ccs_em_init_rt_snf_env: -argv[30]= f4:00.6
ccs_em_rt_snf_init_sync: on core 3
EAL: No legacy callbacks, legacy socket not created
Debug/CCS/EM, dummy_thread: - ret_eal_init() successfull - lcore_id=0
Many thanks !
Shaojie.Dong
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-users] [DPDK 20.11] rte_eal_init() appear additional thread
2021-08-17 1:51 [dpdk-users] [DPDK 20.11] rte_eal_init() appear additional thread Dong, Shaojie (NSB - CN/Hangzhou)
@ 2021-08-17 3:43 ` Stephen Hemminger
2021-08-17 9:19 ` Dong, Shaojie (NSB - CN/Hangzhou)
0 siblings, 1 reply; 6+ messages in thread
From: Stephen Hemminger @ 2021-08-17 3:43 UTC (permalink / raw)
To: Dong, Shaojie (NSB - CN/Hangzhou)
Cc: users, Meunier, Julien (Nokia - FR/Paris-Saclay)
On Tue, 17 Aug 2021 01:51:14 +0000
"Dong, Shaojie (NSB - CN/Hangzhou)" <shaojie.dong@nokia-sbell.com> wrote:
> Hi, DPDK expert
>
>
>
> We updated dpdk version from 18.05 to 20.11
>
>
>
> Using following parameter to call rte_eal_init() with secondary instance
Which additional thread? When you start rte_eal_init it needs to create
several additional sleeping thread for monitoring.
If you don't want the worker/slave threads then either only use a cpuset
with a single CPU, or don't call rte_eal_launch()
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-users] [DPDK 20.11] rte_eal_init() appear additional thread
2021-08-17 3:43 ` Stephen Hemminger
@ 2021-08-17 9:19 ` Dong, Shaojie (NSB - CN/Hangzhou)
2021-08-17 9:26 ` David Marchand
2021-08-17 15:24 ` Stephen Hemminger
0 siblings, 2 replies; 6+ messages in thread
From: Dong, Shaojie (NSB - CN/Hangzhou) @ 2021-08-17 9:19 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: users, Meunier, Julien (Nokia - FR/Paris-Saclay)
Hi, Stephen
Thanks for your quickliy reply
I found the additional thread was created by following path on DPDK 20.11 version
rte_eal_init()->rte_telemetry_init()->telemetry_v2_init()->pthread_create()
Only call pthread_create() function to create this additional thread and then sleep all the time
DPDK code do not set this thread's name
So it inherits the main thread's name
Two threads with the same name are easy to confuse by business code
Does DPDK code support its name change ?
It was not worker/slave thread
-----Original Message-----
From: Stephen Hemminger <stephen@networkplumber.org>
Sent: Tuesday, August 17, 2021 11:44 AM
To: Dong, Shaojie (NSB - CN/Hangzhou) <shaojie.dong@nokia-sbell.com>
Cc: users@dpdk.org; Meunier, Julien (Nokia - FR/Paris-Saclay) <julien.meunier@nokia.com>
Subject: Re: [dpdk-users] [DPDK 20.11] rte_eal_init() appear additional thread
On Tue, 17 Aug 2021 01:51:14 +0000
"Dong, Shaojie (NSB - CN/Hangzhou)" <shaojie.dong@nokia-sbell.com> wrote:
> Hi, DPDK expert
>
>
>
> We updated dpdk version from 18.05 to 20.11
>
>
>
> Using following parameter to call rte_eal_init() with secondary
> instance
Which additional thread? When you start rte_eal_init it needs to create several additional sleeping thread for monitoring.
If you don't want the worker/slave threads then either only use a cpuset with a single CPU, or don't call rte_eal_launch()
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-users] [DPDK 20.11] rte_eal_init() appear additional thread
2021-08-17 9:19 ` Dong, Shaojie (NSB - CN/Hangzhou)
@ 2021-08-17 9:26 ` David Marchand
2021-08-18 1:53 ` Dong, Shaojie (NSB - CN/Hangzhou)
2021-08-17 15:24 ` Stephen Hemminger
1 sibling, 1 reply; 6+ messages in thread
From: David Marchand @ 2021-08-17 9:26 UTC (permalink / raw)
To: Dong, Shaojie (NSB - CN/Hangzhou)
Cc: Stephen Hemminger, users, Meunier, Julien (Nokia - FR/Paris-Saclay)
On Tue, Aug 17, 2021 at 11:19 AM Dong, Shaojie (NSB - CN/Hangzhou)
<shaojie.dong@nokia-sbell.com> wrote:
> I found the additional thread was created by following path on DPDK 20.11 version
>
> rte_eal_init()->rte_telemetry_init()->telemetry_v2_init()->pthread_create()
>
> Only call pthread_create() function to create this additional thread and then sleep all the time
> DPDK code do not set this thread's name
> So it inherits the main thread's name
>
> Two threads with the same name are easy to confuse by business code
> Does DPDK code support its name change ?
>
> It was not worker/slave thread
telemetry threads are renamed since 5da7736f8c53 ("telemetry: set
socket listener thread name") (with a followup fix).
--
David Marchand
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-users] [DPDK 20.11] rte_eal_init() appear additional thread
2021-08-17 9:19 ` Dong, Shaojie (NSB - CN/Hangzhou)
2021-08-17 9:26 ` David Marchand
@ 2021-08-17 15:24 ` Stephen Hemminger
1 sibling, 0 replies; 6+ messages in thread
From: Stephen Hemminger @ 2021-08-17 15:24 UTC (permalink / raw)
To: Dong, Shaojie (NSB - CN/Hangzhou)
Cc: users, Meunier, Julien (Nokia - FR/Paris-Saclay)
On Tue, 17 Aug 2021 09:19:40 +0000
"Dong, Shaojie (NSB - CN/Hangzhou)" <shaojie.dong@nokia-sbell.com> wrote:
> Hi, Stephen
>
> Thanks for your quickliy reply
>
> I found the additional thread was created by following path on DPDK 20.11 version
>
> rte_eal_init()->rte_telemetry_init()->telemetry_v2_init()->pthread_create()
>
> Only call pthread_create() function to create this additional thread and then sleep all the time
> DPDK code do not set this thread's name
> So it inherits the main thread's name
>
> Two threads with the same name are easy to confuse by business code
> Does DPDK code support its name change ?
>
> It was not worker/slave thread
The telemetry should be optional.
The thread name doesn't matter, it is only there for ps.
If you know the thread id, you can change it with pthread_setname_np
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [dpdk-users] [DPDK 20.11] rte_eal_init() appear additional thread
2021-08-17 9:26 ` David Marchand
@ 2021-08-18 1:53 ` Dong, Shaojie (NSB - CN/Hangzhou)
0 siblings, 0 replies; 6+ messages in thread
From: Dong, Shaojie (NSB - CN/Hangzhou) @ 2021-08-18 1:53 UTC (permalink / raw)
To: David Marchand
Cc: Stephen Hemminger, users, Meunier, Julien (Nokia - FR/Paris-Saclay)
Hello, David
Thank you very much for your information !
I found DPDK version 21.05 set this thread name as "telemetry-v2"
https://code.dpdk.org/dpdk/v21.05/source/lib/telemetry/telemetry.c#L541
-----Original Message-----
From: David Marchand <david.marchand@redhat.com>
Sent: Tuesday, August 17, 2021 5:26 PM
To: Dong, Shaojie (NSB - CN/Hangzhou) <shaojie.dong@nokia-sbell.com>
Cc: Stephen Hemminger <stephen@networkplumber.org>; users@dpdk.org; Meunier, Julien (Nokia - FR/Paris-Saclay) <julien.meunier@nokia.com>
Subject: Re: [dpdk-users] [DPDK 20.11] rte_eal_init() appear additional thread
On Tue, Aug 17, 2021 at 11:19 AM Dong, Shaojie (NSB - CN/Hangzhou) <shaojie.dong@nokia-sbell.com> wrote:
> I found the additional thread was created by following path on DPDK
> 20.11 version
>
> rte_eal_init()->rte_telemetry_init()->telemetry_v2_init()->pthread_cre
> ate()
>
> Only call pthread_create() function to create this additional thread
> and then sleep all the time DPDK code do not set this thread's name So
> it inherits the main thread's name
>
> Two threads with the same name are easy to confuse by business code
> Does DPDK code support its name change ?
>
> It was not worker/slave thread
telemetry threads are renamed since 5da7736f8c53 ("telemetry: set socket listener thread name") (with a followup fix).
--
David Marchand
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2021-08-18 1:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-17 1:51 [dpdk-users] [DPDK 20.11] rte_eal_init() appear additional thread Dong, Shaojie (NSB - CN/Hangzhou)
2021-08-17 3:43 ` Stephen Hemminger
2021-08-17 9:19 ` Dong, Shaojie (NSB - CN/Hangzhou)
2021-08-17 9:26 ` David Marchand
2021-08-18 1:53 ` Dong, Shaojie (NSB - CN/Hangzhou)
2021-08-17 15:24 ` Stephen Hemminger
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).