1 #ifdef CONFIG_SCHED_AUTOGROUP
3 #include <linux/kref.h>
4 #include <linux/rwsem.h>
9 struct rw_semaphore lock
;
14 extern void autogroup_init(struct task_struct
*init_task
);
15 extern void autogroup_free(struct task_group
*tg
);
17 static inline bool task_group_is_autogroup(struct task_group
*tg
)
19 return !!tg
->autogroup
;
22 extern bool task_wants_autogroup(struct task_struct
*p
, struct task_group
*tg
);
24 static inline struct task_group
*
25 autogroup_task_group(struct task_struct
*p
, struct task_group
*tg
)
27 int enabled
= ACCESS_ONCE(sysctl_sched_autogroup_enabled
);
29 if (enabled
&& task_wants_autogroup(p
, tg
))
30 return p
->signal
->autogroup
->tg
;
35 extern int autogroup_path(struct task_group
*tg
, char *buf
, int buflen
);
37 #else /* !CONFIG_SCHED_AUTOGROUP */
39 static inline void autogroup_init(struct task_struct
*init_task
) { }
40 static inline void autogroup_free(struct task_group
*tg
) { }
41 static inline bool task_group_is_autogroup(struct task_group
*tg
)
46 static inline struct task_group
*
47 autogroup_task_group(struct task_struct
*p
, struct task_group
*tg
)
52 #ifdef CONFIG_SCHED_DEBUG
53 static inline int autogroup_path(struct task_group
*tg
, char *buf
, int buflen
)
59 #endif /* CONFIG_SCHED_AUTOGROUP */