From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751441AbbFXIOK (ORCPT ); Wed, 24 Jun 2015 04:14:10 -0400 Received: from www.linutronix.de ([62.245.132.108]:43523 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751018AbbFXIOE (ORCPT ); Wed, 24 Jun 2015 04:14:04 -0400 Date: Wed, 24 Jun 2015 10:14:01 +0200 (CEST) From: Thomas Gleixner To: Vikas Shivappa cc: linux-kernel@vger.kernel.org, x86@kernel.org, hpa@zytor.com, mingo@kernel.org, tj@kernel.org, peterz@infradead.org, matt.fleming@intel.com, will.auld@intel.com, glenn.p.williamson@intel.com, kanaka.d.juvva@intel.com, priya.v.autee@intel.com Subject: Re: [PATCH 02/10] x86/intel_cqm: Modify hot cpu notification handling In-Reply-To: <1435100183-21720-3-git-send-email-vikas.shivappa@linux.intel.com> Message-ID: References: <1435100183-21720-1-git-send-email-vikas.shivappa@linux.intel.com> <1435100183-21720-3-git-send-email-vikas.shivappa@linux.intel.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 23 Jun 2015, Vikas Shivappa wrote: > This patch modifies hot cpu notification handling in Intel cache > monitoring: > > - to add a new cpu to the cqm_cpumask(which has one cpu per package) > during cpu start, it uses the existing package<->core map instead of > looping through all cpus in cqm_cpumask. > - to search for the next online sibling during cpu exit, it uses the > cpumask_any_online_but instead of looping through all online cpus. In > large systems with large number of cpus the time taken to loop may be > expensive and also the time increase linearly. Of course, you forgot to mention that you added the mutex around it and changed the hotplug logic by moving the calls to different hotplug events. That part wants to be a seperate patch anyway. > static int intel_cqm_cpu_notifier(struct notifier_block *nb, > @@ -1288,15 +1291,13 @@ static int intel_cqm_cpu_notifier(struct notifier_block *nb, > unsigned int cpu = (unsigned long)hcpu; > > switch (action & ~CPU_TASKS_FROZEN) { > - case CPU_UP_PREPARE: > + case CPU_ONLINE: > intel_cqm_cpu_prepare(cpu); Are you sure, that calling intel_cqm_cpu_prepare() from cpu_online is sufficient? If yes, please document that in the changelog. > + cqm_pick_event_reader(cpu); > break; > - case CPU_DOWN_PREPARE: > + case CPU_DEAD: > intel_cqm_cpu_exit(cpu); That means, the CPU is still set in cqm_cpumask when the CPU is disfunctional already. So the cpu calls in intel_cqm_rmid_stabilize(), intel_cqm_event_count(), intel_cqm_xchg_rmid() will not execute on the package to which the dead cpu belongs. Are you sure, that this is correct? If yes, please document WHY! Thanks, tglx