Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751958AbcCRL50 (ORCPT ); Fri, 18 Mar 2016 07:57:26 -0400 Received: from www.linutronix.de ([62.245.132.108]:36563 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751693AbcCRL5Z (ORCPT ); Fri, 18 Mar 2016 07:57:25 -0400 Date: Fri, 18 Mar 2016 12:55:56 +0100 (CET) From: Thomas Gleixner To: Mike Galbraith cc: Peter Zijlstra , Xiong Zhou , "linux-kernel@vger.kernel.org" , Ingo Molnar , Borislav Petkov , Andreas Herrmann Subject: Re: 4.5.0+ panic when setup loop device In-Reply-To: <1458274314.3859.25.camel@gmail.com> Message-ID: References: <20160317095220.GO6344@twins.programming.kicks-ass.net> <1458274314.3859.25.camel@gmail.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1129 Lines: 31 On Fri, 18 Mar 2016, Mike Galbraith wrote: > On Thu, 2016-03-17 at 10:52 +0100, Peter Zijlstra wrote: > > > Andreas; Borislav said to Cc you since you wrote all this. > > The issue is that Linux assumes: > > > > > nr_logical_cpus = nr_cores * nr_siblings > > It also seems to now assume that if SMT is possible, it's enabled. > > Below is my 8 socket DL980 G7, which has SMT turned off for RT testing, > booting NOPREEMPT master tuned for maximum bloat ala distro and getting > confused by me telling it (as always) nr_cpus=64. Bad juju ensues. :) Does the patch below fix the wreckage? diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index 643dbdccf4bc..c5ac71276076 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -319,7 +319,7 @@ static void __init smp_init_package_map(void) * might change in the future.... */ ncpus = boot_cpu_data.x86_max_cores * smp_num_siblings; - __max_logical_packages = DIV_ROUND_UP(nr_cpu_ids, ncpus); + __max_logical_packages = DIV_ROUND_UP(total_cpus, ncpus); /* * Possibly larger than what we need as the number of apic ids per