From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751893AbbFXVSd (ORCPT ); Wed, 24 Jun 2015 17:18:33 -0400 Received: from mga14.intel.com ([192.55.52.115]:39184 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750966AbbFXVS0 (ORCPT ); Wed, 24 Jun 2015 17:18:26 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,673,1427785200"; d="scan'208";a="734023648" Date: Wed, 24 Jun 2015 14:15:47 -0700 (PDT) From: Vikas Shivappa X-X-Sender: vikas@vshiva-Udesk To: Thomas Gleixner cc: Vikas Shivappa , linux-kernel@vger.kernel.org, x86@kernel.org, hpa@zytor.com, mingo@kernel.org, tj@kernel.org, peterz@infradead.org, Matt Fleming , "Auld, Will" , "Williamson, Glenn P" , "Juvva, Kanaka D" , "Autee, Priya V" Subject: Re: [PATCH 09/10] x86/intel_rdt: Hot cpu support for Cache Allocation In-Reply-To: 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.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 24 Jun 2015, Thomas Gleixner wrote: > 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? Will fix. > >> + } >> +} >> + >> +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. will fix. yes this may risk the package to not have some updates. Thanks, Vikas > > Thanks, > > tglx >