From: Olivier MATZ <olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
To: Carlos Franco <kralosf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: dev-VfR2kkLFssw@public.gmane.org
Subject: Re: Preemption in rings
Date: Mon, 20 Jan 2014 14:13:23 +0100 [thread overview]
Message-ID: <52DD20F3.8070801@6wind.com> (raw)
In-Reply-To: <2AF1C8858EE34CAF98E426C4B8132229-jPLVf1o3Y1fQT0dZR+AlfA@public.gmane.org>
Hi Carlos,
On 01/18/2014 02:10 PM, Carlos Franco wrote:
> - a pthread doing multi-producers enqueues on a given ring must
> not be preempted by another pthread doing a multi-producer
> enqueue on the same ring.
>
> - a pthread doing multi-consumers dequeues on a given ring must
> not be preempted by another pthread doing a multi-consumer
> dequeue on the same ring.
>
> I suppose this is a something to be taken into account with
> threads not created by the DPDK rte, because the threads of DPDK
> are attached to a core and will never be scheduled into the cores
> of other DPDK threads, no?
Yes.
> I mean, lets only take into account the enqueuing. if there is a
> ring R where ONLY the DPDK threads enqueue packets, even if they
> are interrupted (IO access, sleep, mutex... ), and other non DPDK
> threads are scheduled into their cores, as long as only DPDK
> threads enqueue in the ring it is safe, no?
It's safe, but it may cause performance issue. For instance, if a
DPDK pthread is interrupted by the kernel during a critical period
of an enqueue, all other DPDK pthreads enqueueing on this ring will
block.
Of course, this could also happen with a rte_spinlock().
> If not, would prohibit the access to the DPDK used
> cores (isocpus) work?
Yes, using "isolcpu" is a good idea to avoid the problem described
above.
From my experience, using a simple "taskset" to force the other
applications to run on different cores than the DPDK is enough
to avoid significant performance issues. Indeed, the only problem
would be related to kernel work (interruptions and kernel threads),
and they shouldn't last long enough to fill the queues.
Regards,
Olivier
prev parent reply other threads:[~2014-01-20 13:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-18 13:10 Preemption in rings Carlos Franco
[not found] ` <2AF1C8858EE34CAF98E426C4B8132229-jPLVf1o3Y1fQT0dZR+AlfA@public.gmane.org>
2014-01-20 13:13 ` Olivier MATZ [this message]
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=52DD20F3.8070801@6wind.com \
--to=olivier.matz-pdr9zngts4eavxtiumwx3w@public.gmane.org \
--cc=dev-VfR2kkLFssw@public.gmane.org \
--cc=kralosf-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.