[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACbG308UW7yd3PSBKHz5h2DyVMGn3ciRg+7_HQ3RkytuHHbaLw@mail.gmail.com>
Date: Mon, 25 Jul 2016 11:25:10 -0500
From: Nilay Vaish <nilayvaish@...il.com>
To: Fenghua Yu <fenghua.yu@...el.com>
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...e.hu>,
"H. Peter Anvin" <h.peter.anvin@...el.com>,
Tony Luck <tony.luck@...el.com>, Tejun Heo <tj@...nel.org>,
Borislav Petkov <bp@...e.de>,
Stephane Eranian <eranian@...gle.com>,
Peter Zijlstra <peterz@...radead.org>,
Marcelo Tosatti <mtosatti@...hat.com>,
David Carrillo-Cisneros <davidcc@...gle.com>,
Ravi V Shankar <ravi.v.shankar@...el.com>,
Vikas Shivappa <vikas.shivappa@...ux.intel.com>,
Sai Prakhya <sai.praneeth.prakhya@...el.com>,
linux-kernel <linux-kernel@...r.kernel.org>, x86 <x86@...nel.org>
Subject: Re: [PATCH 05/32] x86/intel_rdt: Implement scheduling support for
Intel RDT
On 12 July 2016 at 20:02, Fenghua Yu <fenghua.yu@...el.com> wrote:
> diff --git a/arch/x86/include/asm/intel_rdt.h b/arch/x86/include/asm/intel_rdt.h
> index 4f45dc8..afb6da3 100644
> --- a/arch/x86/include/asm/intel_rdt.h
> +++ b/arch/x86/include/asm/intel_rdt.h
> @@ -3,14 +3,42 @@
>
> #ifdef CONFIG_INTEL_RDT
>
> +#include <linux/jump_label.h>
> +
> #define MAX_CBM_LENGTH 32
> #define IA32_L3_CBM_BASE 0xc90
> #define CBM_FROM_INDEX(x) (IA32_L3_CBM_BASE + x)
>
> +extern struct static_key rdt_enable_key;
> +void __intel_rdt_sched_in(void *dummy);
> +
> struct clos_cbm_table {
> unsigned long l3_cbm;
> unsigned int clos_refcnt;
> };
>
> +/*
> + * 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:
> + * - This will stay as no-op unless we are running on an Intel SKU
> + * which supports L3 cache allocation.
> + * - Caches the per cpu CLOSid values and does the MSR write only
> + * when a task with a different CLOSid is scheduled in.
> + */
> +static inline void intel_rdt_sched_in(void)
> +{
> + /*
> + * Call the schedule in code only when RDT is enabled.
> + */
> + if (static_key_false(&rdt_enable_key))
> + __intel_rdt_sched_in(NULL);
static_key_false() is deprecated. I think this should be
static_branch_unlikely().
> diff --git a/arch/x86/kernel/cpu/intel_rdt.c b/arch/x86/kernel/cpu/intel_rdt.c
> index 6ad5b48..8379df8 100644
> --- a/arch/x86/kernel/cpu/intel_rdt.c
> +++ b/arch/x86/kernel/cpu/intel_rdt.c
> @@ -44,12 +46,33 @@ static cpumask_t rdt_cpumask;
> */
> static cpumask_t tmp_cpumask;
> static DEFINE_MUTEX(rdt_group_mutex);
> +struct static_key __read_mostly rdt_enable_key = STATIC_KEY_INIT_FALSE;
>
Similarly, this should be DEFINE_STATIC_KEY_FALSE(rdt_enable_key);
Thanks
Nilay
Powered by blists - more mailing lists