DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: "Morten Brørup" <mb@smartsharesystems.com>
Cc: dpdk-dev <dev@dpdk.org>
Subject: Re: [dpdk-dev] Memory allocation in libraries
Date: Wed, 9 Oct 2019 10:38:14 +0100	[thread overview]
Message-ID: <20191009093814.GA1876@bricha3-MOBL.ger.corp.intel.com> (raw)
In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35C60B64@smartserver.smartshare.dk>

On Wed, Oct 09, 2019 at 10:13:07AM +0200, Morten Brørup wrote:
> Hi all,
> 
> I just noticed an inconsistency in the use of memory allocation:
> 
> Some libraries allocate their data structures using the rte_memzone library,
> e.g. the rte_ring library:
> http://code.dpdk.org/dpdk/latest/source/lib/librte_ring/rte_ring.c#L163
> 
> And some libraries allocate their data structures using the rte_malloc library,
> e.g. the rte_hash library:
> http://code.dpdk.org/dpdk/latest/source/lib/librte_hash/rte_cuckoo_hash.c#L273
> 
> 
> These are data structures being used in the data plane,
> so I would like to know if this was given any deeper thoughts,
> and if there are any performance differences.
> 
Both memzones and malloc blocks now come from the same memory, so there
should be no performance differences. Both allocation schemes now use
hugepage memory, so at this point it's largely a matter of preference which
is used. Originally, memzones were preferred in DPDK, since malloc did not
allow getting the physical address info, but I believe that is now possible
for both allocation types.

/Bruce

  reply	other threads:[~2019-10-09  9:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-09  8:13 Morten Brørup
2019-10-09  9:38 ` Bruce Richardson [this message]
2019-10-10 14:20   ` Burakov, Anatoly

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=20191009093814.GA1876@bricha3-MOBL.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=mb@smartsharesystems.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).