Re: [PATCH v2 6/9] dmapool: improve scalability of dma_pool_free

2018-08-03 Thread Matthew Wilcox
On Fri, Aug 03, 2018 at 04:05:35PM -0400, Tony Battersby wrote: > For v3 of the patchset, I was also considering to add a note to the > kernel-doc comments for dma_pool_create() to use dma_alloc_coherent() > directly instead of a dma pool if the driver intends to allow userspace > to mmap() the ret

Re: [PATCH v2 6/9] dmapool: improve scalability of dma_pool_free

2018-08-03 Thread Tony Battersby
For v3 of the patchset, I was also considering to add a note to the kernel-doc comments for dma_pool_create() to use dma_alloc_coherent() directly instead of a dma pool if the driver intends to allow userspace to mmap() the returned pages, due to the new use of the _mapcount union in struct page. 

[PATCH v2 6/9] dmapool: improve scalability of dma_pool_free

2018-08-02 Thread Tony Battersby
dma_pool_free() scales poorly when the pool contains many pages because pool_find_page() does a linear scan of all allocated pages. Improve its scalability by replacing the linear scan with virt_to_page() and storing dmapool private data directly in 'struct page', thereby eliminating 'struct dma_p