Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756687Ab2FFPxG (ORCPT ); Wed, 6 Jun 2012 11:53:06 -0400 Received: from terminus.zytor.com ([198.137.202.10]:40210 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753998Ab2FFPxE (ORCPT ); Wed, 6 Jun 2012 11:53:04 -0400 Date: Wed, 6 Jun 2012 08:52:32 -0700 From: tip-bot for Kamalesh Babulal Message-ID: Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org, kamalesh@linux.vnet.ibm.com, a.p.zijlstra@chello.nl, bp@amd64.org, tglx@linutronix.de, prarit@redhat.com Reply-To: mingo@kernel.org, hpa@zytor.com, linux-kernel@vger.kernel.org, kamalesh@linux.vnet.ibm.com, a.p.zijlstra@chello.nl, bp@amd64.org, tglx@linutronix.de, prarit@redhat.com In-Reply-To: <20120531073738.GH7511@linux.vnet.ibm.com> References: <20120531073738.GH7511@linux.vnet.ibm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:sched/urgent] sched/x86: Calculate booted cores after construction of sibling_mask Git-Commit-ID: ceb1cbac8eda66cf0f889def226b4e82f8ff857b X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.6 (terminus.zytor.com [127.0.0.1]); Wed, 06 Jun 2012 08:52:39 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2217 Lines: 66 Commit-ID: ceb1cbac8eda66cf0f889def226b4e82f8ff857b Gitweb: http://git.kernel.org/tip/ceb1cbac8eda66cf0f889def226b4e82f8ff857b Author: Kamalesh Babulal AuthorDate: Thu, 31 May 2012 13:07:38 +0530 Committer: Ingo Molnar CommitDate: Wed, 6 Jun 2012 16:37:59 +0200 sched/x86: Calculate booted cores after construction of sibling_mask Commit 316ad248307fb ("sched/x86: Rewrite set_cpu_sibling_map()") broke the booted_cores accounting. The problem is that the booted_cores accounting needs all the sibling links set up. So restore the second loop and add a comment as to why its needed. On qemu booted with -smp sockets=1,cores=2,threads=2; Before: $ grep cores /proc/cpuinfo cpu cores : 2 cpu cores : 1 cpu cores : 4 cpu cores : 3 With the patch: $ grep cores /proc/cpuinfo cpu cores : 2 cpu cores : 2 cpu cores : 2 cpu cores : 2 Reported-by: Prarit Bhargava Reported-by: Borislav Petkov Signed-off-by: Kamalesh Babulal Signed-off-by: Peter Zijlstra Link: http://lkml.kernel.org/r/20120531073738.GH7511@linux.vnet.ibm.com Signed-off-by: Ingo Molnar --- arch/x86/kernel/smpboot.c | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index fd019d7..3fab55b 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -382,6 +382,15 @@ void __cpuinit set_cpu_sibling_map(int cpu) if ((i == cpu) || (has_mc && match_llc(c, o))) link_mask(llc_shared, cpu, i); + } + + /* + * This needs a separate iteration over the cpus because we rely on all + * cpu_sibling_mask links to be set-up. + */ + for_each_cpu(i, cpu_sibling_setup_mask) { + o = &cpu_data(i); + if ((i == cpu) || (has_mc && match_mc(c, o))) { link_mask(core, cpu, i); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/