From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752191AbcGAQuo (ORCPT ); Fri, 1 Jul 2016 12:50:44 -0400 Received: from mga09.intel.com ([134.134.136.24]:1505 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751964AbcGAQun (ORCPT ); Fri, 1 Jul 2016 12:50:43 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,557,1459839600"; d="scan'208";a="1013610814" Date: Fri, 1 Jul 2016 09:50:41 -0700 From: "Luck, Tony" To: Borislav Petkov Cc: Fenghua Yu , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Peter Zijlstra , Stephane Eranian , Ravi V Shankar , Vikas Shivappa , linux-kernel , x86 Subject: Re: [PATCH] cacheinfo: Introduce cache id Message-ID: <20160701165041.GA18186@intel.com> References: <1467251771-55501-1-git-send-email-fenghua.yu@intel.com> <20160701102143.GB4749@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160701102143.GB4749@pd.tnic> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 01, 2016 at 12:21:43PM +0200, Borislav Petkov wrote: > On Wed, Jun 29, 2016 at 06:56:10PM -0700, Fenghua Yu wrote: > > From: Fenghua Yu > > > > Each cache node is described by cacheinfo and is a unique node across > > What is a cache node? Clearly not a good name for the concept we are trying to communicate here. Better suggestions welcome! Here's the situation. We have lots of (mostly) independent caches on a system. The L3 cache (also called LLC - Last Level Cache - in some documentation) is usually shared by all cpus on a physical socket. The L1 and L2 caches are typically local to a core, so only shared by the hyperthreads on a core. But I say "usually" and "typically" because the architecture doesn't require that. We could have multiple separate L3 caches on a socket with a subset of cpus assigned to each of them. We could have an L2 cache that is shared by two or more cores. /sys/devices/system/cpu/cpu*/cache/index*/shared_cpu_{list,map} allow for arbitrary sharing schemes and tell you which caches are shared among which groups of Linux logical cpus. What we don't have is a *name* for each cache. CAT (Intel Cache Allocation Technology) allows us to partition caches on a per task basis. E.g. process A can only use 20% of the L3 cache on socket0, process B can use 40% (that doesn't overlap with the 20% assigned to process A - or perhaps does overlap - the feature is quite versatile). But since caches aren't necessarily mapped to sockets or cores, we need a name for each cache. > And since this patch adds the generic functionality and then enables it > on x86, it should be split into two patches. Mea culpa. Fenghua had split this as you suggest, and I said "with just 23 lines added this can be one patch". Sorry Fenghua. -Tony