blob: c2f0e7248dca354bc2e96ea95984c3457d28e75d [file] [log] [blame]
Mike Galbraith5091faa2010-11-30 14:18:03 +01001#ifdef CONFIG_SCHED_AUTOGROUP
2
3struct autogroup {
Yong Zhang800d4d32011-02-20 15:08:14 +08004 /*
5 * reference doesn't mean how many thread attach to this
6 * autogroup now. It just stands for the number of task
7 * could use this autogroup.
8 */
Mike Galbraith5091faa2010-11-30 14:18:03 +01009 struct kref kref;
10 struct task_group *tg;
11 struct rw_semaphore lock;
12 unsigned long id;
13 int nice;
14};
15
Yong Zhang1c09ab02011-06-28 10:51:31 +080016static inline bool task_group_is_autogroup(struct task_group *tg);
Mike Galbraith5091faa2010-11-30 14:18:03 +010017static inline struct task_group *
18autogroup_task_group(struct task_struct *p, struct task_group *tg);
19
20#else /* !CONFIG_SCHED_AUTOGROUP */
21
22static inline void autogroup_init(struct task_struct *init_task) { }
23static inline void autogroup_free(struct task_group *tg) { }
Mike Galbraithf4493772011-01-13 04:54:50 +010024static inline bool task_group_is_autogroup(struct task_group *tg)
25{
26 return 0;
27}
Mike Galbraith5091faa2010-11-30 14:18:03 +010028
29static inline struct task_group *
30autogroup_task_group(struct task_struct *p, struct task_group *tg)
31{
32 return tg;
33}
34
35#ifdef CONFIG_SCHED_DEBUG
36static inline int autogroup_path(struct task_group *tg, char *buf, int buflen)
37{
38 return 0;
39}
40#endif
41
42#endif /* CONFIG_SCHED_AUTOGROUP */