From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758894AbdKQPAF (ORCPT ); Fri, 17 Nov 2017 10:00:05 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:51009 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758854AbdKQO75 (ORCPT ); Fri, 17 Nov 2017 09:59:57 -0500 Date: Fri, 17 Nov 2017 15:59:52 +0100 (CET) From: Thomas Gleixner To: Prarit Bhargava cc: linux-kernel@vger.kernel.org, Andi Kleen , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Peter Zijlstra , Dave Hansen , Piotr Luc , Kan Liang , Borislav Petkov , Stephane Eranian , Arvind Yadav , Andy Lutomirski , Christian Borntraeger , "Kirill A. Shutemov" , Tom Lendacky , He Chen , Mathias Krause , Tim Chen , Vitaly Kuznetsov Subject: Re: [PATCH v6 2/3] x86/topology: Avoid wasting 128k for package id array In-Reply-To: <20171114124257.22013-3-prarit@redhat.com> Message-ID: References: <20171114124257.22013-1-prarit@redhat.com> <20171114124257.22013-3-prarit@redhat.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 14 Nov 2017, Prarit Bhargava wrote: > @@ -389,6 +369,7 @@ void __init smp_store_boot_cpu_info(void) > *c = boot_cpu_data; > c->cpu_index = id; > smp_init_package_map(c, id); > + cpu_data(id).set = 1; What's wrong with c->set ? Aside of that 'set' is not really descriptive. initialized might be better suited. > } > > /* > @@ -399,13 +380,15 @@ void smp_store_cpu_info(int id) > { > struct cpuinfo_x86 *c = &cpu_data(id); > > - *c = boot_cpu_data; > + if (cpu_data(id).set == 0) > + *c = boot_cpu_data; > c->cpu_index = id; > /* > * During boot time, CPU0 has this setup already. Save the info when > * bringing up AP or offlined CPU0. > */ > identify_secondary_cpu(c); > + cpu_data(id).set = 1; See above. No need to resend. I'll fix it up. Thanks, tglx