[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1610180007220.6407@nanos>
Date: Tue, 18 Oct 2016 00:35:09 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Fenghua Yu <fenghua.yu@...el.com>
cc: "H. Peter Anvin" <h.peter.anvin@...el.com>,
Ingo Molnar <mingo@...e.hu>, Tony Luck <tony.luck@...el.com>,
Peter Zijlstra <peterz@...radead.org>,
Stephane Eranian <eranian@...gle.com>,
Borislav Petkov <bp@...e.de>,
Dave Hansen <dave.hansen@...el.com>,
Nilay Vaish <nilayvaish@...il.com>, Shaohua Li <shli@...com>,
David Carrillo-Cisneros <davidcc@...gle.com>,
Ravi V Shankar <ravi.v.shankar@...el.com>,
Sai Prakhya <sai.praneeth.prakhya@...el.com>,
Vikas Shivappa <vikas.shivappa@...ux.intel.com>,
linux-kernel <linux-kernel@...r.kernel.org>, x86 <x86@...nel.org>
Subject: Re: [PATCH v4 16/18] x86/intel_rdt: Add schemata file
On Fri, 14 Oct 2016, Fenghua Yu wrote:
> +static void update_domains(struct rdt_resource *r, int closid)
> +{
> + int cpu, idx = 0;
> + struct list_head *l;
> + struct rdt_domain *d;
> + struct msr_param msr_param;
> + struct cpumask cpu_mask;
Again. No cpumasks on stack.
> +ssize_t rdtgroup_schemata_write(struct kernfs_open_file *of,
> + char *buf, size_t nbytes, loff_t off)
> +{
> + char *tok, *resname;
> + struct rdtgroup *rdtgrp;
> + struct rdt_resource *r;
> + int closid, ret = 0;
> + u32 *l3_cbms = NULL;
> +
> + /* Legal input requires a trailing newline */
s/Legal/Valid/ please. There is no law which enforces this.
> + if (nbytes == 0 || buf[nbytes - 1] != '\n')
> + return -EINVAL;
> + buf[nbytes - 1] = '\0';
> +
> + rdtgrp = rdtgroup_kn_lock_live(of->kn);
> + if (!rdtgrp) {
> + rdtgroup_kn_unlock(of->kn);
> + return -ENOENT;
> + }
> +
> + closid = rdtgrp->closid;
> +
> + /* get scratch space to save all the masks while we validate input */
> + for_each_rdt_resource(r) {
> + r->tmp_cbms = kcalloc(r->num_domains << r->cdp_enabled,
> + sizeof(*l3_cbms), GFP_KERNEL);
> + if (!r->tmp_cbms) {
> + ret = -ENOMEM;
> + goto fail;
> + }
> + r->num_cbms = 0;
This wants to be r->num_tmp_cbms for clarity.
Thanks,
tglx
Powered by blists - more mailing lists