[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.21.1802192158210.1853@nanos.tec.linutronix.de>
Date: Mon, 19 Feb 2018 22:01:41 +0100 (CET)
From: Thomas Gleixner <tglx@...utronix.de>
To: Reinette Chatre <reinette.chatre@...el.com>
cc: fenghua.yu@...el.com, tony.luck@...el.com, gavin.hindman@...el.com,
vikas.shivappa@...ux.intel.com, dave.hansen@...el.com,
mingo@...hat.com, hpa@...or.com, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH V2 08/22] x86/intel_rdt: Introduce pseudo-locking
resctrl files
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
Powered by blists - more mailing lists