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

Commits on Dec 1, 2022

  1. adding ci files

    Kernel Patches Daemon committed Dec 1, 2022
    Copy the full SHA
    85c0283 View commit details
    Browse the repository at this point in the history
  2. netmem: Create new type

    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 committed Dec 1, 2022
    Copy the full SHA
    2f64ae4 View commit details
    Browse the repository at this point in the history
  3. netmem: Add utility functions

    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 committed Dec 1, 2022
    Copy the full SHA
    a9b2fe2 View commit details
    Browse the repository at this point in the history
  4. 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 committed Dec 1, 2022
    Copy the full SHA
    97fcd8e View commit details
    Browse the repository at this point in the history
  5. 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 committed Dec 1, 2022
    Copy the full SHA
    64a8a8b View commit details
    Browse the repository at this point in the history
  6. 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 committed Dec 1, 2022
    Copy the full SHA
    f3aaaa3 View commit details
    Browse the repository at this point in the history
  7. 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 committed Dec 1, 2022
    Copy the full SHA
    c7d4de4 View commit details
    Browse the repository at this point in the history
  8. 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 committed Dec 1, 2022
    Copy the full SHA
    2b8431c View commit details
    Browse the repository at this point in the history
  9. 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 committed Dec 1, 2022
    Copy the full SHA
    e3115b1 View commit details
    Browse the repository at this point in the history
  10. 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 committed Dec 1, 2022
    Copy the full SHA
    78b6be0 View commit details
    Browse the repository at this point in the history
  11. 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 committed Dec 1, 2022
    Copy the full SHA
    87c82ef View commit details
    Browse the repository at this point in the history
  12. 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 committed Dec 1, 2022
    Copy the full SHA
    303ce2a View commit details
    Browse the repository at this point in the history
  13. 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 committed Dec 1, 2022
    Copy the full SHA
    f26dd2a View commit details
    Browse the repository at this point in the history
  14. 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 committed Dec 1, 2022
    Copy the full SHA
    0b79e9b View commit details
    Browse the repository at this point in the history
  15. 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 committed Dec 1, 2022
    Copy the full SHA
    79934a5 View commit details
    Browse the repository at this point in the history
  16. 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 committed Dec 1, 2022
    Copy the full SHA
    189d786 View commit details
    Browse the repository at this point in the history
  17. 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 committed Dec 1, 2022
    Copy the full SHA
    a628b22 View commit details
    Browse the repository at this point in the history
  18. 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 committed Dec 1, 2022
    Copy the full SHA
    4d35f16 View commit details
    Browse the repository at this point in the history
  19. 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 committed Dec 1, 2022
    Copy the full SHA
    0832ae0 View commit details
    Browse the repository at this point in the history
  20. xdp: Convert to netmem

    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 committed Dec 1, 2022
    Copy the full SHA
    9e8ed13 View commit details
    Browse the repository at this point in the history
  21. 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 committed Dec 1, 2022
    Copy the full SHA
    8690d22 View commit details
    Browse the repository at this point in the history
  22. netmem_to_virt

    Matthew Wilcox (Oracle) authored and Kernel Patches Daemon committed Dec 1, 2022
    Copy the full SHA
    114384d View commit details
    Browse the repository at this point in the history
  23. 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 committed Dec 1, 2022
    Copy the full SHA
    ccc748d View commit details
    Browse the repository at this point in the history
  24. 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 committed Dec 1, 2022
    Copy the full SHA
    4a50a6e View commit details
    Browse the repository at this point in the history
  25. mvneta: Convert to netmem

    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 committed Dec 1, 2022
    Copy the full SHA
    ebc6a26 View commit details
    Browse the repository at this point in the history