Re: [RFC PATCH V2 08/22] x86/intel_rdt: Introduce pseudo-locking resctrl files

From: Thomas Gleixner
Date: Mon Feb 19 2018 - 16:01:44 EST


On Tue, 13 Feb 2018, Reinette Chatre wrote:
> diff --git a/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c b/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c
> index 7a22e367b82f..94bd1b4fbfee 100644
> --- a/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c
> +++ b/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c
> @@ -40,6 +40,7 @@ static DEFINE_MUTEX(rdt_pseudo_lock_mutex);
> * @kn: kernfs node representing this region in the resctrl
> * filesystem
> * @cbm: bitmask of the pseudo-locked region
> + * @size: size of pseudo-locked region in bytes
> * @cpu: core associated with the cache on which the setup code
> * will be run
> * @minor: minor number of character device associated with this
> @@ -52,6 +53,7 @@ static DEFINE_MUTEX(rdt_pseudo_lock_mutex);
> struct pseudo_lock_region {
> struct kernfs_node *kn;
> u32 cbm;
> + unsigned int size;
> int cpu;
> unsigned int minor;
> bool locked;
> @@ -227,6 +229,49 @@ static struct kernfs_ops pseudo_lock_avail_ops = {
> .seq_show = pseudo_lock_avail_show,
> };
>
> +int pseudo_lock_schemata_show(struct kernfs_open_file *of,
> + struct seq_file *seq, void *v)
> +{
> + struct pseudo_lock_region *plr;
> + struct rdt_resource *r;
> + int ret = 0;
> +
> + plr = pseudo_lock_region_kn_lock(of->kn);
> + if (!plr) {
> + ret = -ENOENT;
> + goto out;
> + }
> +
> + if (!plr->locked) {
> + for_each_alloc_enabled_rdt_resource(r) {
> + seq_printf(seq, "%s:uninitialized\n", r->name);
> + }

Surplus braces around the for_...()

Thanks,

tglx