aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2013-03-05 20:03:04 -0500
committerBjoern Brandenburg <bbb@mpi-sws.org>2013-03-12 10:29:24 -0400
commit181b6bb0f5f122741262edc7ac0eca86d3f6dd73 (patch)
tree1b6e7ab6293bb67b6d01bb939217286ac8cd105c /include
parent033356ad3a0a719d52104e63c491d3c33f650ec3 (diff)
EDF schedulers: Support early job releasing.
This patch allows a task to request early releasing via rt_task parameters to sys_set_task_rt_param(). Note that early releasing can easily peg your CPUs since early-releasing tasks never suspend to wait for their next job. As such, early releasing is really only useful in the context of implementing bandwidth servers, interrupt handling threads (or any thread that spends most of its time waiting for an event), or short-lived computations. If early releasing pegs your CPUs, then you probably shouldn't be using it.
Diffstat (limited to 'include')
-rw-r--r--include/litmus/litmus.h6
-rw-r--r--include/litmus/rt_param.h19
2 files changed, 24 insertions, 1 deletions
diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h
index 875783e6a67b..81f6a499570b 100644
--- a/include/litmus/litmus.h
+++ b/include/litmus/litmus.h
@@ -63,6 +63,12 @@ void litmus_exit_task(struct task_struct *tsk);
63#define get_release(t) (tsk_rt(t)->job_params.release) 63#define get_release(t) (tsk_rt(t)->job_params.release)
64#define get_lateness(t) (tsk_rt(t)->job_params.lateness) 64#define get_lateness(t) (tsk_rt(t)->job_params.lateness)
65 65
66#ifdef CONFIG_ALLOW_EARLY_RELEASE
67#define wants_early_release(t) (tsk_rt(t)->task_params.release_policy == EARLY)
68#else
69#define wants_early_release(t) (0)
70#endif
71
66#define is_hrt(t) \ 72#define is_hrt(t) \
67 (tsk_rt(t)->task_params.cls == RT_CLASS_HARD) 73 (tsk_rt(t)->task_params.cls == RT_CLASS_HARD)
68#define is_srt(t) \ 74#define is_srt(t) \
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h
index 5487bdb11380..4167508d9862 100644
--- a/include/litmus/rt_param.h
+++ b/include/litmus/rt_param.h
@@ -33,6 +33,22 @@ typedef enum {
33 PRECISE_ENFORCEMENT /* budgets are enforced with hrtimers */ 33 PRECISE_ENFORCEMENT /* budgets are enforced with hrtimers */
34} budget_policy_t; 34} budget_policy_t;
35 35
36typedef enum {
37 /* Jobs are released periodically (provided job precedence
38 constraints are met). */
39 PERIODIC,
40
41 /* Jobs are released sporadically (provided job precedence
42 constraints are met). NOTE: Litmus currently does not
43 distinguish between periodic and sporadic tasks. */
44 SPORADIC = PERIODIC,
45
46 /* Jobs are released immediatly after meeting precedence
47 constraints. Beware this can peg your CPUs if used in
48 the wrong applications. */
49 EARLY
50} release_policy_t;
51
36/* We use the common priority interpretation "lower index == higher priority", 52/* We use the common priority interpretation "lower index == higher priority",
37 * which is commonly used in fixed-priority schedulability analysis papers. 53 * which is commonly used in fixed-priority schedulability analysis papers.
38 * So, a numerically lower priority value implies higher scheduling priority, 54 * So, a numerically lower priority value implies higher scheduling priority,
@@ -61,7 +77,8 @@ struct rt_task {
61 unsigned int cpu; 77 unsigned int cpu;
62 unsigned int priority; 78 unsigned int priority;
63 task_class_t cls; 79 task_class_t cls;
64 budget_policy_t budget_policy; /* ignored by pfair */ 80 budget_policy_t budget_policy; /* ignored by pfair */
81 release_policy_t release_policy; /* ignored by non-edf */
65}; 82};
66 83
67union np_flag { 84union np_flag {