On Mon, Nov 12, 2018 at 10:45:58AM -0500, Tony Battersby wrote:
> +++ linux/mm/dmapool.c        2018-08-06 17:52:53.000000000 -0400
> @@ -61,6 +61,7 @@ struct dma_pool {           /* the pool */
>       struct device *dev;
>       unsigned int allocation;
>       unsigned int boundary;
> +     unsigned int blks_per_alloc;
>       char name[32];
>       struct list_head pools;
>  };

This one I'm not totally happy with.  You're storing this value when
it could be easily calculated each time through the show_pools() code.
I appreciate this is a topic where reasonable people might have different
opinions about which solution is preferable.

> @@ -182,6 +182,9 @@ struct dma_pool *dma_pool_create(const c
>       retval->size = size;
>       retval->boundary = boundary;
>       retval->allocation = allocation;
> +     retval->blks_per_alloc =
> +             (allocation / boundary) * (boundary / size) +
> +             (allocation % boundary) / size;
>  
>       INIT_LIST_HEAD(&retval->pools);
>  
> 
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to