From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755950AbcGHSHi (ORCPT ); Fri, 8 Jul 2016 14:07:38 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:32910 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752461AbcGHSHa (ORCPT ); Fri, 8 Jul 2016 14:07:30 -0400 Date: Fri, 8 Jul 2016 20:06:42 +0200 From: Ingo Molnar To: "Yu, Fenghua" Cc: Thomas Gleixner , "Anvin, H Peter" , Ingo Molnar , Borislav Petkov , "Luck, Tony" , Stephane Eranian , Peter Zijlstra , Vikas Shivappa , "Shankar, Ravi V" , linux-kernel , x86 Subject: Re: [PATCH v2 2/3] Documentation, ABI: Add a document entry for cache id Message-ID: <20160708180642.GA4429@gmail.com> References: <1467842838-57246-1-git-send-email-fenghua.yu@intel.com> <1467842838-57246-3-git-send-email-fenghua.yu@intel.com> <20160708084146.GA4508@gmail.com> <3E5A0FA7E9CA944F9D5414FEC6C712205DFD3208@ORSMSX106.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3E5A0FA7E9CA944F9D5414FEC6C712205DFD3208@ORSMSX106.amr.corp.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Yu, Fenghua wrote: > > From: Ingo Molnar [mailto:mingo.kernel.org@gmail.com] On Behalf Of Ingo > > Molnar > > Sent: Friday, July 08, 2016 1:42 AM > > * Fenghua Yu wrote: > > > > > From: Fenghua Yu > > > > > > Add an ABI document entry for > > /sys/devices/system/cpu/cpu*/cache/index*/id. > > > > > > Signed-off-by: Fenghua Yu > > > --- > > > Documentation/ABI/testing/sysfs-devices-system-cpu | 13 > > +++++++++++++ > > > 1 file changed, 13 insertions(+) > > > > > > diff --git a/Documentation/ABI/testing/sysfs-devices-system-cpu > > b/Documentation/ABI/testing/sysfs-devices-system-cpu > > > index 1650133..cc62034 100644 > > > --- a/Documentation/ABI/testing/sysfs-devices-system-cpu > > > +++ b/Documentation/ABI/testing/sysfs-devices-system-cpu > > > @@ -272,6 +272,19 @@ Description: Parameters for the CPU cache > > attributes > > > the modified cache line is written to main > > > memory only when it is replaced > > > > > > + > > > +What: /sys/devices/system/cpu/cpu*/cache/index*/id > > > +Date: July 2016 > > > +Contact: Linux kernel mailing list > > > +Description: Cache id > > > + > > > + The id identifies a cache in the platform. In same index, the id > > > + is unique across the platform. > > > > What does 'In same index' mean? > > It means one cache's id is unique in all caches with same cache index number. > For example, in all caches with index3 (i.e. level3), cache id 0 is unique to > identify a L3 cache. But in caches with index 0 (i.e. Level0), there is also a > cache id 0. So cache id is unique in one index. But not unique in two different > index. > > Does that make sense? I hope I express that correctly. Yeah, makes sense! I'd express it like that: The ID identifies a specific hardware cache of the machine the kernel is running on. The (depth_index, ID) pair uniquely identifies a cache. And wherever you mention 'index' I'd change it over to 'depth index' - because 'index' alone is way too opaque - the 'id' is an index too. Also note how I avoided the 'platform' word - that is really ambigious as well: it might mean something generic like 'x86', not just the actual system we are on. BTW., are there any ID enumeration continuity guarantees, or can there be holes in the depth index or the ID? (In the normal case, not considering CPU hotplug creating holes.) Is it the kernel that does the enumeration or do we trust what the hardware (CPUID) is telling us? Thanks, Ingo