Re: [PATCH 1/3] staging: zcache: xcfmalloc memory allocator for zcache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/31/2011 09:40 AM, Seth Jennings wrote:

> +static struct xcf_blkdesc *xcf_find_remove_block(struct xcf_pool *pool,
> +	int size, int blocknum)
> +{
> +	int flindex, i;
> +	struct xcf_blkdesc *desc = NULL;
> +
> +	flindex = xcf_size_to_flindex(size + sizeof(struct xcf_blkhdr));
> +
> +	/* look for best fit */
> +	if (pool->freelists[flindex])
> +		goto remove;
> +
> +	/* if this is the last block allowed in the allocation, we shouldn't
> +	 * consider smaller blocks.  it's all or nothing now */
> +	if (blocknum == XCF_MAX_BLOCKS_PER_ALLOC) {

In gathering my performance numbers for Dan, I discovered I introduced
a regression by making a late change in my development.

This line should be:
	if (blocknum != XCF_MAX_BLOCKS_PER_ALLOC) {

This regression actually causes xcfmalloc to have the same fragmentation
issue as xvmalloc.

> +		/* look for largest smaller block */
> +		for (i = flindex; i > 0; i--) {
> +			if (pool->freelists[i]) {
> +				flindex = i;
> +				goto remove;
> +			}
> +		}
> +	}

--
Seth
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux