DPDK usage discussions
 help / color / mirror / Atom feed
From: Honnappa Nagarahalli <Honnappa.Nagarahalli@arm.com>
To: Tom Barbette <barbette@kth.se>,
	Perugu Hemasai Chandra Prasad <hemasaiperugu@5g.iith.ac.in>,
	"users@dpdk.org" <users@dpdk.org>, "dev@dpdk.org" <dev@dpdk.org>
Cc: nd <nd@arm.com>, nd <nd@arm.com>
Subject: Re: [dpdk-users] [dpdk-dev] Sharing Data structure between logical cores in	DPDK-	regarding
Date: Tue, 10 Dec 2019 05:56:32 +0000	[thread overview]
Message-ID: <VE1PR08MB51493FB3C46CC57830C292B4985B0@VE1PR08MB5149.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <1575542540897.56972@kth.se>

<snip>

> 
> It depends on the datastructure.
> 
> If you use rte_hash, with the thread safety flags, it's safe.
> 
> In any case having a lot of cores accessing the same DS will lead to bad
> performance. You should try to have per-core data structures whenever
> possible.
Even better if you can create a lock free data structure and combine it with RCU. You can look at lock-free version of rte_hash implementation. There was a presentation done on this topic in the previous DPDK summit[1].

[1] https://dpdkuserspace2018.sched.com/event/G44w/lock-free-read-write-concurrency-in-rtehash
> 
> Tom
> 
> ________________________________________
> De : dev <dev-bounces@dpdk.org> de la part de Perugu Hemasai Chandra
> Prasad <hemasaiperugu@5g.iith.ac.in> Envoyé : jeudi 5 décembre 2019
> 11:16 À : users@dpdk.org; dev@dpdk.org
> Objet : [dpdk-dev] Sharing Data structure between logical cores in DPDK-
> regarding
> 
> Hi All,
>           I have a small doubt, can we share a data structure between multiple
> logical cores in DPDK without locking? I have tested it by sharing a small
> structure with two variable and incrementing them in all logical cores. It ran
> smooth I didn't get any issue. But I doubt if we can run it for long time with
> some huge data structure having many elements getting accessed by multiple
> logical cores.
>      Can anyone please clarify this.
> 
> Thanks and regards,
> Hemasai.

      parent reply	other threads:[~2019-12-10  5:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-05 10:16 [dpdk-users] " Perugu Hemasai Chandra Prasad
2019-12-05 10:42 ` [dpdk-users] [dpdk-dev] " Tom Barbette
2019-12-05 10:54   ` Van Haaren, Harry
2019-12-06 16:30     ` Stephen Hemminger
2019-12-06 16:51       ` Van Haaren, Harry
2019-12-06 17:01         ` Stephen Hemminger
2019-12-10  5:56   ` Honnappa Nagarahalli [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=VE1PR08MB51493FB3C46CC57830C292B4985B0@VE1PR08MB5149.eurprd08.prod.outlook.com \
    --to=honnappa.nagarahalli@arm.com \
    --cc=barbette@kth.se \
    --cc=dev@dpdk.org \
    --cc=hemasaiperugu@5g.iith.ac.in \
    --cc=nd@arm.com \
    --cc=users@dpdk.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 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).