lkml.org 
[lkml]   [2016]   [Sep]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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

\
 
 \ /
  Last update: 2016-09-17 09:58    [W:1.191 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site