mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Reinette Chatre <reinette.chatre@intel.com>
To: "Moger, Babu" <bmoger@amd.com>, <babu.moger@amd.com>,
	<tglx@linutronix.de>, <mingo@redhat.com>, <bp@alien8.de>,
	<dave.hansen@linux.intel.com>
Cc: <x86@kernel.org>, <hpa@zytor.com>, <akpm@linux-foundation.org>,
	<paulmck@kernel.org>, <thuth@redhat.com>, <rostedt@goodmis.org>,
	<xiongwei.song@windriver.com>,
	<pawan.kumar.gupta@linux.intel.com>, <jpoimboe@kernel.org>,
	<daniel.sneddon@linux.intel.com>, <thomas.lendacky@amd.com>,
	<perry.yuan@amd.com>, <sandipan.das@amd.com>,
	<kai.huang@intel.com>, <seanjc@google.com>, <xin3.li@intel.com>,
	<ebiggers@google.com>, <andrew.cooper3@citrix.com>,
	<mario.limonciello@amd.com>, <tan.shaopeng@fujitsu.com>,
	<james.morse@arm.com>, <tony.luck@intel.com>,
	<peternewman@google.com>, <linux-doc@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <eranian@google.com>,
	<corbet@lwn.net>
Subject: Re: [PATCH v3 0/7] Support L3 Smart Data Cache Injection Allocation Enforcement (SDCIAE)
Date: Wed, 9 Apr 2025 20:59:29 -0700	[thread overview]
Message-ID: <a546a42f-206e-4a0a-9e3b-0d4ac472729f@intel.com> (raw)
In-Reply-To: <f16697d8-be6b-4dd2-b0dc-3c628fc4eec6@amd.com>

Hi Babu,

On 4/9/25 5:58 PM, Moger, Babu wrote:
> Hi Reinette,
> 
> On 4/8/2025 8:41 PM, Reinette Chatre wrote:
>> Hi Babu,
>>
>> On 4/8/25 5:41 PM, Moger, Babu wrote:
>>> Hi Reinette,
>>>
>>> On 4/8/2025 4:44 PM, Reinette Chatre wrote:
>>>> Hi Babu,
>>>>
>>>> On 4/7/25 1:12 PM, Moger, Babu wrote:
>>>>> On 3/21/25 17:50, Reinette Chatre wrote:
>>>>>> On 1/30/25 1:20 PM, Babu Moger wrote:
>>>>
>>>>
>>>>>>>
>>>>>>
>>>>>> AMD also supports what is exposed to user space as "shareable_bits". According
>>>>>> to APM:
>>>>>>      Depending on the implementation, some portions of the L3 Cache may be
>>>>>>      shared by other system functions or used for some other purpose not
>>>>>>      under the control of the PQOS feature set. The L3 Cache Allocation
>>>>>>      Sharing Mask returned by CPUID Fn0000_0010_EBX_x1[L3ShareAllocMask] is a
>>>>>>      bitmask that represents portions of the L3 that may be shared by those
>>>>>>      functions.
>>>>>
>>>>> Here is the complete text.
>>>>>
>>>>> The L3 Cache allocation sharing mask (L3ShareAllocMask) returned in EBX by
>>>>> CPUID Fn0000_0010 with ECX=1 is a bit vector which represents portions of
>>>>> the cache which may be shared with other system entities or used for some
>>>>> other purpose not under the control of the QOS feature set. When software
>>>>> sets a bit in one of the L3_MASK_n registers at the same bit positions a
>>>>> bit in the L3ShareAllocMask, processors executing with the corresponding
>>>>> COS will competitively share that portion of the cache with the other
>>>>> function. If this mask is all 0’s, then there is no other entity in the
>>>>> system competing with the processors for use of the L3 cache.
>>>>>
>>>>> The "L3ShareAllocMask" is always reported as 0 on AMD systems.
>>>>>
>>>>>> Could you please include what (if any) the relationship is between the CBM
>>>>>> discoverable via Fn0000_0010_EBX_x1[L3ShareAllocMask] and the CBM of
>>>>>> "highest-supported L3_MASK_n register" when SDCIAE is enabled?
>>>>>
>>>>> No. There is no relationship in here.
>>>>>
>>>>>>
>>>>>> On the resctrl interface side the documentation currently states:
>>>>>>
>>>>>>      "shareable_bits":
>>>>>>          Bitmask of shareable resource with other executing
>>>>>>          entities (e.g. I/O). User can use this when
>>>>>>          setting up exclusive cache partitions. Note that
>>>>>>          some platforms support devices that have their
>>>>>>          own settings for cache use which can over-ride
>>>>>>          these bits.
>>>>>>
>>>>>> Even though this was originally used to expose the content of
>>>>>> Fn0000_0010_EBX_x1[L3ShareAllocMask] the intent of the content does
>>>>>> seem to also apply to the "io_alloc" CBM also.
>>>>>
>>>>> It says "shared by other system functions or used for some other purpose
>>>>> not under the control of the PQOS feature set".
>>>>
>>>> This is a quote from the AMD spec, not the resctrl user interface documentation.
>>>>
>>>> Please consider this from resctrl user interface perspective.
>>>>
>>>>>
>>>>> "io_alloc" is PQOS feature set. I feel it should not affect "shareable_bits".
>>>>
>>>> When I read the resctrl user interface documentation for "shareable_bits" it
>>>> sounds relevant to io_alloc. The "shareable_bits" contains a bitmask "of
>>>> shareable resource with other executing entities (e.g. I/O)" ... is this
>>>> not exactly io_alloc?
>>>
>>> I agree the text is pretty generic. Actually, the whole bit mask (0xfffF) is shareable with io_alloc.
>>
>> I think the value of "shareable_bits" presented to user space could be the
>> actual io_alloc_cbm value. Thus, not the "possible IO bitmask" but the actual
> 
> Confused little bit here. The shareable_bits is resource property.
> io_alloc_cbm is domain specific value. Not sure how to display it.

ah, right. We should still aim to not let the new "io_alloc" interfaces cause
confusion with the existing "shareable_bits" that is already part of interface and
used to communicate IO allocation to user space. Perhaps we are just left with
needing a modification to the existing documentation surrounding "shareable_bits"?

> 
>> value. This seems to be the best match of what "shareable_bits" represents, which
>> is the region currently used by IO devices. This partners well with the "bit_usage"
>> output, for example, "X" can be used to show which portions of cache are currently
>> used by both software (via schemata of resource groups) and hardware (via io_alloc_cbm).
> 
> Haven't looked at this code much. Will look into it.

Thank you. This is per domain so should be a good fit ... but again the documentation
creates strong connection with "shareable_bits" that should be reworked.

Reinette

  reply	other threads:[~2025-04-10  4:00 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-30 21:20 Babu Moger
2025-01-30 21:20 ` [PATCH v3 1/7] x86/cpufeatures: Add support for L3 Smart Data Cache Injection Allocation Enforcement Babu Moger
2025-01-30 21:20 ` [PATCH v3 2/7] x86/resctrl: Add SDCIAE feature in the command line options Babu Moger
2025-01-30 21:20 ` [PATCH v3 3/7] x86/resctrl: Detect io_alloc feature Babu Moger
2025-03-21 22:51   ` Reinette Chatre
2025-04-07 20:13     ` Moger, Babu
2025-01-30 21:20 ` [PATCH v3 4/7] x86/resctrl: Implement "io_alloc" enable/disable handlers Babu Moger
2025-03-21 22:53   ` Reinette Chatre
2025-04-07 20:14     ` Moger, Babu
2025-01-30 21:20 ` [PATCH v3 5/7] x86/resctrl: Add interface to enable/disable io_alloc feature Babu Moger
2025-03-21 22:58   ` Reinette Chatre
2025-04-07 20:17     ` Moger, Babu
2025-01-30 21:20 ` [PATCH v3 6/7] x86/resctrl: Introduce interface to display io_alloc CBMs Babu Moger
2025-03-21 22:58   ` Reinette Chatre
2025-04-07 20:18     ` Moger, Babu
2025-01-30 21:20 ` [PATCH v3 7/7] x86/resctrl: Introduce interface to modify io_alloc Capacity Bit Masks Babu Moger
2025-03-21 23:00   ` Reinette Chatre
2025-04-07 20:19     ` Moger, Babu
2025-03-21 22:50 ` [PATCH v3 0/7] Support L3 Smart Data Cache Injection Allocation Enforcement (SDCIAE) Reinette Chatre
2025-04-07 20:12   ` Moger, Babu
2025-04-08 21:44     ` Reinette Chatre
2025-04-09  0:41       ` Moger, Babu
2025-04-09  1:41         ` Reinette Chatre
2025-04-10  0:58           ` Moger, Babu
2025-04-10  3:59             ` Reinette Chatre [this message]
2025-04-10 22:29               ` Moger, Babu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a546a42f-206e-4a0a-9e3b-0d4ac472729f@intel.com \
    --to=reinette.chatre@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=babu.moger@amd.com \
    --cc=bmoger@amd.com \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=daniel.sneddon@linux.intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=ebiggers@google.com \
    --cc=eranian@google.com \
    --cc=hpa@zytor.com \
    --cc=james.morse@arm.com \
    --cc=jpoimboe@kernel.org \
    --cc=kai.huang@intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@amd.com \
    --cc=mingo@redhat.com \
    --cc=paulmck@kernel.org \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=perry.yuan@amd.com \
    --cc=peternewman@google.com \
    --cc=rostedt@goodmis.org \
    --cc=sandipan.das@amd.com \
    --cc=seanjc@google.com \
    --cc=tan.shaopeng@fujitsu.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=thuth@redhat.com \
    --cc=tony.luck@intel.com \
    --cc=x86@kernel.org \
    --cc=xin3.li@intel.com \
    --cc=xiongwei.song@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®