Re: [PATCH v2 4/9] dmapool: improve scalability of dma_pool_alloc

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

 



On Thu, Aug 02, 2018 at 03:58:40PM -0400, Tony Battersby wrote:
> @@ -339,11 +360,16 @@ void *dma_pool_alloc(struct dma_pool *po
>  
>  	spin_lock_irqsave(&pool->lock, flags);
>  
> -	list_add(&page->page_list, &pool->page_list);
> +	list_add(&page->dma_list, &pool->page_list[POOL_AVAIL_IDX]);
>   ready:
>  	page->in_use++;
>  	offset = page->offset;
>  	page->offset = *(int *)(page->vaddr + offset);
> +	if (page->offset >= pool->allocation) {
> +		/* Move page from the "available" list to the "full" list. */
> +		list_del(&page->dma_list);
> +		list_add(&page->dma_list, &pool->page_list[POOL_FULL_IDX]);

I think this should be:

		list_move_tail(&page->dma_list,
				&pool->page_list[POOL_FULL_IDX]);

> @@ -444,6 +476,11 @@ void dma_pool_free(struct dma_pool *pool
>  #endif
>  
>  	page->in_use--;
> +	if (page->offset >= pool->allocation) {
> +		/* Move page from the "full" list to the "available" list. */
> +		list_del(&page->dma_list);
> +		list_add(&page->dma_list, &pool->page_list[POOL_AVAIL_IDX]);

This one probably wants to be
		list_move(&page->dma_list, &pool->page_list[POOL_AVAIL_IDX]);

so that it's first-in-line to be allocated from for cache warmth purposes.



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux