• Wanpeng Li's avatar
    sched/nohz: Fix affine unpinned timers mess · 40aab521
    Wanpeng Li authored
    BugLink: http://bugs.launchpad.net/bugs/1621113
    
    commit 44496922 upstream.
    
    The following commit:
    
      9642d18e ("nohz: Affine unpinned timers to housekeepers")'
    
    intended to affine unpinned timers to housekeepers:
    
      unpinned timers(full dynaticks, idle)   =>   nearest busy housekeepers(otherwise, fallback to any housekeepers)
      unpinned timers(full dynaticks, busy)   =>   nearest busy housekeepers(otherwise, fallback to any housekeepers)
      unpinned timers(houserkeepers, idle)    =>   nearest busy housekeepers(otherwise, fallback to itself)
    
    However, the !idle_cpu(i) && is_housekeeping_cpu(cpu) check modified the
    intention to:
    
      unpinned timers(full dynaticks, idle)   =>   any housekeepers(no mattter cpu topology)
      unpinned timers(full dynaticks, busy)   =>   any housekeepers(no mattter cpu topology)
      unpinned timers(housekeepers, idle)     =>   any busy cpus(otherwise, fallback to any housekeepers)
    
    This patch fixes it by checking if there are busy housekeepers nearby,
    otherwise falls to any housekeepers/itself. After the patch:
    
      unpinned timers(full dynaticks, idle)   =>   nearest busy housekeepers(otherwise, fallback to any housekeepers)
      unpinned timers(full dynaticks, busy)   =>   nearest busy housekeepers(otherwise, fallback to any housekeepers)
      unpinned timers(housekeepers, idle)     =>   nearest busy housekeepers(otherwise, fallback to itself)
    Signed-off-by: default avatarWanpeng Li <wanpeng.li@hotmail.com>
    Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
    [ Fixed the changelog. ]
    Cc: Frederic Weisbecker <fweisbec@gmail.com>
    Cc: Linus Torvalds <torvalds@linux-foundation.org>
    Cc: Mike Galbraith <efault@gmx.de>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: linux-kernel@vger.kernel.org
    Fixes: 'commit 9642d18e ("nohz: Affine unpinned timers to housekeepers")'
    Link: http://lkml.kernel.org/r/1462344334-8303-1-git-send-email-wanpeng.li@hotmail.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
    Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
    40aab521
core.c 206 KB