Received: by 10.223.185.116 with SMTP id b49csp4218560wrg; Mon, 19 Feb 2018 13:28:31 -0800 (PST) X-Google-Smtp-Source: AH8x227kpdaII1S/armfmHt9p33ZFHq+A7B78CPaOg+yIgmeFrk7turiRhHRLQfQbxylReaeOyOg X-Received: by 10.98.67.157 with SMTP id l29mr15800779pfi.214.1519075711385; Mon, 19 Feb 2018 13:28:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519075711; cv=none; d=google.com; s=arc-20160816; b=DJNREH8OHqA8xjLuGM0HHfJ0t62kwpIS3ljsPNbeou71GhbFpqaGRdkplwzCLHcort x3J2ndfAiH1bQh0pbygdYIRgyAojb3Iu+dwYVb94tZgxJUhrGYnKQRaW8aLnvkfsryFk uWnLz2/6L2bCzLfkznH0I03sBAhIev3eNrRNgsmuGrsy77F7mZX3etI9kthIeyGYEOHy VlDs0If/KEQFOaiNbw1DK9Ojit43twWXuTvMTWXcZoh0SW1FOTeCA5Rgw9835Dk/7FiV CnZPE2xJc8mffcdgrUuHQNKuK5kW3M56TvF1yrg3GXOQjZxo/5ZAmUQ4krCl0K7lDqOd LFKQ== 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:dkim-signature :arc-authentication-results; bh=9eIURwfEPg0QTUNdcNrI/NztkphXqQFGr0cg+BzZWSw=; b=a0g8CWWeIe7wfPS1YGlFTvawioWtU9pcOTjICb+wsPrQpLTgNUBPjLc/amfArLUdR4 1LynYATFTBD8XM/VlSjjU8etJZi6A4pPn7aNfvfJH8lqgXQSntPYbg30CI17Dw5HHLXl SRE9amVUhCc+hTvAuXCrjGdi524C94eSVl+GE0JsTyTokclJhDvMsjFBh7PTYB6XnEam WLNcya/uHcVaQfFI+KVsrOtFGbBN6rJTYOL9okBPR+msxmBBmSHjOtNtnrOEsgp+MUqQ dH+RAvkSXlv5srdX46GN9cwlAa92aSEKEzvOKIWv50lwas4P+o5CFCiqukfNR9m1hCO9 4QgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=jFhyltnq; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j7si1489920pgs.192.2018.02.19.13.28.15; Mon, 19 Feb 2018 13:28:31 -0800 (PST) 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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=jFhyltnq; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753744AbeBSV1h (ORCPT + 99 others); Mon, 19 Feb 2018 16:27:37 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:53202 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753632AbeBSV1g (ORCPT ); Mon, 19 Feb 2018 16:27:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To: Subject:Sender:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=9eIURwfEPg0QTUNdcNrI/NztkphXqQFGr0cg+BzZWSw=; b=jFhyltnqCWg1AJTpT7sY9oXa2 pFiu+sYDYKNUJs57aaf/BACEjnTJdY3Da/K2kilsnTUsWqvdJLytOMFXOonJXhx0qqnjbYJN9DcWn EZdrUjrjY0qq7BVdbsAlU8e/lqvBhW7NIkGUzB6jkS8khnimcPdHBERdUyL5z7I8bUY4DWCB/q0R1 PAoqW9lJrElzCSV3NhkCb3wKe663UTiM/kSWJRKIa9vqOaKotKCWePiJTWIqRSNgYYAyuIAHfLJXx D6xAXKf0vNnXAIJcn32AijFb7t5iyjnzSZGA85z2R6ktVDnHL2Yb0wzwf7K1Pdl7K2UMl/Sn4+5n4 TjZN/2T0Q==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=midway.dunlab) by bombadil.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1ensyD-0007YE-T8; Mon, 19 Feb 2018 21:27:33 +0000 Subject: Re: [RFC PATCH V2 01/22] x86/intel_rdt: Documentation for Cache Pseudo-Locking To: Reinette Chatre , tglx@linutronix.de, fenghua.yu@intel.com, tony.luck@intel.com Cc: gavin.hindman@intel.com, vikas.shivappa@linux.intel.com, dave.hansen@intel.com, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org References: <9416db57e47e2040a7108ba269f5432d0c91f1f7.1518443616.git.reinette.chatre@intel.com> From: Randy Dunlap Message-ID: Date: Mon, 19 Feb 2018 13:27:33 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <9416db57e47e2040a7108ba269f5432d0c91f1f7.1518443616.git.reinette.chatre@intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/13/18 07:46, Reinette Chatre wrote: > Add description of Cache Pseudo-Locking feature, its interface, > as well as an example of its usage. > > Signed-off-by: Reinette Chatre > --- > Documentation/x86/intel_rdt_ui.txt | 229 ++++++++++++++++++++++++++++++++++++- > 1 file changed, 228 insertions(+), 1 deletion(-) > > diff --git a/Documentation/x86/intel_rdt_ui.txt b/Documentation/x86/intel_rdt_ui.txt > index 756fd76b78a6..bb3d6fe0a3e4 100644 > --- a/Documentation/x86/intel_rdt_ui.txt > +++ b/Documentation/x86/intel_rdt_ui.txt > @@ -329,6 +332,149 @@ L3CODE:0=fffff;1=fffff;2=fffff;3=fffff > L3DATA:0=fffff;1=fffff;2=3c0;3=fffff > L3CODE:0=fffff;1=fffff;2=fffff;3=fffff > > +Cache Pseudo-Locking > +-------------------- > +CAT enables a user to specify the amount of cache space into which an space that an > +application can fill. Cache pseudo-locking builds on the fact that a > +CPU can still read and write data pre-allocated outside its current > +allocated area on a cache hit. With cache pseudo-locking, data can be > +preloaded into a reserved portion of cache that no application can > +fill, and from that point on will only serve cache hits. The cache > +pseudo-locked memory is made accessible to user space where an > +application can map it into its virtual address space and thus have > +a region of memory with reduced average read latency. > + > +Cache pseudo-locking increases the probability that data will remain > +in the cache via carefully configuring the CAT feature and controlling > +application behavior. There is no guarantee that data is placed in > +cache. Instructions like INVD, WBINVD, CLFLUSH, etc. can still evict > +“locked” data from cache. Power management C-states may shrink or > +power off cache. It is thus recommended to limit the processor maximum > +C-state, for example, by setting the processor.max_cstate kernel parameter. > + > +It is required that an application using a pseudo-locked region runs > +with affinity to the cores (or a subset of the cores) associated > +with the cache on which the pseudo-locked region resides. This is > +enforced by the implementation. > + > +Pseudo-locking is accomplished in two stages: > +1) During the first stage the system administrator allocates a portion > + of cache that should be dedicated to pseudo-locking. At this time an > + equivalent portion of memory is allocated, loaded into allocated > + cache portion, and exposed as a character device. > +2) During the second stage a user-space application maps (mmap()) the > + pseudo-locked memory into its address space. > + > +Cache Pseudo-Locking Interface > +------------------------------ > +Platforms supporting cache pseudo-locking will expose a new > +"/sys/fs/restrl/pseudo_lock" directory after successful mount of the > +resctrl filesystem. Initially this directory will contain a single file, > +"avail" that contains the schemata, one line per resource, of cache region > +available for pseudo-locking. uh, sysfs is supposed to be one value per file. > +A pseudo-locked region is created by creating a new directory within > +/sys/fs/resctrl/pseudo_lock. On success two new files will appear in > +the directory: > + > +"schemata": > + Shows the schemata representing the pseudo-locked cache region. > + User writes schemata of requested locked area to file. use complete sentences, please. E.g.: The user writes the schemata of the requested locked area to the file. > + Only one id of single resource accepted - can only lock from of a single resource is accepted - > + single cache instance. Writing of schemata to this file will > + return success on successful pseudo-locked region setup. > +"size": > + After successful pseudo-locked region setup this read-only file > + will contain the size in bytes of pseudo-locked region. -- ~Randy