From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S942429AbcJ1SpB (ORCPT ); Fri, 28 Oct 2016 14:45:01 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:48112 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934033AbcJ1Soq (ORCPT ); Fri, 28 Oct 2016 14:44:46 -0400 Date: Fri, 28 Oct 2016 20:41:56 +0200 (CEST) From: Thomas Gleixner To: Fenghua Yu cc: "H. Peter Anvin" , Ingo Molnar , Tony Luck , Peter Zijlstra , Stephane Eranian , Borislav Petkov , Dave Hansen , Nilay Vaish , Shaohua Li , David Carrillo-Cisneros , Ravi V Shankar , Sai Prakhya , Vikas Shivappa , linux-kernel , x86 Subject: Re: [PATCH v5 13/18] x86/intel_rdt: Add mkdir to resctrl file system In-Reply-To: <20161028175130.GB24456@linux.intel.com> Message-ID: References: <1477142405-32078-1-git-send-email-fenghua.yu@intel.com> <1477142405-32078-14-git-send-email-fenghua.yu@intel.com> <20161028175130.GB24456@linux.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 Fri, 28 Oct 2016, Fenghua Yu wrote: > On Wed, Oct 26, 2016 at 05:01:32PM +0200, Thomas Gleixner wrote: > > Handles all cases without 'CDP is special' and whatever nonsense intel will > > come up with in future. All you need to do is to add that force_min_closid > > field into the resource struct and set it for l3data and l3code. > > > > relaxed_max_closid is set at mount time by an appropriate mount option. > > Can we just do a simple implementation that finds the minimal closid? We > can implement the maximum closid and mount parameter later? Sure. I'm a great fan of: Keep It Simple > AFAIK, the minimal closid works in all current situations (L3, L3DATA, > L3CODE, and L2) and there is no platform that needs to use max closid yet. Good. > This is the updated patch that only change is to use minimal closid in > closid_init(). Does it look good? > > +static void closid_init(void) > +{ > + struct rdt_resource *r; > + int rdt_min_closid; > + > + /* Compute rdt_min_closid across all resources */ > + rdt_min_closid = 0; > + for_each_enabled_rdt_resource(r) > + rdt_min_closid = min(rdt_min_closid, r->num_closid); The result will be 0 :) You want to init rdt_min_closid to 32 or INT_MAX; Other than that it's perfect ! Thanks, tglx