From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Burakov, Anatoly" Subject: Re: [PATCH v3 03/68] eal: make malloc heap a doubly-linked list Date: Wed, 4 Apr 2018 09:05:32 +0100 Message-ID: <60ffe9be-8fc5-6b3b-4de1-108208ff146e@intel.com> References: <02cfd92be8f1b013c932a792445facd1e3383a36.1522797505.git.anatoly.burakov@intel.com> <20180403163240.2b14d418@xeon-e3> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org, 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, olivier.matz@6wind.com, shreyansh.jain@nxp.com, gowrishankar.m@linux.vnet.ibm.com To: Stephen Hemminger Return-path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 928B61B421 for ; Wed, 4 Apr 2018 10:05:41 +0200 (CEST) In-Reply-To: <20180403163240.2b14d418@xeon-e3> 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 04-Apr-18 12:32 AM, Stephen Hemminger wrote: > On Wed, 4 Apr 2018 00:21:15 +0100 > Anatoly Burakov wrote: > >> As we are preparing for dynamic memory allocation, we need to be >> able to handle holes in our malloc heap, hence we're switching to >> doubly linked list, and prepare infrastructure to support it. >> >> Since our heap is now aware where are our first and last elements, >> there is no longer any need to have a dummy element at the end of >> each heap, so get rid of that as well. Instead, let insert/remove/ >> join/split operations handle end-of-list conditions automatically. >> >> Signed-off-by: Anatoly Burakov > > Dummy element at end of heap could be helpful for purify/valgrind style verification > that code does not exceed allocation. > It would interfere with removing pages from memory :) Dummy element needs to be stored somewhere - if it's stored in a page, that means that page cannot be freed. Moreover, with pages being added/removed dynamically, the dummy element will have to be moved back and forth, so "at the end of the heap" is not a fixed location. -- Thanks, Anatoly