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
  • kernel
  • cpu.c
Find file BlameHistoryPermalink
  • Thomas Gleixner's avatar
    sched/hotplug: Consolidate task migration on CPU unplug · 1cf12e08
    Thomas Gleixner authored Sep 16, 2020
    
    
    With the new mechanism which kicks tasks off the outgoing CPU at the end of
    schedule() the situation on an outgoing CPU right before the stopper thread
    brings it down completely is:
    
     - All user tasks and all unbound kernel threads have either been migrated
       away or are not running and the next wakeup will move them to a online CPU.
    
     - All per CPU kernel threads, except cpu hotplug thread and the stopper
       thread have either been unbound or parked by the responsible CPU hotplug
       callback.
    
    That means that at the last step before the stopper thread is invoked the
    cpu hotplug thread is the last legitimate running task on the outgoing
    CPU.
    
    Add a final wait step right before the stopper thread is kicked which
    ensures that any still running tasks on the way to park or on the way to
    kick themself of the CPU are either sleeping or gone.
    
    This allows to remove the migrate_tasks() crutch in sched_cpu_dying(). If
    sched_cpu_dying() detects that there is still another running task aside of
    the stopper thread then it will explode with the appropriate fireworks.
    
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
    Reviewed-by: default avatarValentin Schneider <valentin.schneider@arm.com>
    Reviewed-by: default avatarDaniel Bristot de Oliveira <bristot@redhat.com>
    Link: https://lkml.kernel.org/r/20201023102346.547163969@infradead.org
    1cf12e08
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7