All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olivier MATZ <olivier.matz-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
To: Bruce Richardson
	<bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	"Walukiewicz,
	Miroslaw"
	<Miroslaw.Walukiewicz-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: "dev-VfR2kkLFssw@public.gmane.org" <dev-VfR2kkLFssw@public.gmane.org>
Subject: Re: [RFC PATCH 0/7] support multi-phtread per lcore
Date: Thu, 18 Dec 2014 16:11:12 +0100	[thread overview]
Message-ID: <5492EE90.4040502@6wind.com> (raw)
In-Reply-To: <20141218143225.GA2460@bricha3-MOBL3>

Hi,

On 12/18/2014 03:32 PM, Bruce Richardson wrote:
> On Thu, Dec 18, 2014 at 12:20:07PM +0000, Walukiewicz, Miroslaw wrote:
>> I have another question regarding your patch.
>>
>>  Could we extend values returned by rte_lcore_id() to set them per thread (really the DPDK lcore is a pthread but started on specific core) instead of creating linear thread id. 
>>
>> The patch would be much simpler and will work same way. The only change would be extending rte_lcore_id when rte_pthread_create() is called. 
>>
>> The value __lcore_id has really an attribute __thread that means it is valid not only per CPU core but also per thread.
>>
>> The mempools, timers, statistics would work without any modifications in that environment.
>>
>>  I do not see any reason why old legacy DPDK applications would not work in that model. 
>>
>> Mirek
> 
> Definite +1 here. 

One remark though: it looks that the rte_rings (and therefore the
rte_mempools) are designed with the assumption that the execution
units are alone on their cores.

As explained in [1], there is a risk that a pthread is interrupted
by the kernel at a bad moment. Therefore another thread can be
blocked, spinning on a variable to change its value.

The same could also occurs with spinlocks which are not designed
to wakeup another pthread when the lock is held (like pthread_locks).

And finally, having several pthreads per core implies that the
application should be designed with large queues: if a pthread is
not scheduled during 10ms, it represents 100K packets at 10M PPS.

I don't say it's impossible to do it, but I think it's not so
simple :)

Regards,
Olivier

[1] http://dpdk.org/ml/archives/dev/2013-November/000714.html

  reply	other threads:[~2014-12-18 15:11 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-11  2:04 [RFC PATCH 0/7] support multi-phtread per lcore Cunming Liang
     [not found] ` <1418263490-21088-1-git-send-email-cunming.liang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-12-11  2:04   ` [RFC PATCH 1/7] eal: add linear thread id as pthread-local variable Cunming Liang
2014-12-16  7:00     ` Qiu, Michael
     [not found]     ` <1418263490-21088-2-git-send-email-cunming.liang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2014-12-22 19:02       ` Ananyev, Konstantin
     [not found]         ` <2601191342CEEE43887BDE71AB977258213C900A-kPTMFJFq+rGvNW/NfzhIbrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-12-23  9:56           ` Liang, Cunming
2014-12-11  2:04   ` [RFC PATCH 2/7] mempool: use linear-tid as mempool cache index Cunming Liang
2014-12-11  2:04   ` [RFC PATCH 3/7] ring: use linear-tid as ring debug stats index Cunming Liang
2014-12-11  2:04   ` [RFC PATCH 4/7] eal: add simple API for multi-pthread Cunming Liang
2014-12-11  2:04   ` [RFC PATCH 5/7] testpmd: support multi-pthread mode Cunming Liang
2014-12-11  2:04   ` [RFC PATCH 6/7] sample: add new sample for multi-pthread Cunming Liang
2014-12-11  2:04   ` [RFC PATCH 7/7] eal: macro for cpuset w/ or w/o CPU_ALLOC Cunming Liang
2014-12-11  2:54   ` [RFC PATCH 0/7] support multi-phtread per lcore Jayakumar, Muthurajan
2014-12-11  9:56   ` Walukiewicz, Miroslaw
     [not found]     ` <7C4248CAE043B144B1CD242D275626532FE15298-kPTMFJFq+rGvNW/NfzhIbrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-12-12  5:44       ` Liang, Cunming
     [not found]         ` <D0158A423229094DA7ABF71CF2FA0DA31188B881-E2R4CRU6q/6iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-12-15 11:10           ` Walukiewicz, Miroslaw
     [not found]             ` <7C4248CAE043B144B1CD242D275626532FE232BA-kPTMFJFq+rGvNW/NfzhIbrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-12-15 11:53               ` Liang, Cunming
     [not found]                 ` <D0158A423229094DA7ABF71CF2FA0DA31188C928-E2R4CRU6q/6iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-12-18 12:20                   ` Walukiewicz, Miroslaw
     [not found]                     ` <7C4248CAE043B144B1CD242D275626532FE27C3B-kPTMFJFq+rGvNW/NfzhIbrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-12-18 14:32                       ` Bruce Richardson
2014-12-18 15:11                         ` Olivier MATZ [this message]
     [not found]                           ` <5492EE90.4040502-pdR9zngts4EAvxtiuMwx3w@public.gmane.org>
2014-12-18 16:04                             ` Bruce Richardson
2014-12-18 16:15                       ` Stephen Hemminger
2014-12-19  1:28                       ` Liang, Cunming
     [not found]                         ` <D0158A423229094DA7ABF71CF2FA0DA31188E454-E2R4CRU6q/6iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-12-19 10:03                           ` Bruce Richardson
2014-12-22  1:51                             ` Liang, Cunming
     [not found]                               ` <D0158A423229094DA7ABF71CF2FA0DA31188EF9F-E2R4CRU6q/6iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-12-22  9:46                                 ` Bruce Richardson
2014-12-22 10:01                                   ` Walukiewicz, Miroslaw
     [not found]                                     ` <7C4248CAE043B144B1CD242D275626532FE2908C-kPTMFJFq+rGvNW/NfzhIbrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-12-23  9:45                                       ` Liang, Cunming
2014-12-22 18:28                                   ` Stephen Hemminger
2014-12-23  9:19                                     ` Walukiewicz, Miroslaw
     [not found]                                       ` <7C4248CAE043B144B1CD242D275626532FE29694-kPTMFJFq+rGvNW/NfzhIbrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2014-12-23  9:23                                         ` Bruce Richardson
2014-12-23  9:51                                     ` Liang, Cunming
     [not found]                                       ` <D0158A423229094DA7ABF71CF2FA0DA31188F9AD-E2R4CRU6q/6iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-01-08 17:05                                         ` Ananyev, Konstantin
     [not found]                                           ` <2601191342CEEE43887BDE71AB977258213D39EA-pww93C2UFcwu0RiL9chJVbfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-01-08 17:23                                             ` Richardson, Bruce
     [not found]                                               ` <59AF69C657FD0841A61C55336867B5B034484ED2-kPTMFJFq+rELt2AQoY/u9bfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-01-09  9:51                                                 ` Liang, Cunming
2015-01-09  9:40                                             ` Liang, Cunming
     [not found]                                               ` <D0158A423229094DA7ABF71CF2FA0DA311894B99-E2R4CRU6q/6iAffOGbnezLfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2015-01-09 11:52                                                 ` Ananyev, Konstantin
2015-01-09  9:45                                             ` Liang, Cunming

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=5492EE90.4040502@6wind.com \
    --to=olivier.matz-pdr9zngts4eavxtiumwx3w@public.gmane.org \
    --cc=Miroslaw.Walukiewicz-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=dev-VfR2kkLFssw@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.