]> git.droids-corp.org - dpdk.git/commit
malloc: fix allocation of almost hugepage size
authorFidaullah Noonari <fidaullah.noonari@emumba.com>
Wed, 25 May 2022 05:18:37 +0000 (10:18 +0500)
committerDavid Marchand <david.marchand@redhat.com>
Thu, 23 Jun 2022 11:40:50 +0000 (13:40 +0200)
commitce2f7d472e80c1b6779f230a1c7b137157f5ff3d
tree69282b3e8683d1c8bb56f2964831a0ac39208338
parent0efcd352e257ae88a16667b8b6d5dcf0319a4192
malloc: fix allocation of almost hugepage size

If called to allocate memory of size is between multiple of hugepage
size minus malloc_header_len and hugepage size, rte_malloc fails.

This fix replaces malloc_elem_trailer_len with malloc_elem_overhead in
try_expand_heap() to include malloc_elem_header_len when calculating
n_seg.

Bugzilla ID: 800
Fixes: 07dcbfe0101f ("malloc: support multiprocess memory hotplug")
Cc: stable@dpdk.org
Signed-off-by: Fidaullah Noonari <fidaullah.noonari@emumba.com>
Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
lib/eal/common/malloc_heap.c
lib/eal/common/malloc_mp.c