[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aC-JAdEYyhshVIQA@agluck-desk3>
Date: Thu, 22 May 2025 13:28:49 -0700
From: "Luck, Tony" <tony.luck@...el.com>
To: Babu Moger <babu.moger@....com>
Cc: corbet@....net, reinette.chatre@...el.com, Dave.Martin@....com,
james.morse@....com, tglx@...utronix.de, mingo@...hat.com,
bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org,
hpa@...or.com, akpm@...ux-foundation.org, rostedt@...dmis.org,
paulmck@...nel.org, thuth@...hat.com, ardb@...nel.org,
gregkh@...uxfoundation.org, thomas.lendacky@....com,
seanjc@...gle.com, mario.limonciello@....com, perry.yuan@....com,
kai.huang@...el.com, xiaoyao.li@...el.com, nikunj@....com,
kan.liang@...ux.intel.com, xin3.li@...el.com,
andrew.cooper3@...rix.com, ebiggers@...gle.com, xin@...or.com,
sohil.mehta@...el.com, Xiaojian.Du@....com, gautham.shenoy@....com,
linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v5 5/8] x86/resctrl: Add user interface to enable/disable
io_alloc feature
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?
-Tony
Powered by blists - more mailing lists