13b196425c
External pinned buffer memory (--mp-alloc=xbuf)
was allocated as multiple IOVA-contiguous memzones
of 2M size and 2M alignment.
Due to the malloc overhead and the alignment requirement,
each 2M memzone consumed 4M of hugepage memory:
2M of usable memory + X of malloc overhead + (2M-X) padding.
The allocation often failed with 2M hugepages and IOVA-as-PA
if a PA-contiguous span of 2 hugepages could not be found.
Also, with any hugepage size and IOVA mode
memory consumption was almost 2x of the usable amount.
Alignment requirement of 2M for external buffers is redundant.
It was an attempt to ensure IOVA-contiguity
by forcing memzones to start at hugepage boundaries,
while 2M size intended to leave no unused space on the page.
As shown above, this in fact caused excessive memory consumption
and decreased the chance of a successful allocation.
RTE_MEMZONE_F_IOVA_CONTIG already ensures IOVA-contiguity.
Remove the alignment requirement.
Reduce the memzone size by the malloc overhead size (4 cache lines),
so that memory consumption for each memzone is
(2M-X) of usable memory + X of malloc overhead = 2M.
This also means that whenever there are free 2M hugepages,
an IOVA-contiguous memzone can always be allocated.
Fixes:
|
||
---|---|---|
.. | ||
5tswap.c | ||
bpf_cmd.c | ||
bpf_cmd.h | ||
cmd_flex_item.c | ||
cmdline_flow.c | ||
cmdline_mtr.c | ||
cmdline_mtr.h | ||
cmdline_tm.c | ||
cmdline_tm.h | ||
cmdline.c | ||
config.c | ||
csumonly.c | ||
flowgen.c | ||
icmpecho.c | ||
ieee1588fwd.c | ||
iofwd.c | ||
macfwd.c | ||
macswap_common.h | ||
macswap_neon.h | ||
macswap_sse.h | ||
macswap.c | ||
macswap.h | ||
meson.build | ||
noisy_vnf.c | ||
parameters.c | ||
rxonly.c | ||
shared_rxq_fwd.c | ||
testpmd.c | ||
testpmd.h | ||
txonly.c | ||
util.c |