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
  • linux
  • kernel
  • time
  • timer.c
Find file BlameHistoryPermalink
  • Zhenzhong Duan's avatar
    timers: Avoid an unnecessary iteration in __run_timers() · c310ce4d
    Zhenzhong Duan authored Oct 08, 2017
    
    
    If the base clock is behind jiffies in the soft irq expiry code then the
    next timer is retrieved by get_next_timer_interrupt() to avoid incrementing
    base clock one by one. If the next timer interrupt is past current jiffies
    then the base clock is set to jiffies - 1. At the call site this is
    incremented and another iteration through the expiry loop is executed which
    checks empty hash buckets.
    
    That's a pointless excercise because it's already known that the next timer
    is past jiffies.
    
    Set the base clock in that case to jiffies directly so it gets incremented
    to jiffies + 1 at the call site resulting in immediate termination of the
    expiry loop.
    
    [ tglx: Massaged changelog and added comment to the code ]
    
    Signed-off-by: default avatarZhenzhong Duan <zhenzhong.duan@oracle.com>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Acked-by: default avatarAnna-Maria Gleixner <anna-maria@linutronix.de>
    Cc: Joe Jin <joe.jin@oracle.com>
    Cc: sboyd@codeaurora.org
    Cc: Srinivas Reddy Eeda <srinivas.eeda@oracle.com>
    Cc: john.stultz@linaro.org
    Link: https://lkml.kernel.org/r/7086a857-f90c-4616-bbe8-f7696f21626c@default
    c310ce4d
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7