Received: by 10.223.185.116 with SMTP id b49csp4259139wrg; Mon, 19 Feb 2018 14:20:48 -0800 (PST) X-Google-Smtp-Source: AH8x2270XTojLkAK+v5KaD7FP9b7NSMkEaz4djIVj1KY4FaB3MEhsMSWVsQmQN8GRctAZGx1WqOE X-Received: by 2002:a17:902:5482:: with SMTP id e2-v6mr15368759pli.65.1519078848454; Mon, 19 Feb 2018 14:20:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519078848; cv=none; d=google.com; s=arc-20160816; b=Ko/DwSYLU34V69hiDAWxEE0J7+IXolURs3XO56Wp//H3cl5SERUk3r7qzwwNO5NpKT Cdm8Xuz3JCQlZmC3lMd2s0i+W2O/hJl9OpypQkVWgGPnsh+4r843wTsgsZfD1Wg+1VgR mzt02E3JC1Em6pFshN8iW7Gwz97xt61c33JsSRZmTto+HRXzFuDKaQMTmIhXgkhS6Jjq QGmh+bv4Ch7cID+W0NfVGEAyWDi/GMQkSB8S4JmqKhmemraIWOCOeQkslWZEnf5j479q Lv6bH1MVqTL9YAP1lCzehGP3mbcu7h/gOWFdZzbLc3ebox9T6Lm1BEyMvmt0qRCxj0gA OZ1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=yQDYgdky5Ed69GrYLqD+LqJxixYr6zBpVXzddZqmyWo=; b=lSQ6MeclfmZQO8MT8J8Dd1DLbkfbeTvIYxiE9oUUxq9SjPwIe0LeyzdrOKokPq89qL kHkjIZkPStpVQuNWs9UcLxm4u8vFRVoSnX6h+sMmUqa9qgEOE0W4t5aSVgNKDaq+lzt4 Z1bBnhN316Ymep8Qv05BDFx2qNhM0vGbcKo1QFDLjKZSk/N2I1Fis501+Ur890nANZG/ /V1eHgzfYw3wCJXggZBELjwCOjPaeff9TwdK+Z1ap7vQiCfg/4+NVmN3YzcLMExdDlMr JwipAUujCsjCD7nuBwQtAHeqHUnzrf+pRkIG2nMHRjy+M2H3YlEV6uWJfM1XOBl40yCp Iwhg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q24si12502121pff.249.2018.02.19.14.20.33; Mon, 19 Feb 2018 14:20:48 -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; 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 S932187AbeBSWTz (ORCPT + 99 others); Mon, 19 Feb 2018 17:19:55 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:60310 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932116AbeBSWTy (ORCPT ); Mon, 19 Feb 2018 17:19:54 -0500 Received: from [37.81.189.72] by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1entjS-0004v0-Tu; Mon, 19 Feb 2018 23:16:23 +0100 Date: Mon, 19 Feb 2018 23:19:56 +0100 (CET) From: Thomas Gleixner To: Reinette Chatre cc: fenghua.yu@intel.com, tony.luck@intel.com, 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 Subject: Re: [RFC PATCH V2 01/22] x86/intel_rdt: Documentation for Cache Pseudo-Locking In-Reply-To: Message-ID: References: <9416db57e47e2040a7108ba269f5432d0c91f1f7.1518443616.git.reinette.chatre@intel.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-2060607947-1519078798=:1853" X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-2060607947-1519078798=:1853 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT On Mon, 19 Feb 2018, Reinette Chatre wrote: > Hi Thomas, > > On 2/19/2018 12:35 PM, Thomas Gleixner wrote: > > On Tue, 13 Feb 2018, Reinette Chatre wrote: > >> +Cache Pseudo-Locking > >> +-------------------- > >> +CAT enables a user to specify the amount of cache space into which 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. > > > > This lacks explanation how that preloading works. > > Following this text you quote there is a brief explanation starting with > "Pseudo-locking is accomplished in two stages:" - I'll add more details > to that area. > > > > >> 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. > > > > Well, you only enforce in pseudo_lock_dev_mmap() that the caller is affine > > to the right CPUs. But that's not a guarantee that the task stays there. > > It is required that the user space application self sets affinity to > cores associated with the cache. This is also highlighted in the example > application code (later in this patch) within the comments as well as > the example usage of sched_setaffinity(). The enforcement done in the > kernel code is done as a check that the user space application did so, > no the actual affinity management. Right, but your documentation claims it's enforced. There is no enforcement aside of the initial sanity check. Thanks, tglx --8323329-2060607947-1519078798=:1853--