Thread (28 messages) flat view 28 messages, 7 authors, 2021-03-22

Re: [PATCH 7/7] net: page_pool: use alloc_pages_bulk in refill code path

From: Mel Gorman <hidden>
Date: 2021-03-13 13:31:57
Also in: linux-mm, linux-nfs, lkml

On Fri, Mar 12, 2021 at 11:44:09AM -0800, Alexander Duyck wrote:
quoted
-       /* FUTURE development:
-        *
-        * Current slow-path essentially falls back to single page
-        * allocations, which doesn't improve performance.  This code
-        * need bulk allocation support from the page allocator code.
-        */
-
-       /* Cache was empty, do real allocation */
-#ifdef CONFIG_NUMA
-       page = alloc_pages_node(pool->p.nid, gfp, pool->p.order);
-#else
-       page = alloc_pages(gfp, pool->p.order);
-#endif
-       if (!page)
+       if (unlikely(!__alloc_pages_bulk(gfp, pp_nid, NULL, bulk, &page_list)))
                return NULL;

+       /* First page is extracted and returned to caller */
+       first_page = list_first_entry(&page_list, struct page, lru);
+       list_del(&first_page->lru);
+
This seems kind of broken to me. If you pull the first page and then
cannot map it you end up returning NULL even if you placed a number of
pages in the cache.
I think you're right but I'm punting this to Jesper to fix. He's more
familiar with this particular code and can verify the performance is
still ok for high speed networks.

-- 
Mel Gorman
SUSE Labs
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help