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
  • cpu.c
Find file BlameHistoryPermalink
  • Thomas Gleixner's avatar
    cpu/hotplug: Prevent self deadlock on CPU hot-unplug · 2b8272ff
    Thomas Gleixner authored Aug 23, 2023
    
    
    Xiongfeng reported and debugged a self deadlock of the task which initiates
    and controls a CPU hot-unplug operation vs. the CFS bandwidth timer.
    
        CPU1      			                 	 CPU2
    
    T1 sets cfs_quota
       starts hrtimer cfs_bandwidth 'period_timer'
    T1 is migrated to CPU2				
    						T1 initiates offlining of CPU1
    Hotplug operation starts
      ...
    'period_timer' expires and is re-enqueued on CPU1
      ...
    take_cpu_down()
      CPU1 shuts down and does not handle timers
      anymore. They have to be migrated in the
      post dead hotplug steps by the control task.
    
    						T1 runs the post dead offline operation
    					      	T1 is scheduled out
    						T1 waits for 'period_timer' to expire
    
    T1 waits there forever if it is scheduled out before it can execute the hrtimer
    offline callback hrtimers_dead_cpu().
    
    Cure this by delegating the hotplug control operation to a worker thread on
    an online CPU. This takes the initiating user space task, which might be
    affected by the bandwidth timer, completely out of the picture.
    
    Reported-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Tested-by: default avatarYu Liao <liaoyu15@huawei.com>
    Acked-by: default avatarVincent Guittot <vincent.guittot@linaro.org>
    Cc: stable@vger.kernel.org
    Link: https://lore.kernel.org/lkml/8e785777-03aa-99e1-d20e-e956f5685be6@huawei.com
    Link: https://lore.kernel.org/r/87h6oqdq0i.ffs@tglx
    2b8272ff
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7