Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • L linux-de
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • linux-arm
  • linux-de
  • Repository
Switch branch/tag
  • linux-de
  • net
  • core
  • stream.c
Find file BlameHistoryPermalink
  • Eric Dumazet's avatar
    [SOCK] Avoid divides in sk_stream_pages() and __sk_stream_mem_reclaim() · 21371f76
    Eric Dumazet authored Dec 24, 2007
    
    
    sk_forward_alloc being signed, we should take care of divides by
    SK_STREAM_MEM_QUANTUM we do in sk_stream_pages() and
    __sk_stream_mem_reclaim()
    
    This patchs introduces SK_STREAM_MEM_QUANTUM_SHIFT, defined
    as ilog2(SK_STREAM_MEM_QUANTUM), to be able to use right
    shifts instead of plain divides.
    
    This should help compiler to choose right shifts instead of
    expensive divides (as seen with CONFIG_CC_OPTIMIZE_FOR_SIZE=y on x86)
    Signed-off-by: default avatarEric Dumazet <dada1@cosmosbay.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    21371f76