From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH v3 0/2] malloc: fix malloc and free linear complexity Date: Thu, 26 Jun 2014 14:37:43 +0200 Message-ID: <3441267.fPINhng712@xps13> References: <1400245141-10938-1-git-send-email-rsanford2@gmail.com> <1403558230-40042-1-git-send-email-rsanford2@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: dev-VfR2kkLFssw@public.gmane.org To: Robert Sanford Return-path: In-Reply-To: List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" > From: Robert Sanford > > Comments on previous versions of this patch: > > http://dpdk.org/ml/archives/dev/2014-May/002297.html > > http://dpdk.org/ml/archives/dev/2014-June/003518.html > > > > Additional changes from original to v3: > > * Reduce the minimum-sized block that we put on a free list when > > > > splitting a larger block, from 192 to 64. Although memory is > > plentiful, why waste 64 and 128-byte (plus overhead) blocks? > > > > -#define MIN_DATA_SIZE (CACHE_LINE_SIZE * 2) > > +#define MIN_DATA_SIZE (CACHE_LINE_SIZE) > > > > - if (old_elem_size <= MALLOC_ELEM_OVERHEAD + MIN_DATA_SIZE){ > > + if (old_elem_size < MALLOC_ELEM_OVERHEAD + MIN_DATA_SIZE){ > > > > - if (elem->size - new_size > MIN_DATA_SIZE + > > MALLOC_ELEM_OVERHEAD){ > > + if (elem->size - new_size >= MIN_DATA_SIZE + > > MALLOC_ELEM_OVERHEAD){ > > > > Changes from v2 to v3: > > * Change the size ranges of the five free lists per heap. The first > > > > list will effectively contain blocks of size [64,256]. > > Acked-by: Pablo de Lara Applied for version 1.7.0. Thanks for this brave rework. -- Thomas