Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
You need to sign in or sign up before continuing.
  • linux
  • net
  • core
  • dev.c
Find file BlameHistoryPermalink
  • Paolo Abeni's avatar
    net: skb: introduce and use a single page frag cache · dbae2b06
    Paolo Abeni authored Sep 28, 2022
    After commit 3226b158 ("net: avoid 32 x truesize under-estimation
    for tiny skbs") we are observing 10-20% regressions in performance
    tests with small packets. The perf trace points to high pressure on
    the slab allocator.
    
    This change tries to improve the allocation schema for small packets
    using an idea originally suggested by Eric: a new per CPU page frag is
    introduced and used in __napi_alloc_skb to cope with small allocation
    requests.
    
    To ensure that the above does not lead to excessive truesize
    underestimation, the frag size for small allocation is inflated to 1K
    and all the above is restricted to build with 4K page size.
    
    Note that we need to update accordingly the run-time check introduced
    with commit fd9ea57f
    
     ("net: add napi_get_frags_check() helper").
    
    Alex suggested a smart page refcount schema to reduce the number
    of atomic operations and deal properly with pfmemalloc pages.
    
    Under small packet UDP flood, I measure a 15% peak tput increases.
    
    Suggested-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
    Suggested-by: default avatarAlexander H Duyck <alexanderduyck@fb.com>
    Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
    Reviewed-by: default avatarEric Dumazet <edumazet@google.com>
    Reviewed-by: default avatarAlexander Duyck <alexanderduyck@fb.com>
    Link: https://lore.kernel.org/r/6b6f65957c59f86a353fc09a5127e83a32ab5999.1664350652.git.pabeni@redhat.com
    
    
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    dbae2b06
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7