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
  • Sebastian Andrzej Siewior's avatar
    timers: Don't block on ->expiry_lock for TIMER_IRQSAFE timers · c725dafc
    Sebastian Andrzej Siewior authored Nov 03, 2020
    
    
    PREEMPT_RT does not spin and wait until a running timer completes its
    callback but instead it blocks on a sleeping lock to prevent a livelock in
    the case that the task waiting for the callback completion preempted the
    callback.
    
    This cannot be done for timers flagged with TIMER_IRQSAFE. These timers can
    be canceled from an interrupt disabled context even on RT kernels.
    
    The expiry callback of such timers is invoked with interrupts disabled so
    there is no need to use the expiry lock mechanism because obviously the
    callback cannot be preempted even on RT kernels.
    
    Do not use the timer_base::expiry_lock mechanism when waiting for a running
    callback to complete if the timer is flagged with TIMER_IRQSAFE.
    
    Also add a lockdep assertion for RT kernels to validate that the expiry
    lock mechanism is always invoked in preemptible context.
    
    Reported-by: default avatarMike Galbraith <efault@gmx.de>
    Signed-off-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Link: https://lore.kernel.org/r/20201103190937.hga67rqhvknki3tp@linutronix.de
    c725dafc
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7