include/linux/resctrl.h

Source file repositories/reference/linux-study-clean/include/linux/resctrl.h

File Facts

System
Linux kernel
Corpus path
include/linux/resctrl.h
Extension
.h
Size
24777 bytes
Lines
726
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct pseudo_lock_region {
	struct resctrl_schema	*s;
	u32			closid;
	struct rdt_ctrl_domain	*d;
	u32			cbm;
	wait_queue_head_t	lock_thread_wq;
	int			thread_done;
	int			cpu;
	unsigned int		line_size;
	unsigned int		size;
	void			*kmem;
	unsigned int		minor;
	struct dentry		*debugfs_dir;
	struct list_head	pm_reqs;
};

/**
 * struct resctrl_staged_config - parsed configuration to be applied
 * @new_ctrl:		new ctrl value to be loaded
 * @have_new_ctrl:	whether the user provided new_ctrl is valid
 */
struct resctrl_staged_config {
	u32			new_ctrl;
	bool			have_new_ctrl;
};

enum resctrl_domain_type {
	RESCTRL_CTRL_DOMAIN,
	RESCTRL_MON_DOMAIN,
};

/**
 * struct rdt_domain_hdr - common header for different domain types
 * @list:		all instances of this resource
 * @id:			unique id for this instance
 * @type:		type of this instance
 * @rid:		resource id for this instance
 * @cpu_mask:		which CPUs share this resource
 */
struct rdt_domain_hdr {
	struct list_head		list;
	int				id;
	enum resctrl_domain_type	type;
	enum resctrl_res_level		rid;
	struct cpumask			cpu_mask;
};

static inline bool domain_header_is_valid(struct rdt_domain_hdr *hdr,
					  enum resctrl_domain_type type,
					  enum resctrl_res_level rid)
{
	return !WARN_ON_ONCE(hdr->type != type || hdr->rid != rid);
}

/**
 * struct rdt_ctrl_domain - group of CPUs sharing a resctrl control resource
 * @hdr:		common header for different domain types
 * @plr:		pseudo-locked region (if any) associated with domain
 * @staged_config:	parsed configuration to be applied
 * @mbps_val:		When mba_sc is enabled, this holds the array of user
 *			specified control values for mba_sc in MBps, indexed
 *			by closid
 */
struct rdt_ctrl_domain {
	struct rdt_domain_hdr		hdr;
	struct pseudo_lock_region	*plr;
	struct resctrl_staged_config	staged_config[CDP_NUM_TYPES];
	u32				*mbps_val;
};

/**
 * struct mbm_cntr_cfg - Assignable counter configuration.
 * @evtid:		MBM event to which the counter is assigned. Only valid
 *			if @rdtgroup is not NULL.
 * @rdtgrp:		resctrl group assigned to the counter. NULL if the
 *			counter is free.
 */
struct mbm_cntr_cfg {
	enum resctrl_event_id	evtid;
	struct rdtgroup		*rdtgrp;
};

/**
 * struct rdt_l3_mon_domain - group of CPUs sharing RDT_RESOURCE_L3 monitoring
 * @hdr:		common header for different domain types
 * @ci_id:		cache info id for this domain
 * @rmid_busy_llc:	bitmap of which limbo RMIDs are above threshold
 * @mbm_states:		Per-event pointer to the MBM event's saved state.
 *			An MBM event's state is an array of struct mbm_state
 *			indexed by RMID on x86 or combined CLOSID, RMID on Arm.

Annotation

Implementation Notes