• Andrew Jones's avatar
    sched/x86: Construct all sibling maps if smt · b0bc225d
    Andrew Jones authored
    Commit 316ad248 ("sched/x86: Rewrite
    set_cpu_sibling_map()") broke the construction of sibling maps,
    which also broke the booted_cores accounting.
    
    Before the rewrite, if smt was present, then each map was
    updated for each smt sibling. After the rewrite only
    cpu_sibling_mask gets updated, as the llc and core maps depend
    on 'has_mc = x86_max_cores > 1' instead. This leads to problems
    with topologies like the following
    
    (qemu -smp sockets=2,cores=1,threads=2)
    
      processor       : 0
      physical id     : 0
      siblings        : 1    <= should be 2
      core id         : 0
      cpu cores       : 1
    
      processor       : 1
      physical id     : 0
      siblings        : 1    <= should be 2
      core id         : 0
      cpu cores       : 0    <= should be 1
    
      processor       : 2
      physical id     : 1
      siblings        : 1    <= should be 2
      core id         : 0
      cpu cores       : 1
    
      processor       : 3
      physical id     : 1
      siblings        : 1    <= should be 2
      core id         : 0
      cpu cores       : 0    <= should be 1
    
    This patch restores the former construction by defining has_mc
    as (has_smt || x86_max_cores > 1). This should be fine as there
    were no (has_smt && !has_mc) conditions in the context.
    
    Aso rename has_mc to has_mp now that it's not just for cores.
    Signed-off-by: default avatarAndrew Jones <drjones@redhat.com>
    Acked-by: default avatarPeter Zijlstra <peterz@infradead.org>
    Cc: a.p.zijlstra@chello.nl
    Cc: fenghua.yu@intel.com
    Link: http://lkml.kernel.org/r/1369831695-11970-1-git-send-email-drjones@redhat.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
    b0bc225d
smpboot.c 35.2 KB