From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Burakov, Anatoly" Subject: Re: [PATCH v6 24/70] mempool: add support for the new allocation methods Date: Wed, 11 Apr 2018 16:03:28 +0100 Message-ID: <9f1a4933-8544-af13-6b6a-3fceb5b3a41e@intel.com> References: <17e7d16a54e2d3383a3857733589b91e2c691f66.1523448978.git.anatoly.burakov@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Olivier Matz , keith.wiles@intel.com, jianfeng.tan@intel.com, andras.kovacs@ericsson.com, laszlo.vadkeri@ericsson.com, benjamin.walker@intel.com, bruce.richardson@intel.com, thomas@monjalon.net, konstantin.ananyev@intel.com, kuralamudhan.ramakrishnan@intel.com, louise.m.daly@intel.com, nelio.laranjeiro@6wind.com, yskoh@mellanox.com, pepperjo@japf.ch, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, shreyansh.jain@nxp.com, gowrishankar.m@linux.vnet.ibm.com To: Andrew Rybchenko , dev@dpdk.org Return-path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 3976323D for ; Wed, 11 Apr 2018 17:03:35 +0200 (CEST) In-Reply-To: Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 >> Tested-by: Santosh Shukla >> Tested-by: Hemant Agrawal >> Tested-by: Gowrishankar Muthukrishnan >> --- >> 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