sched_autogroup.h 1014 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #ifdef CONFIG_SCHED_AUTOGROUP
  2. struct autogroup {
  3. /*
  4. * reference doesn't mean how many thread attach to this
  5. * autogroup now. It just stands for the number of task
  6. * could use this autogroup.
  7. */
  8. struct kref kref;
  9. struct task_group *tg;
  10. struct rw_semaphore lock;
  11. unsigned long id;
  12. int nice;
  13. };
  14. static inline bool task_group_is_autogroup(struct task_group *tg);
  15. static inline struct task_group *
  16. autogroup_task_group(struct task_struct *p, struct task_group *tg);
  17. #else /* !CONFIG_SCHED_AUTOGROUP */
  18. static inline void autogroup_init(struct task_struct *init_task) { }
  19. static inline void autogroup_free(struct task_group *tg) { }
  20. static inline bool task_group_is_autogroup(struct task_group *tg)
  21. {
  22. return 0;
  23. }
  24. static inline struct task_group *
  25. autogroup_task_group(struct task_struct *p, struct task_group *tg)
  26. {
  27. return tg;
  28. }
  29. #ifdef CONFIG_SCHED_DEBUG
  30. static inline int autogroup_path(struct task_group *tg, char *buf, int buflen)
  31. {
  32. return 0;
  33. }
  34. #endif
  35. #endif /* CONFIG_SCHED_AUTOGROUP */