DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, Anatoly Burakov <anatoly.burakov@intel.com>
Subject: Re: [PATCH] eal: allow swapping of malloc heaps
Date: Fri, 15 Sep 2023 08:43:53 -0700	[thread overview]
Message-ID: <20230915084353.51023491@hermes.local> (raw)
In-Reply-To: <20230915122703.475834-1-bruce.richardson@intel.com>

On Fri, 15 Sep 2023 13:27:03 +0100
Bruce Richardson <bruce.richardson@intel.com> wrote:

> The external memory functions in DPDK allow the addition of externally
> access memory to malloc heaps, but with one major restriction - the
> memory must be allocated to an application-created heap, not one of the
> standard DPDK heaps for a NUMA node.
> 
> This restriction makes it difficult - if not impossible - to use
> externally allocated memory for DPDK by default. However, even if the
> restriction is relaxed, so we can add external memory to e.g. the socket
> 0 heap, there would be no way to guarantee that the external memory
> would be used in preference to the standard DPDK hugepage memory for a
> given allocation.
> 
> To give appropriately defined behaviour, a better solution is to allow
> the application to explicitly swap a pair of heaps. With this one new
> API in place, it allows the user to configure a new malloc heap, add
> external memory to it, and then replace a standard socket heap with the
> newly created one - thereby guaranteeing future allocations from the
> external memory.
> 
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> ---

Should document any restrictions about when this can be done.
Doesn't look thread safe. Would expect that application would do this
just after EAL init before doing any work.

What happens to memory allocated from old heap.

  parent reply	other threads:[~2023-09-15 15:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-15 12:27 Bruce Richardson
2023-09-15 13:10 ` [PATCH v2] " Bruce Richardson
2023-09-15 15:43 ` Stephen Hemminger [this message]
2023-09-18 16:32 ` [PATCH v3 0/2] Enable apps to use external memory as native Bruce Richardson
2023-09-18 16:32   ` [PATCH v3 1/2] eal: add flag to indicate non-EAL malloc heaps Bruce Richardson
2023-09-18 16:32   ` [PATCH v3 2/2] eal: allow swapping of " Bruce Richardson
2023-09-18 16:44   ` [PATCH v3 0/2] Enable apps to use external memory as native Stephen Hemminger

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=20230915084353.51023491@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=anatoly.burakov@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@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).