/** * cpumask_any_housekeeping() - Choose any CPU in @mask, preferring those that * aren't marked nohz_full * @mask: The mask to pick a CPU from. * @exclude_cpu:The CPU to avoid picking. * * Returns a CPU from @mask, but not @exclude_cpu. If there are housekeeping * CPUs that don't use nohz_full, these are preferred. Pass * RESCTRL_PICK_ANY_CPU to avoid excluding any CPUs. * * When a CPU is excluded, returns >= nr_cpu_ids if no CPUs are available.
*/ staticinlineunsignedint
cpumask_any_housekeeping(conststruct cpumask *mask, int exclude_cpu)
{ unsignedint cpu;
/* Try to find a CPU that isn't nohz_full to use in preference */ if (tick_nohz_full_enabled()) {
cpu = cpumask_any_andnot_but(mask, tick_nohz_full_mask, exclude_cpu); if (cpu < nr_cpu_ids) return cpu;
}
/** * struct mon_evt - Entry in the event list of a resource * @evtid: event id * @name: name of the event * @configurable: true if the event is configurable * @list: entry in &rdt_resource->evt_list
*/ struct mon_evt { enum resctrl_event_id evtid; char *name; bool configurable; struct list_head list;
};
/** * 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. * @evtid: Event id associated with the event file. * @sum: Set 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; enum resctrl_event_id evtid; 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. * @d: Domain that the counter should be read from. If NULL then sum all * domains in @r sharing L3 @ci.id * @evtid: Which monitor event to read. * @first: Initialize MBM counter when true. * @ci: Cacheinfo for L3. Only set when @d is NULL. Used when summing domains. * @err: Error encountered when reading counter. * @val: Returned value of event counter. If @rgrp is a parent resource group, * @val includes the sum of event counts from its child resource groups. * If @d is NULL, @val includes the sum of all domains in @r sharing @ci.id, * (summed across child resource groups if @rgrp is a parent resource group). * @arch_mon_ctx: Hardware monitor allocated for this read request (MPAM only).
*/ struct rmid_read { struct rdtgroup *rgrp; struct rdt_resource *r; struct rdt_mon_domain *d; enum resctrl_event_id evtid; bool first; struct cacheinfo *ci; int err;
u64 val; void *arch_mon_ctx;
};
/** * enum rdtgrp_mode - Mode of a RDT resource group * @RDT_MODE_SHAREABLE: This resource group allows sharing of its allocations * @RDT_MODE_EXCLUSIVE: No sharing of this resource group's allocations allowed * @RDT_MODE_PSEUDO_LOCKSETUP: Resource group will be used for Pseudo-Locking * @RDT_MODE_PSEUDO_LOCKED: No sharing of this resource group's allocations * allowed AND the allocations are Cache Pseudo-Locked * @RDT_NUM_MODES: Total number of modes * * The mode of a resource group enables control over the allowed overlap * between allocations associated with different resource groups (classes * of service). User is able to modify the mode of a resource group by * writing to the "mode" resctrl file associated with the resource group. * * The "shareable", "exclusive", and "pseudo-locksetup" modes are set by * writing the appropriate text to the "mode" file. A resource group enters * "pseudo-locked" mode after the schemata is written while the resource * group is in "pseudo-locksetup" mode.
*/ enum rdtgrp_mode {
RDT_MODE_SHAREABLE = 0,
RDT_MODE_EXCLUSIVE,
RDT_MODE_PSEUDO_LOCKSETUP,
RDT_MODE_PSEUDO_LOCKED,
/* Must be last */
RDT_NUM_MODES,
};
/** * struct mongroup - store mon group's data in resctrl fs. * @mon_data_kn: kernfs node for the mon_data directory * @parent: parent rdtgrp * @crdtgrp_list: child rdtgroup node list * @rmid: rmid for this rdtgroup
*/ struct mongroup { struct kernfs_node *mon_data_kn; struct rdtgroup *parent; struct list_head crdtgrp_list;
u32 rmid;
};
/** * struct rdtgroup - store rdtgroup's data in resctrl file system. * @kn: kernfs node * @rdtgroup_list: linked list for all rdtgroups * @closid: closid for this rdtgroup * @cpu_mask: CPUs assigned to this rdtgroup * @flags: status bits * @waitcount: how many cpus expect to find this * group when they acquire rdtgroup_mutex * @type: indicates type of this rdtgroup - either * monitor only or ctrl_mon group * @mon: mongroup related data * @mode: mode of resource group * @mba_mbps_event: input monitoring event id when mba_sc is enabled * @plr: pseudo-locked region
*/ struct rdtgroup { struct kernfs_node *kn; struct list_head rdtgroup_list;
u32 closid; struct cpumask cpu_mask; int flags;
atomic_t waitcount; enum rdt_group_type type; struct mongroup mon; enum rdtgrp_mode mode; enum resctrl_event_id mba_mbps_event; struct pseudo_lock_region *plr;
};
/* List of all resource groups */ externstruct list_head rdt_all_groups;
externint max_name_width;
/** * struct rftype - describe each file in the resctrl file system * @name: File name * @mode: Access mode * @kf_ops: File operations * @flags: File specific RFTYPE_FLAGS_* flags * @fflags: File specific RFTYPE_* flags * @seq_show: Show content of the file * @write: Write to the file
*/ struct rftype { char *name;
umode_t mode; conststruct kernfs_ops *kf_ops; unsignedlong flags; unsignedlong fflags;
int (*seq_show)(struct kernfs_open_file *of, struct seq_file *sf, void *v); /* * write() is the generic write callback which maps directly to * kernfs write operation and overrides all other operations. * Maximum write size is determined by ->max_write_len.
*/
ssize_t (*write)(struct kernfs_open_file *of, char *buf, size_t nbytes, loff_t off);
};
/** * struct mbm_state - status for each MBM counter in each domain * @prev_bw_bytes: Previous bytes value read for bandwidth calculation * @prev_bw: The most recent bandwidth in MBps
*/ struct mbm_state {
u64 prev_bw_bytes;
u32 prev_bw;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.