• M
    sched: Add asymmetric group packing option for sibling domain · 532cb4c4
    Michael Neuling 提交于
    Check to see if the group is packed in a sched doman.
    
    This is primarily intended to used at the sibling level.  Some cores
    like POWER7 prefer to use lower numbered SMT threads.  In the case of
    POWER7, it can move to lower SMT modes only when higher threads are
    idle.  When in lower SMT modes, the threads will perform better since
    they share less core resources.  Hence when we have idle threads, we
    want them to be the higher ones.
    
    This adds a hook into f_b_g() called check_asym_packing() to check the
    packing.  This packing function is run on idle threads.  It checks to
    see if the busiest CPU in this domain (core in the P7 case) has a
    higher CPU number than what where the packing function is being run
    on.  If it is, calculate the imbalance and return the higher busier
    thread as the busiest group to f_b_g().  Here we are assuming a lower
    CPU number will be equivalent to a lower SMT thread number.
    
    It also creates a new SD_ASYM_PACKING flag to enable this feature at
    any scheduler domain level.
    
    It also creates an arch hook to enable this feature at the sibling
    level.  The default function doesn't enable this feature.
    
    Based heavily on patch from Peter Zijlstra.
    Fixes from Srivatsa Vaddagiri.
    Signed-off-by: NMichael Neuling <mikey@neuling.org>
    Signed-off-by: NSrivatsa Vaddagiri <vatsa@linux.vnet.ibm.com>
    Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Arjan van de Ven <arjan@linux.intel.com>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    LKML-Reference: <20100608045702.2936CCC897@localhost.localdomain>
    Signed-off-by: NIngo Molnar <mingo@elte.hu>
    532cb4c4
sched.h 74.0 KB