From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Rybchenko Subject: Re: [PATCH v6 24/70] mempool: add support for the new allocation methods Date: Wed, 11 Apr 2018 17:43:01 +0300 Message-ID: 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 , , , , , , , , , , , , , , , , , To: Anatoly Burakov , Return-path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [148.163.129.52]) by dpdk.org (Postfix) with ESMTP id 9253C1BB1C for ; Wed, 11 Apr 2018 16:43:19 +0200 (CEST) In-Reply-To: <17e7d16a54e2d3383a3857733589b91e2c691f66.1523448978.git.anatoly.burakov@intel.com> Content-Language: en-GB 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 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(-)