From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757796Ab3LXBJU (ORCPT ); Mon, 23 Dec 2013 20:09:20 -0500 Received: from szxga01-in.huawei.com ([119.145.14.64]:45756 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752815Ab3LXBJT (ORCPT ); Mon, 23 Dec 2013 20:09:19 -0500 Message-ID: <52B8DEAE.2040100@huawei.com> Date: Tue, 24 Dec 2013 09:09:02 +0800 From: Xie XiuQi User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20130307 Thunderbird/17.0.4 MIME-Version: 1.0 To: Borislav Petkov CC: Ingo Molnar , Ingo Molnar , "linux-kernel@vger.kernel.org" , Li Bin Subject: Re: [PATCH v2][TRIVIAL] x86/smpboot: fix cpu bootup message References: <52B7F53C.5020001@huawei.com> <20131223133402.GA4487@pd.tnic> In-Reply-To: <20131223133402.GA4487@pd.tnic> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.135.69.18] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2013/12/23 21:34, Borislav Petkov wrote: > On Mon, Dec 23, 2013 at 04:33:00PM +0800, Xie XiuQi wrote: >> When CPU0 and CPU1 aren't in same package, we got message >> like this: >> [...] >> >> diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c >> index 85dc05a..9e82c1e 100644 >> --- a/arch/x86/kernel/smpboot.c >> +++ b/arch/x86/kernel/smpboot.c >> @@ -639,7 +639,7 @@ static void announce_cpu(int cpu, int apicid) >> { >> static int current_node = -1; >> int node = early_cpu_to_node(cpu); >> - static int width, node_width; >> + static int width, node_width, padding; >> >> if (!width) >> width = num_digits(num_possible_cpus()) + 1; /* + '#' sign */ >> @@ -658,11 +658,13 @@ static void announce_cpu(int cpu, int apicid) >> >> printk(KERN_INFO ".... node %*s#%d, CPUs: ", >> node_width - num_digits(node), " ", node); >> - } >> >> - /* Add padding for the BSP */ >> - if (cpu == 1) >> - pr_cont("%*s", width + 1, " "); >> + /* Add padding for the BSP */ >> + if (!padding && (early_cpu_to_node(0) == current_node)) { > > You don't need "padding". > On another machine, the configuration is: xiexiuqi@localhost:~> lscpu [...] NUMA node0 CPU(s): 4-7,12-15 NUMA node1 CPU(s): 0-3,8-11 Without "padding", we'll get message like this: [ 0.349339] x86: Booting SMP configuration: [ 0.353504] .... node #1, CPUs: #1 #2 #3 [ 0.398812] .... node #0, CPUs: #4 #5 #6 #7 [ 0.535186] .... node #1, CPUs: #8 #9 #10 #11 [ 0.594312] .... node #0, CPUs: #12 #13 #14 #15 [ 0.652398] x86: Booted up 2 nodes, 16 CPUs