On Mon, Nov 12, 2018 at 10:44:40AM -0500, Tony Battersby wrote: > 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_page'. In big O notation, this improves the algorithm from > O(n^2) to O(n) while also reducing memory usage. > > Thanks to Matthew Wilcox for the suggestion to use struct page. > > Signed-off-by: Tony Battersby <tonyb@xxxxxxxxxxxxxxx> Acked-by: Matthew Wilcox <willy@xxxxxxxxxxxxx>