Re: [PATCH 7/9] x86/intel_rdt: Implement scheduling support for Intel RDT

From: Peter Zijlstra
Date: Wed Jul 29 2015 - 09:50:18 EST


On Wed, Jul 01, 2015 at 03:21:08PM -0700, Vikas Shivappa wrote:
> diff --git a/arch/x86/include/asm/intel_rdt.h b/arch/x86/include/asm/intel_rdt.h
> index 3ad426c..78df3d7 100644
> --- a/arch/x86/include/asm/intel_rdt.h
> +++ b/arch/x86/include/asm/intel_rdt.h
> @@ -4,10 +4,16 @@
> #ifdef CONFIG_CGROUP_RDT
>
> #include <linux/cgroup.h>
> +#include <asm/rdt_common.h>
> +
> #define MAX_CBM_LENGTH 32
> #define IA32_L3_CBM_BASE 0xc90
> #define CBM_FROM_INDEX(x) (IA32_L3_CBM_BASE + x)
>
> +DECLARE_PER_CPU(struct intel_pqr_state, pqr_state);

You don't think this should be in rdt_common.h ?

> diff --git a/arch/x86/include/asm/rdt_common.h b/arch/x86/include/asm/rdt_common.h
> new file mode 100644
> index 0000000..01502c5
> --- /dev/null
> +++ b/arch/x86/include/asm/rdt_common.h
> @@ -0,0 +1,25 @@
> +#ifndef _X86_RDT_H_
> +#define _X86_RDT_H_
> +
> +#define MSR_IA32_PQR_ASSOC 0x0c8f
> +
> +/**
> + * struct intel_pqr_state - State cache for the PQR MSR
> + * @rmid: The cached Resource Monitoring ID
> + * @closid: The cached Class Of Service ID
> + * @rmid_usecnt: The usage counter for rmid
> + *
> + * The upper 32 bits of MSR_IA32_PQR_ASSOC contain closid and the
> + * lower 10 bits rmid. The update to MSR_IA32_PQR_ASSOC always
> + * contains both parts, so we need to cache them.
> + *
> + * The cache also helps to avoid pointless updates if the value does
> + * not change.
> + */
> +struct intel_pqr_state {
> + u32 rmid;
> + u32 closid;
> + int rmid_usecnt;
> +};
> +
> +#endif

So why not call this file PQR something or other? That's all there is.

> diff --git a/arch/x86/include/asm/switch_to.h b/arch/x86/include/asm/switch_to.h
> index 751bf4b..9149577 100644
> --- a/arch/x86/include/asm/switch_to.h
> +++ b/arch/x86/include/asm/switch_to.h
> @@ -8,6 +8,9 @@ struct tss_struct;
> void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p,
> struct tss_struct *tss);
>
> +#include <asm/intel_rdt.h>
> +#define finish_arch_switch(prev) intel_rdt_sched_in()

Right, so please stuff that in __switch_to(), I think I can kill
finish_arch_switch() entirely.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/