DPDK usage discussions
 help / color / mirror / Atom feed
* Multiple rte_launch_remote multiple times on main lcore
@ 2023-06-20 15:33 Antonio Di Bacco
  2023-06-25 14:49 ` Stephen Hemminger
  0 siblings, 1 reply; 4+ messages in thread
From: Antonio Di Bacco @ 2023-06-20 15:33 UTC (permalink / raw)
  To: users

Is it possible to launch multiple threads on the main lcore?
Who will be in charge of scheduling those threads on the main lcore
(main lcore is isolated)?

Not the OS I suppose.

Thank you

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

* Re: Multiple rte_launch_remote multiple times on main lcore
  2023-06-20 15:33 Multiple rte_launch_remote multiple times on main lcore Antonio Di Bacco
@ 2023-06-25 14:49 ` Stephen Hemminger
  2023-06-27 18:20   ` Antonio Di Bacco
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2023-06-25 14:49 UTC (permalink / raw)
  To: Antonio Di Bacco; +Cc: users

On Tue, 20 Jun 2023 17:33:59 +0200
Antonio Di Bacco <a.dibacco.ks@gmail.com> wrote:

> Is it possible to launch multiple threads on the main lcore?
> Who will be in charge of scheduling those threads on the main lcore
> (main lcore is isolated)?
> 
> Not the OS I suppose.
> 
> Thank you

If you start trying to add threads like this, it will lead to
all sorts of locking problems.  When one thread gets the lock
and then gets preempted by the scheduler and another thread
(bound to same lcore) tries to acquire the lock, it will spin
and wait until the first thread is rescheduled.

DPDK was designed for dedicated threads per lcore.

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

* Re: Multiple rte_launch_remote multiple times on main lcore
  2023-06-25 14:49 ` Stephen Hemminger
@ 2023-06-27 18:20   ` Antonio Di Bacco
  2023-06-27 22:40     ` Stephen Hemminger
  0 siblings, 1 reply; 4+ messages in thread
From: Antonio Di Bacco @ 2023-06-27 18:20 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: users

This is very useful. Anyway, just on main_lcore, could I launch many
pthreads (with pthread_create) ?

Does this interfere with DPDK?

On Sun, Jun 25, 2023 at 4:49 PM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> On Tue, 20 Jun 2023 17:33:59 +0200
> Antonio Di Bacco <a.dibacco.ks@gmail.com> wrote:
>
> > Is it possible to launch multiple threads on the main lcore?
> > Who will be in charge of scheduling those threads on the main lcore
> > (main lcore is isolated)?
> >
> > Not the OS I suppose.
> >
> > Thank you
>
> If you start trying to add threads like this, it will lead to
> all sorts of locking problems.  When one thread gets the lock
> and then gets preempted by the scheduler and another thread
> (bound to same lcore) tries to acquire the lock, it will spin
> and wait until the first thread is rescheduled.
>
> DPDK was designed for dedicated threads per lcore.

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

* Re: Multiple rte_launch_remote multiple times on main lcore
  2023-06-27 18:20   ` Antonio Di Bacco
@ 2023-06-27 22:40     ` Stephen Hemminger
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2023-06-27 22:40 UTC (permalink / raw)
  To: Antonio Di Bacco; +Cc: users

On Tue, 27 Jun 2023 20:20:28 +0200
Antonio Di Bacco <a.dibacco.ks@gmail.com> wrote:

> This is very useful. Anyway, just on main_lcore, could I launch many
> pthreads (with pthread_create) ?
> 
> Does this interfere with DPDK?

DPDK is not designed for random additional threads.
You could use rte_ctrl_thread_create or do the working of creating, binding threads to cores,
and registering; but the startup does that already.

DPDK is designed for run to completion model where there is one thread bound to a core (and isolated).
You can try other things, but that makes things worse not better.
performance will be worse, can deadlock, will require additional locking etc.

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

end of thread, other threads:[~2023-06-27 22:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-20 15:33 Multiple rte_launch_remote multiple times on main lcore Antonio Di Bacco
2023-06-25 14:49 ` Stephen Hemminger
2023-06-27 18:20   ` Antonio Di Bacco
2023-06-27 22:40     ` 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).