DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Anatoly Burakov <anatoly.burakov@intel.com>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [RFC] mem: add atomic lookup-and-reserve/free memzone API
Date: Tue, 5 May 2020 16:01:31 +0100	[thread overview]
Message-ID: <20200505150131.GA1437@bricha3-MOBL.ger.corp.intel.com> (raw)
In-Reply-To: <b0ef92d3be578c1dbcc6fd61a12dd943decaa15c.1588688636.git.anatoly.burakov@intel.com>

On Tue, May 05, 2020 at 02:24:07PM +0000, Anatoly Burakov wrote:
> Currently, in order to perform a memzone lookup and create/free
> the memzone, the user has to call two API's, creating a race
> condition. This is particularly destructive for memzone_free call
> because the reference provided to memzone_free at the time of call
> may be stale or refer to a different memzone altogether.
> 
> Fix this race condition by adding an API to perform lookup and
> create/free memzone in one go.
> 
> Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
> ---
>  lib/librte_eal/common/eal_common_memzone.c | 125 ++++++++---
>  lib/librte_eal/include/rte_memzone.h       | 235 +++++++++++++++++++++
>  lib/librte_eal/rte_eal_version.map         |   4 +
>  3 files changed, 340 insertions(+), 24 deletions(-)
> 
While I agree that there is a race, is this really a problem in the real
world? Do we really need to expand the number of APIs for allocating memory
further?

If we really do need the ability to do lookup and create in one, rather
than adding new APIs can we not just add another flag to the existing
rte_memzone_reserve call?

  reply	other threads:[~2020-05-05 15:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-05 14:24 Anatoly Burakov
2020-05-05 15:01 ` Bruce Richardson [this message]
2020-05-06  9:35   ` 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=20200505150131.GA1437@bricha3-MOBL.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=anatoly.burakov@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).