Re: [PATCH 1/3] dmapool: improve scalability of dma_pool_alloc

2018-07-27 Thread Tony Battersby
> That would be true if the test were "if > (list_empty(&pool->avail_page_list))".  But it is testing the list > pointers in the item rather than the list pointers in the pool.  It may > be a bit confusing if you have never seen that usage before, which is > why I added a comment.  Basically, if y

Re: [PATCH 1/3] dmapool: improve scalability of dma_pool_alloc

2018-07-26 Thread Tony Battersby
On 07/26/2018 03:37 PM, Andy Shevchenko wrote: > On Thu, Jul 26, 2018 at 9:54 PM, Tony Battersby wrote: >> dma_pool_alloc() scales poorly when allocating a large number of pages >> because it does a linear scan of all previously-allocated pages before >> allocating a new one. Improve its scalabil

Re: [PATCH 1/3] dmapool: improve scalability of dma_pool_alloc

2018-07-26 Thread Andy Shevchenko
On Thu, Jul 26, 2018 at 9:54 PM, Tony Battersby wrote: > dma_pool_alloc() scales poorly when allocating a large number of pages > because it does a linear scan of all previously-allocated pages before > allocating a new one. Improve its scalability by maintaining a separate > list of pages that h

[PATCH 1/3] dmapool: improve scalability of dma_pool_alloc

2018-07-26 Thread Tony Battersby
dma_pool_alloc() scales poorly when allocating a large number of pages because it does a linear scan of all previously-allocated pages before allocating a new one. Improve its scalability by maintaining a separate list of pages that have free blocks ready to (re)allocate. In big O notation, this