From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934360AbdBQTlc (ORCPT ); Fri, 17 Feb 2017 14:41:32 -0500 Received: from mga06.intel.com ([134.134.136.31]:19886 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934673AbdBQTlP (ORCPT ); Fri, 17 Feb 2017 14:41:15 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,173,1484035200"; d="scan'208";a="48500946" From: Vikas Shivappa To: vikas.shivappa@intel.com Cc: linux-kernel@vger.kernel.org, x86@kernel.org, hpa@zytor.com, tglx@linutronix.de, mingo@kernel.org, peterz@infradead.org, ravi.v.shankar@intel.com, tony.luck@intel.com, fenghua.yu@intel.com, andi.kleen@intel.com, vikas.shivappa@linux.intel.com Subject: [PATCH 1/5] x86/intel_rdt: Update control registers only when user really modifies it Date: Fri, 17 Feb 2017 11:38:44 -0800 Message-Id: <1487360328-6768-2-git-send-email-vikas.shivappa@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1487360328-6768-1-git-send-email-vikas.shivappa@linux.intel.com> References: <1487360328-6768-1-git-send-email-vikas.shivappa@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When a schemata is updated, the values for all the domains and all resources are entered. However, the values for each of them may not change in many use cases as the user is only updating values for a subset of resources and domains. The resource control values are updated via QOS_MSRs which are per package. Change the update to QOS_MSRs to happen only when the control value on the particular domain is updated. Hence not sending IPIs on all domains when user updates the control vals. Signed-off-by: Vikas Shivappa --- arch/x86/kernel/cpu/intel_rdt_schemata.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/intel_rdt_schemata.c b/arch/x86/kernel/cpu/intel_rdt_schemata.c index f369cb8..14ba504 100644 --- a/arch/x86/kernel/cpu/intel_rdt_schemata.c +++ b/arch/x86/kernel/cpu/intel_rdt_schemata.c @@ -114,9 +114,16 @@ static int update_domains(struct rdt_resource *r, int closid) msr_param.high = msr_param.low + 1; msr_param.res = r; + /* + * Only update the domains that user has changed. + * There by avoiding unnecessary IPIs. + */ list_for_each_entry(d, &r->domains, list) { - cpumask_set_cpu(cpumask_any(&d->cpu_mask), cpu_mask); - d->cbm[msr_param.low] = r->tmp_cbms[idx++]; + if (d->cbm[msr_param.low] != r->tmp_cbms[idx]) { + cpumask_set_cpu(cpumask_any(&d->cpu_mask), cpu_mask); + d->cbm[msr_param.low] = r->tmp_cbms[idx]; + } + idx++; } cpu = get_cpu(); /* Update CBM on this cpu if it's in cpu_mask. */ -- 1.9.1