Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752322AbdGYVO4 (ORCPT ); Tue, 25 Jul 2017 17:14:56 -0400 Received: from mga14.intel.com ([192.55.52.115]:62381 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752895AbdGYVNM (ORCPT ); Tue, 25 Jul 2017 17:13:12 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,412,1496127600"; d="scan'208";a="291390337" From: Vikas Shivappa To: vikas.shivappa@intel.com Cc: vikas.shivappa@linux.intel.com, x86@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, tglx@linutronix.de, peterz@infradead.org, ravi.v.shankar@intel.com, tony.luck@intel.com, fenghua.yu@intel.com, eranian@google.com, davidcc@google.com, ak@linux.intel.com, reinette.chatre@intel.com Subject: [PATCH 23/28] x86/intel_rdt: Introduce rdt_enable_key for scheduling Date: Tue, 25 Jul 2017 14:14:42 -0700 Message-Id: <1501017287-28083-24-git-send-email-vikas.shivappa@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501017287-28083-1-git-send-email-vikas.shivappa@linux.intel.com> References: <1501017287-28083-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 Content-Length: 1586 Lines: 50 Introduce the usage of rdt_enable_key in sched_in code as a preparation to add RDT monitoring support for sched_in. Signed-off-by: Vikas Shivappa --- arch/x86/include/asm/intel_rdt_sched.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/intel_rdt_sched.h b/arch/x86/include/asm/intel_rdt_sched.h index 2c704d2..8c5be01 100644 --- a/arch/x86/include/asm/intel_rdt_sched.h +++ b/arch/x86/include/asm/intel_rdt_sched.h @@ -27,10 +27,12 @@ struct intel_pqr_state { DECLARE_PER_CPU(struct intel_pqr_state, pqr_state); DECLARE_PER_CPU_READ_MOSTLY(struct intel_pqr_state, rdt_cpu_default); + +DECLARE_STATIC_KEY_FALSE(rdt_enable_key); DECLARE_STATIC_KEY_FALSE(rdt_alloc_enable_key); /* - * intel_rdt_sched_in() - Writes the task's CLOSid to IA32_PQR_MSR + * __intel_rdt_sched_in() - Writes the task's CLOSid to IA32_PQR_MSR * * Following considerations are made so that this has minimal impact * on scheduler hot path: @@ -42,7 +44,7 @@ struct intel_pqr_state { * * Must be called with preemption disabled. */ -static inline void intel_rdt_sched_in(void) +static inline void __intel_rdt_sched_in(void) { if (static_branch_likely(&rdt_alloc_enable_key)) { struct intel_pqr_state *state = this_cpu_ptr(&pqr_state); @@ -63,6 +65,12 @@ static inline void intel_rdt_sched_in(void) } } +static inline void intel_rdt_sched_in(void) +{ + if (static_branch_likely(&rdt_enable_key)) + __intel_rdt_sched_in(); +} + #else static inline void intel_rdt_sched_in(void) {} -- 1.9.1