Christopher Ferris | 0543f74 | 2017-07-26 13:09:46 -0700 | [diff] [blame^] | 1 | #ifndef _UAPI_LINUX_SCHED_TYPES_H |
| 2 | #define _UAPI_LINUX_SCHED_TYPES_H |
| 3 | |
| 4 | #include <linux/types.h> |
| 5 | |
| 6 | struct sched_param { |
| 7 | int sched_priority; |
| 8 | }; |
| 9 | |
| 10 | #define SCHED_ATTR_SIZE_VER0 48 /* sizeof first published struct */ |
| 11 | |
| 12 | /* |
| 13 | * Extended scheduling parameters data structure. |
| 14 | * |
| 15 | * This is needed because the original struct sched_param can not be |
| 16 | * altered without introducing ABI issues with legacy applications |
| 17 | * (e.g., in sched_getparam()). |
| 18 | * |
| 19 | * However, the possibility of specifying more than just a priority for |
| 20 | * the tasks may be useful for a wide variety of application fields, e.g., |
| 21 | * multimedia, streaming, automation and control, and many others. |
| 22 | * |
| 23 | * This variant (sched_attr) is meant at describing a so-called |
| 24 | * sporadic time-constrained task. In such model a task is specified by: |
| 25 | * - the activation period or minimum instance inter-arrival time; |
| 26 | * - the maximum (or average, depending on the actual scheduling |
| 27 | * discipline) computation time of all instances, a.k.a. runtime; |
| 28 | * - the deadline (relative to the actual activation time) of each |
| 29 | * instance. |
| 30 | * Very briefly, a periodic (sporadic) task asks for the execution of |
| 31 | * some specific computation --which is typically called an instance-- |
| 32 | * (at most) every period. Moreover, each instance typically lasts no more |
| 33 | * than the runtime and must be completed by time instant t equal to |
| 34 | * the instance activation time + the deadline. |
| 35 | * |
| 36 | * This is reflected by the actual fields of the sched_attr structure: |
| 37 | * |
| 38 | * @size size of the structure, for fwd/bwd compat. |
| 39 | * |
| 40 | * @sched_policy task's scheduling policy |
| 41 | * @sched_flags for customizing the scheduler behaviour |
| 42 | * @sched_nice task's nice value (SCHED_NORMAL/BATCH) |
| 43 | * @sched_priority task's static priority (SCHED_FIFO/RR) |
| 44 | * @sched_deadline representative of the task's deadline |
| 45 | * @sched_runtime representative of the task's runtime |
| 46 | * @sched_period representative of the task's period |
| 47 | * |
| 48 | * Given this task model, there are a multiplicity of scheduling algorithms |
| 49 | * and policies, that can be used to ensure all the tasks will make their |
| 50 | * timing constraints. |
| 51 | * |
| 52 | * As of now, the SCHED_DEADLINE policy (sched_dl scheduling class) is the |
| 53 | * only user of this new interface. More information about the algorithm |
| 54 | * available in the scheduling class file or in Documentation/. |
| 55 | */ |
| 56 | struct sched_attr { |
| 57 | __u32 size; |
| 58 | |
| 59 | __u32 sched_policy; |
| 60 | __u64 sched_flags; |
| 61 | |
| 62 | /* SCHED_NORMAL, SCHED_BATCH */ |
| 63 | __s32 sched_nice; |
| 64 | |
| 65 | /* SCHED_FIFO, SCHED_RR */ |
| 66 | __u32 sched_priority; |
| 67 | |
| 68 | /* SCHED_DEADLINE */ |
| 69 | __u64 sched_runtime; |
| 70 | __u64 sched_deadline; |
| 71 | __u64 sched_period; |
| 72 | }; |
| 73 | |
| 74 | #endif /* _UAPI_LINUX_SCHED_TYPES_H */ |