From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 43DC0A3160 for ; Thu, 10 Oct 2019 16:20:34 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 082161E978; Thu, 10 Oct 2019 16:20:33 +0200 (CEST) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id B23BB1E917 for ; Thu, 10 Oct 2019 16:20:30 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Oct 2019 07:20:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,280,1566889200"; d="scan'208";a="223980038" Received: from aburakov-mobl1.ger.corp.intel.com (HELO [10.237.220.104]) ([10.237.220.104]) by fmsmga002.fm.intel.com with ESMTP; 10 Oct 2019 07:20:27 -0700 To: Bruce Richardson , =?UTF-8?Q?Morten_Br=c3=b8rup?= Cc: dpdk-dev References: <98CBD80474FA8B44BF855DF32C47DC35C60B64@smartserver.smartshare.dk> <20191009093814.GA1876@bricha3-MOBL.ger.corp.intel.com> From: "Burakov, Anatoly" Message-ID: <23dbb3de-02af-a69d-6bb7-a8eb9efa53f4@intel.com> Date: Thu, 10 Oct 2019 15:20:26 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191009093814.GA1876@bricha3-MOBL.ger.corp.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] Memory allocation in libraries X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list 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 09-Oct-19 10:38 AM, Bruce Richardson wrote: > On Wed, Oct 09, 2019 at 10:13:07AM +0200, Morten Brørup wrote: >> Hi all, >> >> I just noticed an inconsistency in the use of memory allocation: >> >> Some libraries allocate their data structures using the rte_memzone library, >> e.g. the rte_ring library: >> http://code.dpdk.org/dpdk/latest/source/lib/librte_ring/rte_ring.c#L163 >> >> And some libraries allocate their data structures using the rte_malloc library, >> e.g. the rte_hash library: >> http://code.dpdk.org/dpdk/latest/source/lib/librte_hash/rte_cuckoo_hash.c#L273 >> >> >> These are data structures being used in the data plane, >> so I would like to know if this was given any deeper thoughts, >> and if there are any performance differences. >> > Both memzones and malloc blocks now come from the same memory, so there > should be no performance differences. Both allocation schemes now use > hugepage memory, so at this point it's largely a matter of preference which > is used. Originally, memzones were preferred in DPDK, since malloc did not > allow getting the physical address info, but I believe that is now possible > for both allocation types. > > /Bruce > That is correct, although i would say it's not a "matter of preference" of which is used, but rather matter of whether the additional features offered by memzone allocator (lookup by name, alignment, etc.) are needed. -- Thanks, Anatoly