aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-02-01 12:07:51 -0500
committerIngo Molnar <mingo@kernel.org>2017-03-02 02:42:42 -0500
commite2d1e2aec572a2138dea74d53be54a1406d419c0 (patch)
tree46650b36bbecab6e14caa669d3262f2e949068e6 /include/uapi/linux
parent47913d4ebd99c827c82c4f29eb282a119c3f2aeb (diff)
sched/headers: Move various ABI definitions to <uapi/linux/sched/types.h>
Move scheduler ABI types (struct sched_attr, struct sched_param, etc.) into the new UAPI header. This further reduces the size and complexity of <linux/sched.h>. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/sched/types.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/include/uapi/linux/sched/types.h b/include/uapi/linux/sched/types.h
index d162d315f4b5..307acbc82d80 100644
--- a/include/uapi/linux/sched/types.h
+++ b/include/uapi/linux/sched/types.h
@@ -3,4 +3,72 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6struct 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 */
56struct 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
6#endif /* _UAPI_LINUX_SCHED_TYPES_H */ 74#endif /* _UAPI_LINUX_SCHED_TYPES_H */