From: "Venkatesan, Venky" <venky.venkatesan@intel.com>
To: Olivier Matz <olivier.matz@6wind.com>,
Lazaros Koromilas <l@nofutznetworks.com>,
"Wiles, Keith" <keith.wiles@intel.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] mempool: allow for user-owned mempool caches
Date: Fri, 25 Mar 2016 20:46:31 +0000 [thread overview]
Message-ID: <1FD9B82B8BF2CF418D9A1000154491D97EC97F65@ORSMSX102.amr.corp.intel.com> (raw)
In-Reply-To: <56F51932.3060500@6wind.com>
> -----Original Message-----
> From: Olivier Matz [mailto:olivier.matz@6wind.com]
> Sent: Friday, March 25, 2016 3:56 AM
> To: Venkatesan, Venky <venky.venkatesan@intel.com>; Lazaros Koromilas
> <l@nofutznetworks.com>; Wiles, Keith <keith.wiles@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH] mempool: allow for user-owned mempool
> caches
>
> Hi Venky,
>
> >> The main benefit of having an external cache is to allow mempool
> >> users
> >> (threads) to maintain a local cache even though they don't have a
> >> valid lcore_id (non-EAL threads). The fact that cache access is done
> >> by indexing with the lcore_id is what makes it difficult...
> >
> > Hi Lazaros,
> >
> > Alternative suggestion: This could actually be very simply done via creating
> an EAL API to register and return an lcore_id for a thread wanting to use
> DPDK services. That way, you could simply create your pthread, call the
> eal_register_thread() function that assigns an lcore_id to the caller (and
> internally sets up the per_lcore variable.
> >
> > The advantage of doing it this way is that you could extend it to other
> things other than the mempool that may need an lcore_id setup.
>
> From my opinion, externalize the cache structure as Lazaros suggests would
> make things simpler, especially in case of dynamic threads
> allocation/destruction.
>
> If a lcore_id regristration API is added in EAL, we still need a max lcore value
> when the mempool is created so the cache can be allocated. Moreover, the
> API would not be as simple, especially if it needs to support secondary
> processes.
>
Not really - the secondary process is simply another series of threads. They have their own caches. Yes, we will need a max lcore value, but we can make the allocations dynamic as opposed to static. That way, we will have MAX_LCORE pointers to store per mempool.
The approach that's suggested currently is workable (and if I were solving mempool alone, this is very likely what I would do too), but is limited to the mempool alone. Adding the API to the eal has a rather huge secondary advantage - you now no longer need to create DPDK threads explicitly any more - you can create pthreads, and manage them how you wish. Architecturally speaking, longer term for DPDK that would be bigger win.
>
> Regards,
> Olivier
next prev parent reply other threads:[~2016-03-25 20:46 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-10 14:44 Lazaros Koromilas
2016-03-21 12:22 ` Olivier Matz
2016-03-21 13:15 ` Ananyev, Konstantin
2016-03-24 13:51 ` Lazaros Koromilas
2016-03-21 13:49 ` Wiles, Keith
2016-03-24 14:35 ` Lazaros Koromilas
2016-03-24 14:58 ` Venkatesan, Venky
2016-03-25 10:55 ` Olivier Matz
2016-03-25 20:42 ` Mauricio Vásquez
2016-03-25 20:46 ` Venkatesan, Venky [this message]
2016-03-24 15:03 ` Wiles, Keith
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=1FD9B82B8BF2CF418D9A1000154491D97EC97F65@ORSMSX102.amr.corp.intel.com \
--to=venky.venkatesan@intel.com \
--cc=dev@dpdk.org \
--cc=keith.wiles@intel.com \
--cc=l@nofutznetworks.com \
--cc=olivier.matz@6wind.com \
/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).