[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.20.1609081215160.5647@nanos>
Date: Thu, 8 Sep 2016 12:18:59 +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>,
Tejun Heo <tj@...nel.org>, Borislav Petkov <bp@...e.de>,
Stephane Eranian <eranian@...gle.com>,
Marcelo Tosatti <mtosatti@...hat.com>,
David Carrillo-Cisneros <davidcc@...gle.com>,
Shaohua Li <shli@...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 v2 15/33] x86/intel_rdt: Adds support to enable Code Data
Prioritization
On Thu, 8 Sep 2016, Fenghua Yu wrote:
>
> +struct clos_config {
> + unsigned long *closmap;
> + u32 max_closid;
> + u32 closids_used;
> +};
Another badly formatted and undocumented structure
> +struct clos_config cconfig;
> +bool cdp_enabled;
Once more global variables without a declaration in a header and no user
outside of this file.
> +#define __DCBM_TABLE_INDEX(x) (x << 1)
> +#define __ICBM_TABLE_INDEX(x) ((x << 1) + 1)
>
> struct rdt_remote_data {
> int msr;
> @@ -122,22 +123,28 @@ static int closid_alloc(u32 *closid)
>
> lockdep_assert_held(&rdtgroup_mutex);
>
> - maxid = boot_cpu_data.x86_cache_max_closid;
> - id = find_first_zero_bit(closmap, maxid);
> + maxid = cconfig.max_closid;
Cute. You can remove all that code because maxid is always 0.
> /*
> * Set only one cpu in cpumask in all cpus that share the same cache.
> */
> @@ -191,7 +213,7 @@ static inline bool rdt_cpumask_update(int cpu)
> */
> static void cbm_update_msrs(void *dummy)
> {
> - int maxid = boot_cpu_data.x86_cache_max_closid;
> + int maxid = cconfig.max_closid;
Ditto
> size = BITS_TO_LONGS(maxid) * sizeof(long);
> - closmap = kzalloc(size, GFP_KERNEL);
> - if (!closmap) {
> + cconfig.closmap = kzalloc(size, GFP_KERNEL);
> + if (!cconfig.closmap) {
Simply because it's never initialized.
Thanks,
tglx
Powered by blists - more mailing lists