Skip to content
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

Closed
wants to merge 25 commits into from

Conversation

kernel-patches-bot
Copy link

Pull request for series with
subject: Split page pools from struct page
version: 1
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=700610

@kernel-patches-bot
Copy link
Author

Upstream branch: f8186bf
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=700610
version: 1

@kernel-patches-bot
Copy link
Author

Upstream branch: 59b8436
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=700610
version: 1

@kernel-patches-bot
Copy link
Author

Upstream branch: 996c060
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=700610
version: 1

@kernel-patches-bot
Copy link
Author

Upstream branch: c67cae5
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=700610
version: 1

@kernel-patches-bot
Copy link
Author

Upstream branch: 89903dc
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=700610
version: 1

Matthew Wilcox (Oracle) added 12 commits November 30, 2022 17:33
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>
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>
Turn page_pool_set_dma_addr() and page_pool_get_dma_addr() into
wrappers.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
…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>
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>
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>
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>
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>
Add a page_pool_defrag_page() wrapper.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
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>
Retrieve a netmem from the ptr_ring instead of a page.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
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) added 11 commits November 30, 2022 17:33
Change all callers.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Removes a few casts.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
This wrapper is no longer used.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
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>
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>
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>
We dereference the 'pp' member of struct page, so we must use a netmem
here.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
These are now split out into their own netmem struct.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Convert the only user of init_callback.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
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>
@kernel-patches-bot
Copy link
Author

Upstream branch: 3144bfa
series: https://patchwork.kernel.org/project/netdevbpf/list/?series=700610
version: 1

Use the netmem APIs instead of the page APIs.  Improves type-safety.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
@kernel-patches-bot
Copy link
Author

At least one diff in series https://patchwork.kernel.org/project/netdevbpf/list/?series=700610 expired. Closing PR.

@kernel-patches-bot kernel-patches-bot added rfc and removed new labels Dec 2, 2022
@kernel-patches-bot kernel-patches-bot deleted the series/700610=>bpf-next branch December 4, 2022 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant