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.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/cacheinfo.hlinux/kernel.hlinux/list.hlinux/pid.hlinux/resctrl_types.hasm/resctrl.h
Detected Declarations
struct pseudo_lock_regionstruct resctrl_staged_configstruct rdt_domain_hdrstruct rdt_ctrl_domainstruct mbm_cntr_cfgstruct rdt_l3_mon_domainstruct resctrl_cachestruct resctrl_membwstruct resctrl_schemastruct resctrl_monstruct rdt_resourcestruct resctrl_schemastruct resctrl_cpu_defaultsstruct resctrl_mon_config_infoenum resctrl_res_levelenum resctrl_conf_typeenum resctrl_domain_typeenum membw_throttle_modeenum resctrl_scopeenum resctrl_schema_fmtfunction domain_header_is_validfunction resctrl_get_default_ctrlfunction resctrl_is_mbm_eventfunction resctrl_get_config_indexfunction resctrl_arch_rmid_read_context_checkfunction resctrl_arch_get_prefetch_disable_bitsfunction resctrl_arch_pseudo_lock_fnfunction resctrl_arch_measure_cycles_lat_fnfunction resctrl_arch_measure_l2_residencyfunction resctrl_arch_measure_l3_residency
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
- Immediate include surface: `linux/cacheinfo.h`, `linux/kernel.h`, `linux/list.h`, `linux/pid.h`, `linux/resctrl_types.h`, `asm/resctrl.h`.
- Detected declarations: `struct pseudo_lock_region`, `struct resctrl_staged_config`, `struct rdt_domain_hdr`, `struct rdt_ctrl_domain`, `struct mbm_cntr_cfg`, `struct rdt_l3_mon_domain`, `struct resctrl_cache`, `struct resctrl_membw`, `struct resctrl_schema`, `struct resctrl_mon`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.