From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965962AbcIHKVi (ORCPT ); Thu, 8 Sep 2016 06:21:38 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:43377 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758877AbcIHKVg (ORCPT ); Thu, 8 Sep 2016 06:21:36 -0400 Date: Thu, 8 Sep 2016 12:18:59 +0200 (CEST) From: Thomas Gleixner To: Fenghua Yu cc: "H. Peter Anvin" , Ingo Molnar , Tony Luck , Peter Zijlstra , Tejun Heo , Borislav Petkov , Stephane Eranian , Marcelo Tosatti , David Carrillo-Cisneros , Shaohua Li , Ravi V Shankar , Vikas Shivappa , Sai Prakhya , linux-kernel , x86 Subject: Re: [PATCH v2 15/33] x86/intel_rdt: Adds support to enable Code Data Prioritization In-Reply-To: <1473328647-33116-16-git-send-email-fenghua.yu@intel.com> Message-ID: References: <1473328647-33116-1-git-send-email-fenghua.yu@intel.com> <1473328647-33116-16-git-send-email-fenghua.yu@intel.com> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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