Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262125AbVERILO (ORCPT ); Wed, 18 May 2005 04:11:14 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262131AbVERILO (ORCPT ); Wed, 18 May 2005 04:11:14 -0400 Received: from aun.it.uu.se ([130.238.12.36]:63701 "EHLO aun.it.uu.se") by vger.kernel.org with ESMTP id S262129AbVERIHy (ORCPT ); Wed, 18 May 2005 04:07:54 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17034.63435.196130.708395@alkaid.it.uu.se> Date: Wed, 18 May 2005 10:07:39 +0200 From: Mikael Pettersson To: Andi Kleen Cc: linux-kernel@vger.kernel.org, akpm@osdl.org Subject: Re: [PATCH 2.6.12-rc4-mm2] perfctr: x86 update with K8 multicore fixes, take 2 In-Reply-To: References: <200505172044.j4HKiMTY026776@alkaid.it.uu.se> X-Mailer: VM 7.17 under Emacs 20.7.1 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1342 Lines: 38 Andi Kleen writes: > Mikael Pettersson writes: > > > +#ifdef CONFIG_SMP > > +static void __init k8_multicore_init(void) > > +{ > > + cpumask_t non0cores; > > + int i; > > + > > + cpus_clear(non0cores); > > + for(i = 0; i < NR_CPUS; ++i) { > > + cpumask_t cores = cpu_core_map[i]; > > + int core0 = first_cpu(cores); > > + if (core0 >= NR_CPUS) > > + continue; > > + cpu_clear(core0, cores); > > + cpus_or(non0cores, non0cores, cores); > > + } > > + if (cpus_empty(non0cores)) > > + return; > > + k8_is_multicore = 1; > > That is still far too complicated. Just use current_cpu_data->x86_num_cores > 1 > That is simple enough that you don't need the ugly variable. Right now you're right, but if you read the big comment just above this code you'll see that once chips w/o the RevE erratum are released, I'll make more serious use of the non0cores cpumask. I consider _that_ the intended design (for the shared NB issue), and the current code (just the k8_is_multicore flag) a workaround for the NB clobber erratum in the 1st gen chips. /Mikael - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/