【数据结构】【task_group】

task_group

/* task group related information */
struct task_group {
	/* 用于进程找到其所属进程组结构 */
	struct cgroup_subsys_state css;

#ifdef CONFIG_FAIR_GROUP_SCHED
	/* schedulable entities of this group on each cpu */
	/* CFS调度器的进程组变量,在 alloc_fair_sched_group() 中进程初始化及分配内存 */
/* 该进程组在每个CPU上都有对应的一个调度实体,因为有可能此进程组同时在两个CPU上
 运行(它的A进程在CPU0上运行,B进程在CPU1上运行) */

	struct sched_entity **se;
	/* runqueue "owned" by this group on each cpu */
	/* 进程组在每个CPU上都有一个CFS运行队列(为什么需要,稍后解释) */
	struct cfs_rq **cfs_rq;
	/* 用于保存优先级默认为NICE 0的优先级 ,这个数值是常量*/
	unsigned long shares;

#ifdef	CONFIG_SMP
	/*
	 * load_avg can be heavily contended at clock tick time, so put
	 * it in its own cacheline separated from the fields above which
	 * will also be accessed at each tick.
	 */
	atomic_long_t load_avg ____cacheline_aligned;
#endif
#endif

#ifdef CONFIG_RT_GROUP_SCHED
/* 实时进程调度器的进程组变量,同 CFS */
	struct sched_rt_entity **rt_se;
	struct rt_rq **rt_rq;

	struct rt_bandwidth rt_bandwidth;
#endif

	struct rcu_head rcu;
	/* 用于建立进程链表(属于此调度组的进程链表) */
	struct list_head list;
/* 指向其上层的进程组,每一层的进程组都是它上一层进程组的运行队列的一个调度实体
,在同一层中,进程组和进程被同等对待 */
	struct task_group *parent;
	/* 进程组的兄弟结点链表 */
	struct list_head siblings;
	/* 进程组的儿子结点链表 */
	struct list_head children;

#ifdef CONFIG_SCHED_AUTOGROUP
	struct autogroup *autogroup;
#endif

	struct cfs_bandwidth cfs_bandwidth;
};

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值