fs/resctrl/internal.h
Source file repositories/reference/linux-study-clean/fs/resctrl/internal.h
File Facts
- System
- Linux kernel
- Corpus path
fs/resctrl/internal.h- Extension
.h- Size
- 15691 bytes
- Lines
- 520
- Domain
- Core OS
- Bucket
- VFS And Filesystem Core
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/resctrl.hlinux/kernfs.hlinux/fs_context.hlinux/tick.h
Detected Declarations
struct rdt_fs_contextstruct mon_evtstruct mon_datastruct rmid_readstruct mongroupstruct rdtgroupstruct rftypestruct mbm_stateenum rdt_group_typeenum rdtgrp_modefunction cpumask_any_housekeepingfunction rdtgroup_locksetup_enterfunction rdtgroup_locksetup_exitfunction rdtgroup_cbm_overlaps_pseudo_lockedfunction rdtgroup_pseudo_locked_in_hierarchyfunction rdt_pseudo_lock_initfunction rdt_pseudo_lock_releasefunction rdtgroup_pseudo_lock_remove
Annotated Snippet
struct rdt_fs_context {
struct kernfs_fs_context kfc;
bool enable_cdpl2;
bool enable_cdpl3;
bool enable_mba_mbps;
bool enable_debug;
};
static inline struct rdt_fs_context *rdt_fc2context(struct fs_context *fc)
{
struct kernfs_fs_context *kfc = fc->fs_private;
return container_of(kfc, struct rdt_fs_context, kfc);
}
/**
* struct mon_evt - Properties of a monitor event
* @evtid: event id
* @rid: resource id for this event
* @name: name of the event
* @evt_cfg: Event configuration value that represents the
* memory transactions (e.g., READS_TO_LOCAL_MEM,
* READS_TO_REMOTE_MEM) being tracked by @evtid.
* Only valid if @evtid is an MBM event.
* @configurable: true if the event is configurable
* @any_cpu: true if the event can be read from any CPU
* @is_floating_point: event values are displayed in floating point format
* @binary_bits: number of fixed-point binary bits from architecture,
* only valid if @is_floating_point is true
* @enabled: true if the event is enabled
* @arch_priv: Architecture private data for this event.
* The @arch_priv provided by the architecture via
* resctrl_enable_mon_event().
*/
struct mon_evt {
enum resctrl_event_id evtid;
enum resctrl_res_level rid;
char *name;
u32 evt_cfg;
bool configurable;
bool any_cpu;
bool is_floating_point;
unsigned int binary_bits;
bool enabled;
void *arch_priv;
};
extern struct mon_evt mon_event_all[QOS_NUM_EVENTS];
#define for_each_mon_event(mevt) for (mevt = &mon_event_all[QOS_FIRST_EVENT]; \
mevt < &mon_event_all[QOS_NUM_EVENTS]; mevt++)
/* Limit for mon_evt::binary_bits */
#define MAX_BINARY_BITS 27
/**
* struct mon_data - Monitoring details for each event file.
* @list: Member of the global @mon_data_kn_priv_list list.
* @rid: Resource id associated with the event file.
* @evt: Event structure associated with the event file.
* @sum: Set for RDT_RESOURCE_L3 when event must be summed
* across multiple domains.
* @domid: When @sum is zero this is the domain to which
* the event file belongs. When @sum is one this
* is the id of the L3 cache that all domains to be
* summed share.
*
* Pointed to by the kernfs kn->priv field of monitoring event files.
* Readers and writers must hold rdtgroup_mutex.
*/
struct mon_data {
struct list_head list;
enum resctrl_res_level rid;
struct mon_evt *evt;
int domid;
bool sum;
};
/**
* struct rmid_read - Data passed across smp_call*() to read event count.
* @rgrp: Resource group for which the counter is being read. If it is a parent
* resource group then its event count is summed with the count from all
* its child resource groups.
* @r: Resource describing the properties of the event being read.
* @hdr: Header of domain that the counter should be read from. If NULL then
* sum all domains in @r sharing L3 @ci.id
* @evt: Which monitor event to read.
* @first: Initialize MBM counter when true.
* @ci: Cacheinfo for L3. Only set when @hdr is NULL. Used when summing
* domains.
Annotation
- Immediate include surface: `linux/resctrl.h`, `linux/kernfs.h`, `linux/fs_context.h`, `linux/tick.h`.
- Detected declarations: `struct rdt_fs_context`, `struct mon_evt`, `struct mon_data`, `struct rmid_read`, `struct mongroup`, `struct rdtgroup`, `struct rftype`, `struct mbm_state`, `enum rdt_group_type`, `enum rdtgrp_mode`.
- Atlas domain: Core OS / VFS And Filesystem Core.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.