— Add return value descriptions to several internal functions, addressing

kernel-doc complaints
 
 — Add the x86 maintainer mailing list to the resctrl section so they are
   automatically included in patch submissions, and reference the applicable
   contribution rules document
 
 — Allow users to apply a single Capacity Bitmask to all cache domains at once
   using '*' as a shorthand, instead of having to specify each domain
   individually. This is particularly user-friendly on high core-count systems
   with many cache clusters
 
 - When a user provides a non-existent domain ID while configuring cache
   allocation, ensure the failure reason is properly reported to the user
   rather than silently returning an error with a misleading "ok" status
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEzv7L6UO9uDPlPSfHEsHwGGHeVUoFAmndMwUACgkQEsHwGGHe
 VUpLVBAArlHpgeu4ZZObHirDCbZRfUgl2xgztcO54jzO2C3nTHfLAm0YKEs0AVok
 +q4rXo8UDLW7cnADtfyzvQnDfK5jNl0Atfq6IZZivTiZeJaQNJyCzJO8MRWGy1Ln
 QCJT3n0gw6rvm1K6Q07ASlo3R+Zg6z+wviB6nZsO278wWAvbBiPFS9u/iL0OysmY
 au104EcupeiI+YQ3LMmWAUPJrzJq6HzXZFMtGYR+n14R5SgdGc2u7oyzWshJDZF+
 kIpWkmoPp2V9C7XkzfX+ItTcEjQWeMBZetKVCd764g67YRIrlsLy64hnBKplEUag
 nFCF9IXoFMqqWBnIU7SulG5I7eMpMG00tj0/G0QnVThOAJ2kER+Dyv6yCazsObdj
 GRzB35xO7fp2Aa+36Yi7HQJmTS8ugXbbEtZwQ6qlGrZBSn1vebekNOnhHPbTRxJV
 nef0rj1gnZW9ZOUX8/gaih8YJSssjCl5aw0L3mu8tA+lcMP0UZu9dLvbf1Mp/Gvr
 CZeTezvhJr6OaR76YBJCJvFT4qlDZscaCu9SeW1Tz73VVIe4Fl4Rl+bGovPuSgPo
 15SGwoBPnzzInOfIoDOAga4dOslYz86jeg6oFNX5J+th6LYFppkxHZBU5SOsXN5J
 KYf997eH+K3XkG77D6JSQdIocSfxF6qTtGDUizBHgcymUWmophs=
 =uplN
 -----END PGP SIGNATURE-----

Merge tag 'x86_cache_for_v7.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 resource control updates from Borislav Petkov:

 - Add return value descriptions to several internal functions,
   addressing kernel-doc complaints

 - Add the x86 maintainer mailing list to the resctrl section so they
   are automatically included in patch submissions, and reference the
   applicable contribution rules document

 - Allow users to apply a single Capacity Bitmask to all cache domains
   at once using '*' as a shorthand, instead of having to specify each
   domain individually. This is particularly user-friendly on high
   core-count systems with many cache clusters

 - When a user provides a non-existent domain ID while configuring cache
   allocation, ensure the failure reason is properly reported to the
   user rather than silently returning an error with a misleading "ok"
   status

* tag 'x86_cache_for_v7.1_rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  fs/resctrl: Add missing return value descriptions
  MAINTAINERS: Update resctrl entry
  fs/resctrl: Add "*" shorthand to set io_alloc CBM for all domains
  fs/resctrl: Report invalid domain ID when parsing io_alloc_cbm
This commit is contained in:
Linus Torvalds 2026-04-14 14:46:37 -07:00
commit fabd5a8d24
5 changed files with 36 additions and 4 deletions

View file

@ -215,6 +215,14 @@ related to allocation:
# cat /sys/fs/resctrl/info/L3/io_alloc_cbm
0=00ff;1=000f
An ID of "*" configures all domains with the provided CBM.
Example on a system that does not require a minimum number of consecutive bits in the mask::
# echo "*=0" > /sys/fs/resctrl/info/L3/io_alloc_cbm
# cat /sys/fs/resctrl/info/L3/io_alloc_cbm
0=0;1=0
When CDP is enabled "io_alloc_cbm" associated with the CDP_DATA and CDP_CODE
resources may reflect the same values. For example, values read from and
written to /sys/fs/resctrl/info/L3DATA/io_alloc_cbm may be reflected by

View file

@ -22178,11 +22178,13 @@ F: tools/testing/selftests/net/rds/
RDT - RESOURCE ALLOCATION
M: Tony Luck <tony.luck@intel.com>
M: Reinette Chatre <reinette.chatre@intel.com>
M: x86@kernel.org
R: Dave Martin <Dave.Martin@arm.com>
R: James Morse <james.morse@arm.com>
R: Babu Moger <babu.moger@amd.com>
L: linux-kernel@vger.kernel.org
S: Supported
P: Documentation/process/maintainer-tip.rst
F: Documentation/filesystems/resctrl.rst
F: arch/x86/include/asm/resctrl.h
F: arch/x86/kernel/cpu/resctrl/

View file

@ -954,25 +954,34 @@ static int resctrl_io_alloc_parse_line(char *line, struct rdt_resource *r,
struct resctrl_schema *s, u32 closid)
{
enum resctrl_conf_type peer_type;
unsigned long dom_id = ULONG_MAX;
struct rdt_parse_data data;
struct rdt_ctrl_domain *d;
bool update_all = false;
char *dom = NULL, *id;
unsigned long dom_id;
next:
if (!line || line[0] == '\0')
return 0;
if (update_all) {
rdt_last_cmd_puts("Configurations after global '*'\n");
return -EINVAL;
}
dom = strsep(&line, ";");
id = strsep(&dom, "=");
if (!dom || kstrtoul(id, 10, &dom_id)) {
if (dom && !strcmp(id, "*")) {
update_all = true;
} else if (!dom || kstrtoul(id, 10, &dom_id)) {
rdt_last_cmd_puts("Missing '=' or non-numeric domain\n");
return -EINVAL;
}
dom = strim(dom);
list_for_each_entry(d, &r->ctrl_domains, hdr.list) {
if (d->hdr.id == dom_id) {
if (update_all || d->hdr.id == dom_id) {
data.buf = dom;
data.mode = RDT_MODE_SHAREABLE;
data.closid = closid;
@ -988,10 +997,15 @@ next:
&d->staged_config[s->conf_type],
sizeof(d->staged_config[0]));
}
goto next;
if (!update_all)
goto next;
}
}
if (update_all)
goto next;
rdt_last_cmd_printf("Invalid domain %lu\n", dom_id);
return -EINVAL;
}

View file

@ -234,6 +234,8 @@ static struct rmid_entry *resctrl_find_free_rmid(u32 closid)
*
* When the CLOSID and RMID are independent numbers, the first free CLOSID will
* be returned.
*
* Return: Free CLOSID on success, < 0 on failure.
*/
int resctrl_find_cleanest_closid(void)
{

View file

@ -1519,6 +1519,8 @@ out:
*
* @cbm is unsigned long, even if only 32 bits are used to make the
* bitmap functions work correctly.
*
* Return: Size (in bytes) of cache portion represented by CBM, 0 on failure.
*/
unsigned int rdtgroup_cbm_to_size(struct rdt_resource *r,
struct rdt_ctrl_domain *d, unsigned long cbm)
@ -3102,6 +3104,8 @@ static void rmdir_all_sub(void)
* @mevt: The type of event file being created.
* @do_sum: Whether SNC summing monitors are being created. Only set
* when @rid == RDT_RESOURCE_L3.
*
* Return: Pointer to mon_data private data of the event, NULL on failure.
*/
static struct mon_data *mon_get_kn_priv(enum resctrl_res_level rid, int domid,
struct mon_evt *mevt,
@ -3496,6 +3500,8 @@ out_destroy:
* resource group is initialized. The user can follow this with a
* modification to the CBM if the default does not satisfy the
* requirements.
*
* Return: A CBM that is valid for resource @r.
*/
static u32 cbm_ensure_valid(u32 _val, struct rdt_resource *r)
{