分类: LINUX
2010-03-29 22:25:41
可以查看之前水木版聚讲的ppt,里面有详细的group scheduler解释。
/* return group to which a task belongs */
static inline struct task_group *task_group(struct task_struct *p)
{
struct task_group *tg;
#ifdef CONFIG_USER_SCHED 用户调度的情况
rcu_read_lock();
tg = __task_cred(p)->user->tg;
rcu_read_unlock();
#elif defined(CONFIG_CGROUP_SCHED) 资源控制组使能的情况
tg = container_of(task_subsys_state(p, cpu_cgroup_subsys_id),
struct task_group, css);
#else
tg = &init_task_group;
#endif
return tg;