Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8922699ybi; Wed, 10 Jul 2019 01:41:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEOCpaaFJC1lX0kJTB533jP+BNLLi8XXhxklR3gaadqnSwNzolGjr7xc/+YR5hG7b11toJ X-Received: by 2002:a63:2bd2:: with SMTP id r201mr35250426pgr.193.1562748109329; Wed, 10 Jul 2019 01:41:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562748109; cv=none; d=google.com; s=arc-20160816; b=DrIUldydec8yx+bIMP5GzL7CpHN/gDwTUgQ1G7GaaM5Uh+HteWf39rzLc8FsuMth6n w7Hp42hx9B3AxBluXlgJj0TiLjMk0o+3GPsuB5+bx09FK8ShKBVBEbD1Op0OSDqKqZIl GaQCtMdnOQqzTQhTymvJ73j4jkke6UggXI3yEt7fkgQMxPTpVq9CcmRaSdcEjo2soRKO nnYQuO6phgkN1DH7ZrRYgzxC1wJmzDx1OfOnmVSctuT9blwRDgHasu+APLqtMusFR0pp hQXmjJxyOecKgcAkZI724Fnwvqn+QjkBRfF9W28Nz06SNo0hCEqgfnX/ta0ItXnoryKB etBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Z6YmTEgTEwKg2yvsPJh1tPfsth8NlCli3K7+n36xF4o=; b=UVg4gUnnjBspXN3Mn5PXs0QkZmc0+L21g7/kQ145vbVfC7y/h56u1XQBNJaXS698XA aqTLQW2qiKWFT4J45wOt+lswDIQ/Z0q52MBuME3x6yzahEV2K2MaykTTVMedTmUhrBdS Y2t2b60otTeFZ5PsRTf988QCl8Mlp2UpVhBS5cr/VIY45RFC11hwOpsuGQ0EHUCnuFSU aqXRLlaDofaU8PAOQC+kLVlE1rYvUmMG6tO6R8DeyLNkuihHNmIf68t1Go6y1Voh9EYz Whso+PcaT7ZHwL9KtTAt6eAwMvfJVcd0WxhSsKPCd2Y4LeMnv5O1l8e+DRy+DY+PfcAt Nk9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SChbYa6v; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o12si1655028pgn.390.2019.07.10.01.41.33; Wed, 10 Jul 2019 01:41:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SChbYa6v; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727399AbfGJIkY (ORCPT + 99 others); Wed, 10 Jul 2019 04:40:24 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:45033 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726580AbfGJIkY (ORCPT ); Wed, 10 Jul 2019 04:40:24 -0400 Received: by mail-io1-f66.google.com with SMTP id s7so2909467iob.11 for ; Wed, 10 Jul 2019 01:40:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=Z6YmTEgTEwKg2yvsPJh1tPfsth8NlCli3K7+n36xF4o=; b=SChbYa6vqOPxSrVss4jvB9tAF5OwMipdIy0s56Usv1Xte2BSlygDBfiNDqi2CdjODl Ug0jrCu+bv0/xHwZxDoEA7p7qrHLq5Qjrg43WWGsFxU97ztP5tAdsTE07lPSBp7pi1Y/ k0rD9Jlj6IQREds6kXolxrcTDAbr9qxnAWH0S7d5YXjySeQofztuYqTGmOJ0XyLirdOc B+lkGRWenHKBU0Y29efsJHEsE+DpBsrEU8ctJGCdyawBpkBc9zpIOf7DYiMV50yXoQZw 0ydFObFgoNJFiGgjTiHlvwygdQe6YuN9Dl0LhsUPxsSfXcOfUpPaE5oV4aBKgjoQeXWe 1x6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=Z6YmTEgTEwKg2yvsPJh1tPfsth8NlCli3K7+n36xF4o=; b=ksxEYGBevsJ77jSrxn72WQ8AxV1kO+sY+98Ij9J+gGU2Bf+8SA/GiAxqvvGJT3oZut 2wETW4fXeO/Ubg1G82O1NZ4AbAluOMLvWTE/tYVD7FvvL4D7eFfh0Utwh834hAs/UBgQ X1nnSLPXmSlNNcbvKMMbgZkxDOyFkrwrFkAkjw7l43auOBC7s01HqrwnHf+IOzvJlHxi b3rvYz7r5oIpoZVp7FJtYiLBdAqhLwbl2YXpEzsf0HsgLC5rYIoUMwu0ewYJ62pbeBAD Pk/NCjXQhYXuCsPXYoSYjNNMrRfWnWgrle24wjON1SBX6ykAK7EYLmTu4JfG/YStMLO6 bLhw== X-Gm-Message-State: APjAAAXsX3lWYk6GXyWQS0nBTU4qWn6ZmVO8YelSQCGEEU8U6LrNb8ha 0R9c/hWwVgAGhsTsCNcG5kyNOYviyMkKQKU1qA== X-Received: by 2002:a05:6602:2413:: with SMTP id s19mr17062108ioa.161.1562748023178; Wed, 10 Jul 2019 01:40:23 -0700 (PDT) MIME-Version: 1.0 References: <1562300143-11671-1-git-send-email-kernelfans@gmail.com> <1562300143-11671-2-git-send-email-kernelfans@gmail.com> <4AF3459B-28F2-425F-8E4B-40311DEF30C6@amacapital.net> In-Reply-To: <4AF3459B-28F2-425F-8E4B-40311DEF30C6@amacapital.net> From: Pingfan Liu Date: Wed, 10 Jul 2019 16:40:11 +0800 Message-ID: Subject: Re: [PATCH 2/2] x86/numa: instance all parsed numa node To: Andy Lutomirski Cc: Thomas Gleixner , x86@kernel.org, Michal Hocko , Dave Hansen , Mike Rapoport , Tony Luck , Andy Lutomirski , Peter Zijlstra , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Andrew Morton , Vlastimil Babka , Oscar Salvador , Pavel Tatashin , Mel Gorman , Benjamin Herrenschmidt , Michael Ellerman , Stephen Rothwell , Qian Cai , Barret Rhoden , Bjorn Helgaas , David Rientjes , linux-mm@kvack.org, LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 9, 2019 at 9:34 PM Andy Lutomirski wrote: > > > > > On Jul 9, 2019, at 1:24 AM, Pingfan Liu wrote: > > > >> On Tue, Jul 9, 2019 at 2:12 PM Thomas Gleixner wr= ote: > >> > >>> On Tue, 9 Jul 2019, Pingfan Liu wrote: > >>>> On Mon, Jul 8, 2019 at 5:35 PM Thomas Gleixner = wrote: > >>>> It can and it does. > >>>> > >>>> That's the whole point why we bring up all CPUs in the 'nosmt' case = and > >>>> shut the siblings down again after setting CR4.MCE. Actually that's = in fact > >>>> a 'let's hope no MCE hits before that happened' approach, but that's= all we > >>>> can do. > >>>> > >>>> If we don't do that then the MCE broadcast can hit a CPU which has s= ome > >>>> firmware initialized state. The result can be a full system lockup, = triple > >>>> fault etc. > >>>> > >>>> So when the MCE hits a CPU which is still in the crashed kernel lala= state, > >>>> then all hell breaks lose. > >>> Thank you for the comprehensive explain. With your guide, now, I have > >>> a full understanding of the issue. > >>> > >>> But when I tried to add something to enable CR4.MCE in > >>> crash_nmi_callback(), I realized that it is undo-able in some case (i= f > >>> crashed, we will not ask an offline smt cpu to online), also it is > >>> needless. "kexec -l/-p" takes the advantage of the cpu state in the > >>> first kernel, where all logical cpu has CR4.MCE=3D1. > >>> > >>> So kexec is exempt from this bug if the first kernel already do it. > >> > >> No. If the MCE broadcast is handled by a CPU which is stuck in the old > >> kernel stop loop, then it will execute on the old kernel and eventuall= y run > >> into the memory corruption which crashed the old one. > >> > > Yes, you are right. Stuck cpu may execute the old do_machine_check() > > code. But I just found out that we have > > do_machine_check()->__mc_check_crashing_cpu() to against this case. > > > > And I think the MCE issue with nr_cpus is not closely related with > > this series, can > > be a separated issue. I had question whether Andy will take it, if > > not, I am glad to do it. > > > > > > Go for it. I=E2=80=99m not familiar enough with the SMP boot stuff that I= would be able to do it any faster than you. I=E2=80=99ll gladly help revie= w it. I had sent out a patch to fix maxcpus "[PATCH] smp: force all cpu to boot once under maxcpus option" But for the case of nrcpus, I think things will not be so easy due to percpu area, and I think it may take a quite different way. Thanks, Pingfan