From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752843AbcCRCb1 (ORCPT ); Thu, 17 Mar 2016 22:31:27 -0400 Received: from mail-wm0-f46.google.com ([74.125.82.46]:36823 "EHLO mail-wm0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752643AbcCRCbU (ORCPT ); Thu, 17 Mar 2016 22:31:20 -0400 MIME-Version: 1.0 In-Reply-To: References: <20160317095220.GO6344@twins.programming.kicks-ass.net> <20160317102633.GR6344@twins.programming.kicks-ass.net> Date: Fri, 18 Mar 2016 10:31:19 +0800 Message-ID: Subject: Re: 4.5.0+ panic when setup loop device From: Xiong Zhou To: Thomas Gleixner Cc: Peter Zijlstra , "linux-kernel@vger.kernel.org" , Ingo Molnar , Borislav Petkov , Andreas Herrmann , Jens Axboe Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Mar 17, 2016 at 7:39 PM, Thomas Gleixner wrote: > B1;2802;0cOn Thu, 17 Mar 2016, Peter Zijlstra wrote: > >> On Thu, Mar 17, 2016 at 11:21:24AM +0100, Thomas Gleixner wrote: >> > On Thu, 17 Mar 2016, Peter Zijlstra wrote: >> > >> > > Could you please try? I'm not sure how this would explain your loop >> > > device bug fail, but it certainly pointed towards broken. >> > >> > It definitely does not explain it. The wreckage that topo stuff causes is that >> > it disables a cpu, but that really is not a reason for block/loop to explode. >> >> Right. Sadly I could not reproduce that error on my machine. But we can >> at least start by fixing the 'obvious' problems and then maybe we get >> more clues ;-) > > I'm able to reproduce by rejecting a cpu in that topology map function > forcefully. > > That stuff explodes, because the block-mq code assumes that cpu_possible_mask > has no holes. > > #define queue_for_each_ctx(q, ctx, i) \ > for ((i) = 0; (i) < (q)->nr_queues && \ > ({ ctx = per_cpu_ptr((q)->queue_ctx, (i)); 1; }); (i)++) > > is what makes that assumption about a consecutive possible mask. > > The cure for now is the patch below on top of PeterZ's patch. No panic with both Peter's patch and yours. Thanks all. -- Xiong > > But we have to clarify and document whether holes in cpu_possible_mask are not > allowed at all or if code like the above is simply broken. > > Thanks, > > tglx > --- > diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c > index 643dbdccf4bc..f2ed8a01f870 100644 > --- a/arch/x86/kernel/smpboot.c > +++ b/arch/x86/kernel/smpboot.c > @@ -345,7 +345,6 @@ static void __init smp_init_package_map(void) > continue; > pr_warn("CPU %u APICId %x disabled\n", cpu, apicid); > per_cpu(x86_bios_cpu_apicid, cpu) = BAD_APICID; > - set_cpu_possible(cpu, false); > set_cpu_present(cpu, false); > } > } > > > > > > > >