sched_autogroup.h 947 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 struct task_group *
  15. autogroup_task_group(struct task_struct *p, struct task_group *tg);
  16. #else /* !CONFIG_SCHED_AUTOGROUP */
  17. static inline void autogroup_init(struct task_struct *init_task) { }
  18. static inline void autogroup_free(struct task_group *tg) { }
  19. static inline bool task_group_is_autogroup(struct task_group *tg)
  20. {
  21. return 0;
  22. }
  23. static inline struct task_group *
  24. autogroup_task_group(struct task_struct *p, struct task_group *tg)
  25. {
  26. return tg;
  27. }
  28. #ifdef CONFIG_SCHED_DEBUG
  29. static inline int autogroup_path(struct task_group *tg, char *buf, int buflen)
  30. {
  31. return 0;
  32. }
  33. #endif
  34. #endif /* CONFIG_SCHED_AUTOGROUP */