DPDK patches and discussions
 help / color / mirror / Atom feed
From: Olivier MATZ <olivier.matz@6wind.com>
To: Stephen Hemminger <stephen@networkplumber.org>,
	 "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] mempool: don't leak ring on failure
Date: Wed, 25 Jun 2014 09:46:44 +0200
Message-ID: <53AA7E64.5060707@6wind.com> (raw)
In-Reply-To: <20140624084948.6d4ab3cd@nehalam.linuxnetplumber.net>

Hello Stephen,

On 06/24/2014 05:49 PM, Stephen Hemminger wrote:
> If mempool can not be created because of insufficient memory
> it returns an error but has already created a ring (and leaves it
> behind). This prevents code from trying one mempool size and then
> retrying with a smaller size if the bigger size fails.
> Reordering to do ring creation after getting memory fixes
> the problem.

Your patch moves the creation of the ring after the call to
rte_memzone_reserve(), so now it tries to create the memory
for the object pool before the ring. The problem disappears
because the object pool is usually much bigger than the ring,
so once the first allocation is done, the second is unlikely
to fail.

I think this explanation could be added in the commit log.

Acked-by: Olivier Matz <olivier.matz@6wind.com>

  parent reply	other threads:[~2014-06-25  7:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-24 15:49 Stephen Hemminger
2014-06-24 16:16 ` Ananyev, Konstantin
2014-06-24 17:40   ` Stephen Hemminger
2014-06-24 17:48     ` Ananyev, Konstantin
2014-06-24 17:41   ` Richardson, Bruce
2014-06-25  7:46 ` Olivier MATZ [this message]
2014-06-25  8:01   ` Olivier MATZ

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53AA7E64.5060707@6wind.com \
    --to=olivier.matz@6wind.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git