New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split page pools from struct page #4126
Commits on Dec 1, 2022
-
Kernel Patches Daemon committed
Dec 1, 2022 -
As part of simplifying struct page, create a new netmem type which mirrors the page_pool members in struct page. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committedDec 1, 2022 -
netmem_page() is defined this way to preserve constness. page_netmem() doesn't call compound_head() because netmem users always use the head page; it does include a debugging assert to check that it's true. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committedDec 1, 2022 -
page_pool: Add netmem_set_dma_addr() and netmem_get_dma_addr()
Turn page_pool_set_dma_addr() and page_pool_get_dma_addr() into wrappers. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committedDec 1, 2022 -
page_pool: Convert page_pool_release_page() to page_pool_release_netm…
…em() Also convert page_pool_clear_pp_info() and trace_page_pool_state_release() to take a netmem. Include a wrapper for page_pool_release_page() to avoid converting all callers. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committedDec 1, 2022 -
page_pool: Start using netmem in allocation path.
Convert __page_pool_alloc_page_order() and __page_pool_alloc_pages_slow() to use netmem internally. This removes a couple of calls to compound_head() that are hidden inside put_page(). Convert trace_page_pool_state_hold(), page_pool_dma_map() and page_pool_set_pp_info() to take a netmem argument. Saves 83 bytes of text in __page_pool_alloc_page_order() and 98 in __page_pool_alloc_pages_slow() for a total of 181 bytes. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committedDec 1, 2022 -
page_pool: Convert page_pool_return_page() to page_pool_return_netmem()
Removes a call to compound_head(), saving 464 bytes of kernel text as page_pool_return_page() is inlined seven times. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committedDec 1, 2022 -
page_pool: Convert __page_pool_put_page() to __page_pool_put_netmem()
Removes the call to compound_head() hidden in put_page() which saves 169 bytes of kernel text as __page_pool_put_page() is inlined twice. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committedDec 1, 2022 -
page_pool: Convert pp_alloc_cache to contain netmem
Change the type here from page to netmem. It works out well to convert page_pool_refill_alloc_cache() to return a netmem instead of a page as part of this commit. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committedDec 1, 2022 -
page_pool: Convert page_pool_defrag_page() to page_pool_defrag_netmem()
Add a page_pool_defrag_page() wrapper. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committedDec 1, 2022 -
page_pool: Convert page_pool_put_defragged_page() to netmem
Also convert page_pool_is_last_frag(), page_pool_put_page(), page_pool_recycle_in_ring() and use netmem in page_pool_put_page_bulk(). Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committedDec 1, 2022 -
page_pool: Convert page_pool_empty_ring() to use netmem
Retrieve a netmem from the ptr_ring instead of a page. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committedDec 1, 2022 -
page_pool: Convert page_pool_alloc_pages() to page_pool_alloc_netmem()
Add a page_pool_alloc_pages() compatibility wrapper. Also convert __page_pool_alloc_pages_slow() to __page_pool_alloc_netmem_slow() and __page_pool_alloc_page_order() to __page_pool_alloc_netmem(). __page_pool_get_cached() is converted to return a netmem. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committedDec 1, 2022 -
page_pool: Convert page_pool_dma_sync_for_device() to take a netmem
Change all callers. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committedDec 1, 2022 -
page_pool: Convert page_pool_recycle_in_cache() to netmem
Removes a few casts. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committedDec 1, 2022 -
page_pool: Remove page_pool_defrag_page()
This wrapper is no longer used. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committedDec 1, 2022 -
page_pool: Use netmem in page_pool_drain_frag()
We're not quite ready to change the API of page_pool_drain_frag(), but we can remove the use of several wrappers by using the netmem throughout. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committedDec 1, 2022 -
page_pool: Convert page_pool_return_skb_page() to use netmem
This function accesses the pagepool members of struct page directly, so it needs to become netmem. Add page_pool_put_full_netmem(). Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committedDec 1, 2022 -
page_pool: Convert frag_page to frag_nmem
Remove page_pool_defrag_page() and page_pool_return_page() as they have no more callers. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committedDec 1, 2022 -
We dereference the 'pp' member of struct page, so we must use a netmem here. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committedDec 1, 2022 -
mm: Remove page pool members from struct page
These are now split out into their own netmem struct. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committedDec 1, 2022 -
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committed
Dec 1, 2022 -
page_pool: Pass a netmem to init_callback()
Convert the only user of init_callback. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committedDec 1, 2022 -
net: Add support for netmem in skb_frag
Allow drivers to add netmem to skbs & retrieve them again. If the VM_BUG_ON triggers, we can add a call to compound_head() either in this function or in page_netmem(). Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committedDec 1, 2022 -
Use the netmem APIs instead of the page APIs. Improves type-safety. Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committedDec 1, 2022