logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

types.h (4558B)


  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. #ifndef _LINUX_SCHED_TYPES_H
  3. #define _LINUX_SCHED_TYPES_H
  4. #include <linux/types.h>
  5. #define SCHED_ATTR_SIZE_VER0 48 /* sizeof first published struct */
  6. #define SCHED_ATTR_SIZE_VER1 56 /* add: util_{min,max} */
  7. /*
  8. * Extended scheduling parameters data structure.
  9. *
  10. * This is needed because the original struct sched_param can not be
  11. * altered without introducing ABI issues with legacy applications
  12. * (e.g., in sched_getparam()).
  13. *
  14. * However, the possibility of specifying more than just a priority for
  15. * the tasks may be useful for a wide variety of application fields, e.g.,
  16. * multimedia, streaming, automation and control, and many others.
  17. *
  18. * This variant (sched_attr) allows to define additional attributes to
  19. * improve the scheduler knowledge about task requirements.
  20. *
  21. * Scheduling Class Attributes
  22. * ===========================
  23. *
  24. * A subset of sched_attr attributes specifies the
  25. * scheduling policy and relative POSIX attributes:
  26. *
  27. * @size size of the structure, for fwd/bwd compat.
  28. *
  29. * @sched_policy task's scheduling policy
  30. * @sched_nice task's nice value (SCHED_NORMAL/BATCH)
  31. * @sched_priority task's static priority (SCHED_FIFO/RR)
  32. *
  33. * Certain more advanced scheduling features can be controlled by a
  34. * predefined set of flags via the attribute:
  35. *
  36. * @sched_flags for customizing the scheduler behaviour
  37. *
  38. * Sporadic Time-Constrained Task Attributes
  39. * =========================================
  40. *
  41. * A subset of sched_attr attributes allows to describe a so-called
  42. * sporadic time-constrained task.
  43. *
  44. * In such a model a task is specified by:
  45. * - the activation period or minimum instance inter-arrival time;
  46. * - the maximum (or average, depending on the actual scheduling
  47. * discipline) computation time of all instances, a.k.a. runtime;
  48. * - the deadline (relative to the actual activation time) of each
  49. * instance.
  50. * Very briefly, a periodic (sporadic) task asks for the execution of
  51. * some specific computation --which is typically called an instance--
  52. * (at most) every period. Moreover, each instance typically lasts no more
  53. * than the runtime and must be completed by time instant t equal to
  54. * the instance activation time + the deadline.
  55. *
  56. * This is reflected by the following fields of the sched_attr structure:
  57. *
  58. * @sched_deadline representative of the task's deadline in nanoseconds
  59. * @sched_runtime representative of the task's runtime in nanoseconds
  60. * @sched_period representative of the task's period in nanoseconds
  61. *
  62. * Given this task model, there are a multiplicity of scheduling algorithms
  63. * and policies, that can be used to ensure all the tasks will make their
  64. * timing constraints.
  65. *
  66. * As of now, the SCHED_DEADLINE policy (sched_dl scheduling class) is the
  67. * only user of this new interface. More information about the algorithm
  68. * available in the scheduling class file or in Documentation/.
  69. *
  70. * Task Utilization Attributes
  71. * ===========================
  72. *
  73. * A subset of sched_attr attributes allows to specify the utilization
  74. * expected for a task. These attributes allow to inform the scheduler about
  75. * the utilization boundaries within which it should schedule the task. These
  76. * boundaries are valuable hints to support scheduler decisions on both task
  77. * placement and frequency selection.
  78. *
  79. * @sched_util_min represents the minimum utilization
  80. * @sched_util_max represents the maximum utilization
  81. *
  82. * Utilization is a value in the range [0..SCHED_CAPACITY_SCALE]. It
  83. * represents the percentage of CPU time used by a task when running at the
  84. * maximum frequency on the highest capacity CPU of the system. For example, a
  85. * 20% utilization task is a task running for 2ms every 10ms at maximum
  86. * frequency.
  87. *
  88. * A task with a min utilization value bigger than 0 is more likely scheduled
  89. * on a CPU with a capacity big enough to fit the specified value.
  90. * A task with a max utilization value smaller than 1024 is more likely
  91. * scheduled on a CPU with no more capacity than the specified value.
  92. *
  93. * A task utilization boundary can be reset by setting the attribute to -1.
  94. */
  95. struct sched_attr {
  96. __u32 size;
  97. __u32 sched_policy;
  98. __u64 sched_flags;
  99. /* SCHED_NORMAL, SCHED_BATCH */
  100. __s32 sched_nice;
  101. /* SCHED_FIFO, SCHED_RR */
  102. __u32 sched_priority;
  103. /* SCHED_DEADLINE */
  104. __u64 sched_runtime;
  105. __u64 sched_deadline;
  106. __u64 sched_period;
  107. /* Utilization hints */
  108. __u32 sched_util_min;
  109. __u32 sched_util_max;
  110. };
  111. #endif /* _LINUX_SCHED_TYPES_H */