[dpdk-dev] [PATCH] mempool: fix local cache initialization
Sergio Gonzalez Monroy
sergio.gonzalez.monroy at intel.com
Thu Jun 9 09:57:02 CEST 2016
On 08/06/2016 20:14, Olivier Matz wrote:
> Hi Sergio,
> Good catch, thanks. The patch looks ok, just few comments
> on the commit log:
> On 06/08/2016 05:10 PM, Sergio Gonzalez Monroy wrote:
>> The mempool local cache is not being initialize properly leading to
> 'initialize' -> 'initialized' ?
> and maybe 'is not being' -> 'was not' ?
>> undefined behavior in cases where the allocated memory was used and left
>> with data.
>> Fixes: af75078fece3 ("first public release")
> I think it fixes this one instead:
> 213af31e0960 ("mempool: reduce structure size if no cache needed")
Fair enough, I thought the issue was there as we never
initialized/zeroed the local cache
on mempool creation. Usually we would have allocated all mempools on
init (or close)
and that would be it (initially all memory would be zeroed), but I think
you could still
manage to reproduce the problem if somehow you where to do something like:
rte_malloc(), rte_free(), rte_mempool_create() and the memory was the
one we got
with malloc and never gets zeroed again.
More information about the dev