Commit fabd5a8d authored by Linus Torvalds's avatar Linus Torvalds
Browse files

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
parents 883af1f8 79727019
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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
+2 −0
Original line number Diff line number Diff line
@@ -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/
+18 −4
Original line number Diff line number Diff line
@@ -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 @@ static int resctrl_io_alloc_parse_line(char *line, struct rdt_resource *r,
				       &d->staged_config[s->conf_type],
				       sizeof(d->staged_config[0]));
			}
			if (!update_all)
				goto next;
		}
	}

	if (update_all)
		goto next;

	rdt_last_cmd_printf("Invalid domain %lu\n", dom_id);
	return -EINVAL;
}

+2 −0
Original line number Diff line number Diff line
@@ -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)
{
+6 −0
Original line number Diff line number Diff line
@@ -1519,6 +1519,8 @@ static ssize_t rdtgroup_mode_write(struct kernfs_open_file *of,
 *
 * @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 @@ static int mkdir_mondata_all(struct kernfs_node *parent_kn,
 * 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)
{