From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Apr 2018 01:05:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.48,405,1517904000"; d="scan'208";a="44760935" Received: from aburakov-mobl.ger.corp.intel.com (HELO [10.252.51.73]) ([10.252.51.73]) by orsmga001.jf.intel.com with ESMTP; 04 Apr 2018 01:05:34 -0700 To: Stephen Hemminger 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 References: <02cfd92be8f1b013c932a792445facd1e3383a36.1522797505.git.anatoly.burakov@intel.com> <20180403163240.2b14d418@xeon-e3> From: "Burakov, Anatoly" Message-ID: <60ffe9be-8fc5-6b3b-4de1-108208ff146e@intel.com> Date: Wed, 4 Apr 2018 09:05:32 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180403163240.2b14d418@xeon-e3> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3 03/68] eal: make malloc heap a doubly-linked list 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: , X-List-Received-Date: Wed, 04 Apr 2018 08:05:42 -0000 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