Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp4427311ybh; Tue, 6 Aug 2019 11:27:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqwAyUC4Wy/5RlXRAm65p+n0OSNryQxE9y5MiLyLdMI49wtoKhusD3Ho3CMnnjJgq8vziGri X-Received: by 2002:aa7:8dcc:: with SMTP id j12mr5098570pfr.137.1565116058088; Tue, 06 Aug 2019 11:27:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565116058; cv=none; d=google.com; s=arc-20160816; b=lkGaeilDBe9qkfw8WvEWbUtuwbauW/+fPjU69GX37XoZ5ym3CF9CJ4wY90ansUjPuo 2c69JPO2kJiYuMDqHtWTC/oeVp52z0FZswDeo+nrMlx1KihendPCpXBq4WwFLRjR4Be3 qO2NkU7QYuQPuRRo24J50ZYEhZFXI1mUF7fG0/pXof5o6rQe5McWeSq6F6i9XFGtMaoa pdQiQT3UizCn/xQlTwmbey7wTllvHQoNRXwuTpkQf7mUNxwghhFvb0juqIsH9+Wf/W+4 hEcYzBmE2v0oiIUo6hkyBomKfPc+NxQM2uodIZ+j1e86sLXnJUiy8kdXEfbUahwfuGcx PZoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=NyOfZda8mobuNRziSShPs46svXO3Zk5Zfc8NlrtSwx0=; b=sBCieTqdoCaDwvU2osRjd2KYxoEQBu/9E1gKVAtkXKxOZgS0sJWalv4lYo1K+hbGFU VuMxN1ZUwMuxR0bHV03g30+hKO3W/f7XyLPFoxRBF+8GDMhIPYC9/0GwHkO3NGBIJt81 X83/710IuinLeqzTbA/8kPshHYhFKvZkZrqisSqPbw1Qb9rRaJnqgMCH0DZdZfXKlw2C D3nLFCQhrYcy+hv+BdmldLK0YufrXx8ktk5Amt46DZ1tO1981YYhPSyFmTls1InOi/TG dd0MQKl1h7VvE9Yr9Hoffc1F/Es8c2w6JXufu8nRmEL87xIbbMmFfEor+VoYOiWD4vPt G4BQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i8si12645340pgm.179.2019.08.06.11.27.21; Tue, 06 Aug 2019 11:27:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732759AbfHFSTb (ORCPT + 99 others); Tue, 6 Aug 2019 14:19:31 -0400 Received: from mga03.intel.com ([134.134.136.65]:60069 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726373AbfHFSTb (ORCPT ); Tue, 6 Aug 2019 14:19:31 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Aug 2019 11:13:24 -0700 X-IronPort-AV: E=Sophos;i="5.64,353,1559545200"; d="scan'208";a="325711406" Received: from rchatre-mobl.amr.corp.intel.com (HELO [10.24.14.91]) ([10.24.14.91]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/AES256-SHA; 06 Aug 2019 11:13:24 -0700 Subject: Re: [PATCH V2 01/10] x86/CPU: Expose if cache is inclusive of lower level caches To: Borislav Petkov Cc: tglx@linutronix.de, fenghua.yu@intel.com, tony.luck@intel.com, kuo-lang.tseng@intel.com, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org References: <6c78593207224014d6a9d43698a3d1a0b3ccf2b6.1564504901.git.reinette.chatre@intel.com> <20190802180352.GE30661@zn.tnic> <20190803094423.GA2100@zn.tnic> <122b005a-46b1-2b1e-45a8-7f92a5dba2d9@intel.com> <20190806155716.GE25897@zn.tnic> <151002be-33e6-20d6-7699-bc9be7e51f33@intel.com> <20190806173300.GF25897@zn.tnic> From: Reinette Chatre Message-ID: Date: Tue, 6 Aug 2019 11:13:22 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190806173300.GF25897@zn.tnic> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Borislav, On 8/6/2019 10:33 AM, Borislav Petkov wrote: > On Tue, Aug 06, 2019 at 09:55:56AM -0700, Reinette Chatre wrote: >> I am a bit cautious about this. When I started this work I initially >> added a helper function to resctrl that calls CPUID to determine if the >> cache is inclusive. At that time I became aware of a discussion >> motivating against scattered CPUID calls and motivating for one instance >> of CPUID information: >> http://lkml.kernel.org/r/alpine.DEB.2.21.1906162141301.1760@nanos.tec.linutronix.de > > Ah, there's that. That's still somewhat a work/discussion in progress > thing. Let me discuss it with tglx. > >> To answer your question about checking any cache: this seems to be > > I meant the CPUID on any CPU and thus any cache - i.e., all L3s on the > system should be inclusive and identical in that respect. Can't work > otherwise, I'd strongly presume. This is my understanding, yes. While this patch supports knowing whether each L3 is inclusive or not, I expect this information to be the same for all L3 instances as will be supported by a single query in rdt_pseudo_lock_init(). This definitely is the case on the platforms we are enabling in this round. >> different between L2 and L3. On the Atom systems where L2 pseudo-locking >> works well the L2 cache is not inclusive. We are also working on >> supporting cache pseudo-locking on L3 cache that is not inclusive. > > Hmm, so why are you enforcing the inclusivity now: > > + if (p->r->cache_level == 3 && > + !get_cache_inclusive(plr->cpu, p->r->cache_level)) { > + rdt_last_cmd_puts("L3 cache not inclusive\n"); > > but then will remove this requirement in the future? Why are we even > looking at cache inclusivity then and not make pseudo-locking work > regardless of that cache property? Some platforms being enabled in this round have SKUs with inclusive cache and also SKUs with non-inclusive cache. The non-inclusive cache SKUs do not support cache pseudo-locking and cannot be made to support cache pseudo-locking with software changes. Needing to know if cache is inclusive or not will thus remain a requirement to distinguish between these different SKUs. Supporting cache pseudo-locking on platforms with non inclusive cache will require new hardware features. > Because if we're going to go and model this cache inclusivity property > properly in struct cpuinfo_x86 or struct cacheinfo or wherever, and do > that for all cache levels because apparently we're going to need that; > but then later it turns out we won't need it after all, why are we even > bothering? > > Or am I missing some aspect? Reinette