From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755954AbcGHSlX (ORCPT ); Fri, 8 Jul 2016 14:41:23 -0400 Received: from mx2.suse.de ([195.135.220.15]:46386 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752461AbcGHSlO (ORCPT ); Fri, 8 Jul 2016 14:41:14 -0400 Date: Fri, 8 Jul 2016 20:41:10 +0200 From: Borislav Petkov To: Ingo Molnar Cc: "Luck, Tony" , "Yu, Fenghua" , Thomas Gleixner , "Anvin, H Peter" , Ingo Molnar , 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: <20160708184110.GD3938@pd.tnic> 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> <3908561D78D1C84285E8C5FCA982C28F3A15599C@ORSMSX114.amr.corp.intel.com> <20160708180746.GB4429@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160708180746.GB4429@gmail.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 On Fri, Jul 08, 2016 at 08:07:46PM +0200, Ingo Molnar wrote: > Who can we ... thank for that nonsensical naming? :-/ > > > E.g. on most Intel cpus you'll typically find "index0" is the L1-data cache, > > "index1" is the L1-instruction cache, "index3" is the L2-unified cache and > > "index4" is the L3-unified cache. > > Crazy. What was wrong with using 'level' or 'depth'? It is all there: $ grep . /sys/devices/system/cpu/cpu0/cache/index?/level /sys/devices/system/cpu/cpu0/cache/index0/level:1 /sys/devices/system/cpu/cpu0/cache/index1/level:1 /sys/devices/system/cpu/cpu0/cache/index2/level:2 /sys/devices/system/cpu/cpu0/cache/index3/level:3 $ grep . /sys/devices/system/cpu/cpu0/cache/index?/type /sys/devices/system/cpu/cpu0/cache/index0/type:Data /sys/devices/system/cpu/cpu0/cache/index1/type:Instruction /sys/devices/system/cpu/cpu0/cache/index2/type:Unified /sys/devices/system/cpu/cpu0/cache/index3/type:Unified for i in /sys/devices/system/cpu/cpu0/cache/index?; do l=$(cat $i/level) t=$(cat $i/type) printf "L%d-%s\n" $l $t done -> L1-Data L1-Instruction L2-Unified L3-Unified I believe the index naming is simply enumerating the caches... -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) --