From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751356AbbFXIVa (ORCPT ); Wed, 24 Jun 2015 04:21:30 -0400 Received: from www.linutronix.de ([62.245.132.108]:43593 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750847AbbFXIVW (ORCPT ); Wed, 24 Jun 2015 04:21:22 -0400 Date: Wed, 24 Jun 2015 10:21:20 +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 09/10] x86/intel_rdt: Hot cpu support for Cache Allocation In-Reply-To: <1435100183-21720-10-git-send-email-vikas.shivappa@linux.intel.com> Message-ID: References: <1435100183-21720-1-git-send-email-vikas.shivappa@linux.intel.com> <1435100183-21720-10-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: > +/* > + * cbm_update_msrs() - Updates all the existing IA32_L3_MASK_n MSRs > + * which are one per CLOSid except IA32_L3_MASK_0 on the current package. > + */ > +static inline void cbm_update_msrs(void) > +{ > + int maxid = boot_cpu_data.x86_cache_max_closid; > + unsigned int i; > + > + /* > + * At cpureset, all bits of IA32_L3_MASK_n are set. > + * The index starts from one as there is no need > + * to update IA32_L3_MASK_0 as it belongs to root cgroup > + * whose cache mask is all 1s always. > + */ > + for (i = 1; i < maxid; i++) { > + if (ccmap[i].clos_refcnt) > + cbm_cpu_update((void *)i); So this is called via intel_rdt_cpu_notifier(CPU_ONLINE) intel_rdt_cpu_start() cbm_update_msrs() cbm_cpu_update() wrmsr() And runs on the CPU which initiated the hotplug and not on the newly online cpu. Pretty useless, right? > + } > +} > + > +static inline void intel_rdt_cpu_start(int cpu) > +{ > + struct intel_pqr_state *state = &per_cpu(pqr_state, cpu); > + > + state->closid = 0; > + mutex_lock(&rdt_group_mutex); > + if (rdt_cpumask_update(cpu)) > + cbm_update_msrs(); > + mutex_unlock(&rdt_group_mutex); > +} > + > +static void intel_rdt_cpu_exit(unsigned int cpu) > +{ > + int i; > + > + mutex_lock(&rdt_group_mutex); > + if (!cpumask_test_and_clear_cpu(cpu, &rdt_cpumask)) { > + mutex_unlock(&rdt_group_mutex); > + return; > + } > + > + i = cpumask_any_online_but(topology_core_cpumask(cpu), cpu); > + if (i < nr_cpu_ids) > + cpumask_set_cpu(i, &rdt_cpumask); > + mutex_unlock(&rdt_group_mutex); Same issue as in the cqm patch. Thanks, tglx