[dpdk-dev] [PATCH] mempool: don't leak ring on failure

Olivier MATZ olivier.matz at 6wind.com
Wed Jun 25 09:46:44 CEST 2014


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 at 6wind.com>



More information about the dev mailing list