From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796042230; b=XaRt9HP/s5DttuxJRFOO9dg2LYtAmok5g2eJaLrJbObgF8t5u87HYgZIlBUKUQ1oqNZY euqz5fYYzGfBKLxRICvMwckz5q0j2BJwx7Dxg8aQHag7Ae4OOK437Uwi/WfuLTmuaF3ry LxsyKyETmlAYnkQ7/u3BTIhrsNUeRallEjDWBI82DX75jTt8vLpYjN5AFmPJDgE3SKWZ5 rGctxA4XYuM4SKZDo6m5Egeogjqrxc245PrnYPjzgX0A6uAIGTUiX7jJbBTeqJdQbXyi1 HojbOvKY/NUAynkc+U1L/tTCKKrwawF2g7OO3fEqY1RuSZVzCQHNm+KcT7buScPR+6w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796042230; h=DMARC-Filter:Received:Received:DKIM-Signature:Message-ID:Date: MIME-Version:User-Agent:Subject:To:Cc:References:Content-Language: From:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=PyqAPm/g2QHQ3Cyu+JxXhFDrdizu8aNd+F5D8uAc604=; b=5VwqlIZdkLFopsj+biKJfXaOwe5u6VYqm90QeBUUra8SwQsBI73aeEHHn/L30cBahAPu brqMoMck49g9lfEUg3oTS6Njr2oaUNZ5LVTE6xYObToS5utJ/KSR8hnVwObDST9zY+e4F DnNwMSfMUc9S0oiMX43nGZbom2+orpLnRNQ0HQAUx8yMlK1BgubbMJp+jhP94xkhmKcip QuZ9pHP1Rznu5a2RnMCiV/w/R3J/Q+0U8wLnAIwKJ/10qyvJ1shIdSRn60VBdOBywWqLq i0HBl9djO3/z6uRfy5WqpRfdk8v6H6zsAP4dnGaDFPhr0EkA+cIz8dTdxfsbEwhDkRw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=arm.com; spf=pass smtp.mailfrom=arm.com; dkim=pass header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=HGL1BNH0; arc=none smtp.remote-ip=217.140.110.172 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CFF19606A31C for ; Mon, 30 Nov 2026 12:37:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CFF19606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=arm.com header.i=@arm.com header.a=rsa-sha256 header.s=foss header.b=HGL1BNH0 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2DAEC152B; Mon, 30 Nov 2026 04:37:06 -0800 (PST) Received: from [10.2.212.8] (e134344.arm.com [10.2.212.8]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 299603F7D8; Mon, 30 Nov 2026 04:37:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arm.com; s=foss; t=1796042229; bh=L9tAtROYSTJjZvhxUIC62hG0d3gQrP8QYggugsGhy0Q=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=HGL1BNH0Kj31JLc7DbwLaPsyquF+d6ujXfSgUzvk1OPX7rLY5SxDgJ7TjXjI4DPQV A8dN0wO8X73EfWGH1+P/mChAQR7h6neU94yr7qEPSingbrRuU4ZXD/9bPCgz8cPa/h pxBBOxxGfsKKEbfIJhA7cCKN/O4N5k44gJipZzmg= Message-ID: Date: Mon, 30 Nov 2026 12:37:04 +0000 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC v3] arm,x86,fs/resctrl: Generic schema description Proof of Concept To: Reinette Chatre , Tony Luck , James Morse , Dave Martin , Babu Moger , Drew Fustini , Fenghua Yu , Chen Yu , Jinjie Ruan Cc: Borislav Petkov , Thomas Gleixner , Dave Hansen , Peter Newman , "x86@kernel.org" , "linux-kernel@vger.kernel.org" References: Content-Language: en-US From: Ben Horgan In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi Reinette, I still need to go through this in detail. I compiled and booted a model and didn't spot any problems. I've replied to your questions below and added a comment on the control relationships. On 20/11/2026 05:04, Reinette Chatre wrote: > Hi Everybody, > > I believe that discussions around resctrl's upcoming support for multiple > controls are starting to settle. This RFC aims to capture all the remaining > items in implementation as well as documentation. Please point out to me if > there is anything I missed. > > RFC v3 of this PoC can be found at: > git://git.kernel.org/pub/scm/linux/kernel/git/reinette/linux.git branch resctrl/controls_rfc_v3 > > Please refer to the documentation patch for an overview of the planned interface > changes as well as user space contracts/expectations: > > https://git.kernel.org/pub/scm/linux/kernel/git/reinette/linux.git/commit/?h=resctrl/controls_rfc_v3&id=95ff9ff7430095cb7264946c944c750315db73d9 > > Remaining opens: > --------------- > - Ben: I do have a question about the formula used to determine the size of > a scalar cache control. Please see patch changelog of: > https://git.kernel.org/pub/scm/linux/kernel/git/reinette/linux.git/commit/?h=resctrl/controls_rfc_v3&id=8695aab0997d5aa60e104374fae9701f51156c18 Questions for Ben: [Copied from patch] - The scalar size calculation divides by resolution before multiplying by scale and the control value, so precision is lost when resolution does not divide the cache size evenly. Is that intended? No, just a mistake. - What does "scale" represent for a cache control? Hmmm, my patch only really works if it's 1 which obviously isn't the most helpful thing. The scalar cache controls that I have been considering are CMAX and CMIN. These are programmed with a proportion of the cache. 'scale' needs to keep a consistent meaning. And the 'size' of the control should be the same as for any other scalar, that is '(ctrl_val * scale)' units. If we have non-proportional unit, e.g. bytes, the architecture should fill in the scale based on the cache size and not leave this up to resctrl. In that way the same helper could be used for the size of all scalars if we can make sure the units are correct. Although, we are now back to the same loss of precision problem. If we have the special proportional unit, RESCTRL_CTRL_UNIT_ALL, then scale can always be 1 and then resctrl can calculate the size based on the resolution and cache size. The loss of precision can be avoided here and looks to be the best option, at least, for the MPAM controls. Here we could use: size = (ctrl * cache_size) / resolution Does that make sense? > - MPAM only compile tested. > - The same x86 "SAMPLE" code as RFC v2 to demonstrate emulated controls. > - Add relationships between controls. For example, cannot set "MIN" control > value to be larger than "MAX. Unclear how to do this in resctrl fs when > considering that the relationship may span between emulated and backing > controls. This is potentially something that needs to be managed by architecture > and thus potentially without a consistent failure to user space. The MPAM hardware configuration is still well-defined if MIN is greater than MAX. However, if MIN is greater than MAX then only the MIN is relevant and so we don't gain any extra configurations. Hence, from an MPAM point of view, the controls relationships aren't necessary but if they are there they don't cause a problem. Thanks, Ben > > Changes since RFC v2: > -------------------- > RFC v2: https://lore.kernel.org/lkml/d258a32f-12d5-464d-abe9-4720fb3e44b3@intel.com/ > git://git.kernel.org/pub/scm/linux/kernel/git/reinette/linux.git branch resctrl/controls_rfc_v2 > > User visible changes: > - Make scope a property of the control again, now in addition to a separate > allocation scope of the resource. Expose the control scope via a new > per-control "scope" file (L2, L3, or NODE) that tells user space what a > domain ID in the schemata file represents. Needed to support AMD's GLBE > and CPU-less memory bandwidth allocation. (Ben and Babu) > - Name controls according to the scheme agreed during RFC v2 discussions: > __, with the control > scope dropped when it matches the resource scope. MB and SMBA carry their > L3 scope only implicitly, so their new controls show it explicitly, for > example MB_L3_MAX, or MB_L3NODE for a default control at NODE scope. > https://lore.kernel.org/all/bccb1249-e722-451a-9c75-8aa846713045@intel.com/ > - Report "max" per domain in preparation for systems with resource > instances of different capacity. A bitmap's "max" no longer has a "0x" > prefix. (Drew and Tony) > - Drop the "min_bits" file. The "min" file of a bitmap control now reports > the minimum number of consecutive bits. > - Only offer, and only allow switching to, "native" control mode when the > resource has emulated controls. (Ben) > - Only allow cache pseudo-locking via the default cache control. > - Display the "size" of scalar cache controls. (Ben) > - Stop reporting scalar control parsing errors as being about "MB". (Ben) > - Document the control naming, the "scope" file, that control values may be > reset on a control mode switch, that legacy info files return no content > in "native" mode, and that non-legacy resources need not have a default > control. > > Other changes: > - Require a control and the controls it is emulated by to have the same > scope. > - Require only legacy resources to start in legacy control mode. > - Generate control schema suffix once during initialization. > - Fix initialization of the list of emulating controls (Ben), clearing of > staged configurations of backing controls (Chenyu), and Haswell control > initialization (Chenyu). > - Reword changelogs about CDP, allocation size and the bitmap control so > they no longer suggest resctrl will only ever support one cache control. > - Fix checkpatch.pl issues, subject prefixes and changelog typos. > > Series structure: > - Rebase on: > - x86/cache branch of tip that is based on v7.4-rc1 with the queued > resctrl cleanups > - MPAM domain separation that was extracted from RFC v2 and submitted > separately: > https://lore.kernel.org/lkml/cover.1794283825.git.reinette.chatre@intel.com/ > - Squash four patches into the patches they support: > - "fs/resctrl: Provide control to cache allocation" > - "x86,fs/rectrl: Provide control when requesting arch to update a single > domain", which also keeps MPAM building at every patch in the series. > - "fs/resctrl: Expose bitmap properties via new files in schemata folder" > - "fs/resctrl: Include emulated controls when determining control field > width" > - New patch from Ben: "fs/resctrl: Display size for scalar cache controls". > - Move IO allocation control selection, and the helpers that display the > new control properties, earlier in the series. > > Any feedback is appreciated. > > Reinette