[dpdk-dev] [PATCH v6 24/70] mempool: add support for the new allocation methods

Burakov, Anatoly anatoly.burakov at intel.com
Wed Apr 11 17:03:28 CEST 2018


On 11-Apr-18 3:43 PM, Andrew Rybchenko wrote:
> On 04/11/2018 03:29 PM, Anatoly Burakov wrote:
>> If a user has specified that the zone should have contiguous memory,
>> use the new _contig allocation API's instead of normal ones.
> 
> Just one minor nit..
> As I understand _contig above is an artefact of the previous approach
> with dedicated function for contiguous allocation. If so, description
> should be updated to avoid confusion.
> 
>> Otherwise, account for the fact that unless we're in IOVA_AS_VA
>> mode, we cannot guarantee that the pages would be physically
>> contiguous, so we calculate the memzone size and alignments as if
>> we were getting the smallest page size available.
>>
>> However, for the non-IOVA contiguous case, existing mempool size
>> calculation function doesn't give us expected results, because it
>> will return memzone sizes aligned to page size (e.g. a 1MB mempool
>> may use an entire 1GB page), therefore in cases where we weren't
>> specifically asked to reserve non-contiguous memory, first try
>> reserving a memzone as IOVA-contiguous, and if that fails, then
>> try reserving with page-aligned size/alignment.
>>
>> Signed-off-by: Anatoly Burakov<anatoly.burakov at intel.com>
>> Tested-by: Santosh Shukla<santosh.shukla at caviumnetworks.com>
>> Tested-by: Hemant Agrawal<hemant.agrawal at nxp.com>
>> Tested-by: Gowrishankar Muthukrishnan<gowrishankar.m at linux.vnet.ibm.com>
>> ---
>>   lib/librte_mempool/rte_mempool.c | 148 +++++++++++++++++++++++++++++++++------
>>   1 file changed, 127 insertions(+), 21 deletions(-)


OK.

Thomas, please change text to the following on apply:

If a user has specified that the zone should have contiguous memory,
add a memzone flag to request contiguous memory. Otherwise, account
for the fact that unless we're in IOVA_AS_VA mode, we cannot
guarantee that the pages would be physically contiguous, so we
calculate the memzone size and alignments as if we were getting
the smallest page size available.

However, for the non-IOVA contiguous case, existing mempool size
calculation function doesn't give us expected results, because it
will return memzone sizes aligned to page size (e.g. a 1MB mempool
may use an entire 1GB page), therefore in cases where we weren't
specifically asked to reserve non-contiguous memory, first try
reserving a memzone as IOVA-contiguous, and if that fails, then
try reserving with page-aligned size/alignment.

-- 
Thanks,
Anatoly


More information about the dev mailing list