include/linux/sched/topology.h

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

File Facts

System
Linux kernel
Corpus path
include/linux/sched/topology.h
Extension
.h
Size
8153 bytes
Lines
290
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 sd_flag_debug {
	unsigned int meta_flags;
	char *name;
};
extern const struct sd_flag_debug sd_flag_debug[];

struct sched_domain_topology_level;

#ifdef CONFIG_SCHED_SMT
extern int cpu_smt_flags(void);
extern const struct cpumask *tl_smt_mask(struct sched_domain_topology_level *tl, int cpu);
#endif

#ifdef CONFIG_SCHED_CLUSTER
extern int cpu_cluster_flags(void);
extern const struct cpumask *tl_cls_mask(struct sched_domain_topology_level *tl, int cpu);
#endif

#ifdef CONFIG_SCHED_MC
extern int cpu_core_flags(void);
extern const struct cpumask *tl_mc_mask(struct sched_domain_topology_level *tl, int cpu);
#endif

extern const struct cpumask *tl_pkg_mask(struct sched_domain_topology_level *tl, int cpu);

extern int arch_asym_cpu_priority(int cpu);

struct sched_domain_attr {
	int relax_domain_level;
};

#define SD_ATTR_INIT	(struct sched_domain_attr) {	\
	.relax_domain_level = -1,			\
}

extern int sched_domain_level_max;

struct sched_group;

struct sched_domain_shared {
	atomic_t	ref;
	atomic_t	nr_busy_cpus;
	int		has_idle_cores;
	union {
		int	nr_idle_scan;
		/*
		 * Used during allocation to claim the sched_domain_shared
		 * object at multiple levels.
		 *
		 * Note: between build and the first periodic LB tick, which
		 * rewrites the union via update_idle_cpu_scan(), readers of
		 * nr_idle_scan may observe the transient SD_* flag value as
		 * the scan bound. The flag bits are small positive integers,
		 * so the effect is just a slightly relaxed scan bound for one
		 * window and self-heals on the first tick.
		 */
		int	alloc_flags;
	};
#ifdef CONFIG_SCHED_CACHE
	unsigned long	util_avg;
	unsigned long	capacity;
#endif
};

struct sched_domain {
	/* These fields must be setup */
	struct sched_domain __rcu *parent;	/* top domain must be null terminated */
	struct sched_domain __rcu *child;	/* bottom domain must be null terminated */
	struct sched_group *groups;	/* the balancing groups of the domain */
	unsigned long min_interval;	/* Minimum balance interval ms */
	unsigned long max_interval;	/* Maximum balance interval ms */
	unsigned int busy_factor;	/* less balancing by factor if busy */
	unsigned int imbalance_pct;	/* No balance until over watermark */
	unsigned int cache_nice_tries;	/* Leave cache hot tasks for # tries */
	unsigned int imb_numa_nr;	/* Nr running tasks that allows a NUMA imbalance */

	int nohz_idle;			/* NOHZ IDLE status */
	int flags;			/* See SD_* */
	int level;

	/* Runtime fields. */
	unsigned long last_balance;	/* init to jiffies. units in jiffies */
	unsigned int balance_interval;	/* initialise to 1. units in ms. */
	unsigned int nr_balance_failed; /* initialise to 0 */

	/* idle_balance() stats */
	unsigned int newidle_call;
	unsigned int newidle_success;
	unsigned int newidle_ratio;
	u64 newidle_stamp;

Annotation

Implementation Notes