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 D3209A3160 for ; Wed, 9 Oct 2019 11:38:27 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 24DFE1E53A; Wed, 9 Oct 2019 11:38:22 +0200 (CEST) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id F0D5E1E4E8 for ; Wed, 9 Oct 2019 11:38:19 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2019 02:38:18 -0700 X-IronPort-AV: E=Sophos;i="5.67,273,1566889200"; d="scan'208";a="277373502" Received: from bricha3-mobl.ger.corp.intel.com ([10.252.24.245]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2019 02:38:17 -0700 Date: Wed, 9 Oct 2019 10:38:14 +0100 From: Bruce Richardson To: Morten =?iso-8859-1?Q?Br=F8rup?= Cc: dpdk-dev Message-ID: <20191009093814.GA1876@bricha3-MOBL.ger.corp.intel.com> References: <98CBD80474FA8B44BF855DF32C47DC35C60B64@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35C60B64@smartserver.smartshare.dk> User-Agent: Mutt/1.11.4 (2019-03-13) 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 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