From: "Moger, Babu" <bmoger@amd.com>
To: "Luck, Tony" <tony.luck@intel.com>, Babu Moger <babu.moger@amd.com>
Cc: corbet@lwn.net, reinette.chatre@intel.com, Dave.Martin@arm.com,
james.morse@arm.com, tglx@linutronix.de, mingo@redhat.com,
bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org,
hpa@zytor.com, akpm@linux-foundation.org, rostedt@goodmis.org,
paulmck@kernel.org, thuth@redhat.com, ardb@kernel.org,
gregkh@linuxfoundation.org, thomas.lendacky@amd.com,
seanjc@google.com, mario.limonciello@amd.com, perry.yuan@amd.com,
kai.huang@intel.com, xiaoyao.li@intel.com, nikunj@amd.com,
kan.liang@linux.intel.com, xin3.li@intel.com,
andrew.cooper3@citrix.com, ebiggers@google.com, xin@zytor.com,
sohil.mehta@intel.com, Xiaojian.Du@amd.com,
gautham.shenoy@amd.com, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v5 5/8] x86/resctrl: Add user interface to enable/disable io_alloc feature
Date: Thu, 22 May 2025 18:12:21 -0500 [thread overview]
Message-ID: <e768535e-444d-4fa8-bfe2-f8e8c0b1d4bc@amd.com> (raw)
In-Reply-To: <aC-JAdEYyhshVIQA@agluck-desk3>
Hi Tony,
On 5/22/2025 3:28 PM, Luck, Tony wrote:
> On Thu, May 22, 2025 at 02:51:36PM -0500, Babu Moger wrote:
>>
>> +/*
>> + * resctrl_io_alloc_closid_get - io_alloc feature uses max CLOSID to route
>> + * the IO traffic. Get the max CLOSID and verify if the CLOSID is available.
>> + *
>> + * The total number of CLOSIDs is determined in closid_init(), based on the
>> + * minimum supported across all resources. If CDP (Code Data Prioritization)
>> + * is enabled, the number of CLOSIDs is halved. The final value is returned
>> + * by closids_supported(). Make sure this value aligns with the maximum
>> + * CLOSID supported by the respective resource.
>> + */
>> +static int resctrl_io_alloc_closid_get(struct rdt_resource *r)
>> +{
>> + int num_closids = closids_supported();
>> +
>> + if (resctrl_arch_get_cdp_enabled(r->rid))
>> + num_closids *= 2;
>> +
>> + if (num_closids != resctrl_arch_get_num_closid(r))
>> + return -ENOSPC;
>> +
>> + return closids_supported() - 1;
>> +}
>
> Is using closids_supported() the right thing here? That's
> the minimum value across all resources. So suppose you had
> 16 CLOS for the L3 resource, but only 8 CLOS in one of L2/MB/SMBA.
>
> I'd assume the your h/w doesn't care that Linux chose to
> ignore half of the available L3 CLOSIDs, and is still going
> to use CLOSID==15 for SDCIA.
>
> I think you'll take the -ENOSPC error return. But do you
> really need to do that? Maybe you can still have SDCIA
> enabled and using CLOSID 15?
We cannot support more than closids_supported(), as the bitmaps are not
initialized beyond that point, and other routines are also not designed
to handle more than closid_free_map_len.
While it's technically possible to implement a workaround for this
special case, it would be a hacky solution. It's likely unnecessary to
go down that path.
Thanks
Babu
next prev parent reply other threads:[~2025-05-22 23:12 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-22 19:51 [PATCH v5 0/8] x86/resctrl: Support L3 Smart Data Cache Injection Allocation Enforcement (SDCIAE) Babu Moger
2025-05-22 19:51 ` [PATCH v5 1/8] x86/cpufeatures: Add support for L3 Smart Data Cache Injection Allocation Enforcement Babu Moger
2025-05-22 19:51 ` [PATCH v5 2/8] x86/resctrl: Add SDCIAE feature in the command line options Babu Moger
2025-05-22 19:51 ` [PATCH v5 3/8] x86/resctrl: Detect io_alloc feature Babu Moger
2025-05-22 19:51 ` [PATCH v5 4/8] x86/resctrl: Implement "io_alloc" enable/disable handlers Babu Moger
2025-05-22 19:51 ` [PATCH v5 5/8] x86/resctrl: Add user interface to enable/disable io_alloc feature Babu Moger
2025-05-22 20:28 ` Luck, Tony
2025-05-22 23:12 ` Moger, Babu [this message]
2025-05-22 23:24 ` Luck, Tony
2025-05-22 19:51 ` [PATCH v5 6/8] x86/resctrl: Introduce interface to display io_alloc CBMs Babu Moger
2025-05-22 19:51 ` [PATCH v5 7/8] x86/resctrl: Modify rdt_parse_data to pass mode and CLOSID Babu Moger
2025-05-22 19:51 ` [PATCH v5 8/8] x86/resctrl: Introduce interface to modify io_alloc Capacity Bit Masks Babu Moger
2025-05-22 19:59 ` [PATCH v5 0/8] x86/resctrl: Support L3 Smart Data Cache Injection Allocation Enforcement (SDCIAE) 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=e768535e-444d-4fa8-bfe2-f8e8c0b1d4bc@amd.com \
--to=bmoger@amd.com \
--cc=Dave.Martin@arm.com \
--cc=Xiaojian.Du@amd.com \
--cc=akpm@linux-foundation.org \
--cc=andrew.cooper3@citrix.com \
--cc=ardb@kernel.org \
--cc=babu.moger@amd.com \
--cc=bp@alien8.de \
--cc=corbet@lwn.net \
--cc=dave.hansen@linux.intel.com \
--cc=ebiggers@google.com \
--cc=gautham.shenoy@amd.com \
--cc=gregkh@linuxfoundation.org \
--cc=hpa@zytor.com \
--cc=james.morse@arm.com \
--cc=kai.huang@intel.com \
--cc=kan.liang@linux.intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mario.limonciello@amd.com \
--cc=mingo@redhat.com \
--cc=nikunj@amd.com \
--cc=paulmck@kernel.org \
--cc=perry.yuan@amd.com \
--cc=reinette.chatre@intel.com \
--cc=rostedt@goodmis.org \
--cc=seanjc@google.com \
--cc=sohil.mehta@intel.com \
--cc=tglx@linutronix.de \
--cc=thomas.lendacky@amd.com \
--cc=thuth@redhat.com \
--cc=tony.luck@intel.com \
--cc=x86@kernel.org \
--cc=xiaoyao.li@intel.com \
--cc=xin3.li@intel.com \
--cc=xin@zytor.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