aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2013-03-06 13:19:53 -0500
committerBjoern Brandenburg <bbb@mpi-sws.org>2013-03-12 10:29:37 -0400
commitf4ffe0719dfc150ee182f308d31a226b034f206b (patch)
tree0ffbaebcb08675ae4dda42711a8122c82254ff31 /include
parent181b6bb0f5f122741262edc7ac0eca86d3f6dd73 (diff)
Differentiate between PERIODIC and SPORADIC tasks.
Tasks can now be PERIODIC or SPORADIC. PERIODIC tasks do not have their job number incremented when they wake up and are tardy. PERIODIC jobs must end with a call to sys_complete_job() to set up their next release. (Not currently supported by pfair.) SPORADIC tasks _do_ have their job number incremented when they wake up and are tardy. SPORADIC is the default task behavior, carrying forward Litmus's current behavior.
Diffstat (limited to 'include')
-rw-r--r--include/litmus/litmus.h8
-rw-r--r--include/litmus/rt_param.h18
2 files changed, 16 insertions, 10 deletions
diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h
index 81f6a499570b..c9206adb3493 100644
--- a/include/litmus/litmus.h
+++ b/include/litmus/litmus.h
@@ -56,6 +56,7 @@ void litmus_exit_task(struct task_struct *tsk);
56#define get_partition(t) (tsk_rt(t)->task_params.cpu) 56#define get_partition(t) (tsk_rt(t)->task_params.cpu)
57#define get_priority(t) (tsk_rt(t)->task_params.priority) 57#define get_priority(t) (tsk_rt(t)->task_params.priority)
58#define get_class(t) (tsk_rt(t)->task_params.cls) 58#define get_class(t) (tsk_rt(t)->task_params.cls)
59#define get_release_policy(t) (tsk_rt(t)->task_params.release_policy)
59 60
60/* job_param macros */ 61/* job_param macros */
61#define get_exec_time(t) (tsk_rt(t)->job_params.exec_time) 62#define get_exec_time(t) (tsk_rt(t)->job_params.exec_time)
@@ -63,10 +64,13 @@ void litmus_exit_task(struct task_struct *tsk);
63#define get_release(t) (tsk_rt(t)->job_params.release) 64#define get_release(t) (tsk_rt(t)->job_params.release)
64#define get_lateness(t) (tsk_rt(t)->job_params.lateness) 65#define get_lateness(t) (tsk_rt(t)->job_params.lateness)
65 66
67/* release policy macros */
68#define is_periodic(t) (get_release_policy(t) == PERIODIC)
69#define is_sporadic(t) (get_release_policy(t) == SPORADIC)
66#ifdef CONFIG_ALLOW_EARLY_RELEASE 70#ifdef CONFIG_ALLOW_EARLY_RELEASE
67#define wants_early_release(t) (tsk_rt(t)->task_params.release_policy == EARLY) 71#define is_early_releasing(t) (get_release_policy(t) == EARLY)
68#else 72#else
69#define wants_early_release(t) (0) 73#define is_early_releasing(t) (0)
70#endif 74#endif
71 75
72#define is_hrt(t) \ 76#define is_hrt(t) \
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h
index 4167508d9862..a16ac84d8043 100644
--- a/include/litmus/rt_param.h
+++ b/include/litmus/rt_param.h
@@ -33,19 +33,21 @@ 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
36/* Release behaviors for jobs. PERIODIC and EARLY jobs
37 must end by calling sys_complete_job() (or equivalent)
38 to set up their next release and deadline. */
36typedef enum { 39typedef enum {
40 /* Jobs are released sporadically (provided job precedence
41 constraints are met). */
42 SPORADIC,
43
37 /* Jobs are released periodically (provided job precedence 44 /* Jobs are released periodically (provided job precedence
38 constraints are met). */ 45 constraints are met). */
39 PERIODIC, 46 PERIODIC,
40 47
41 /* Jobs are released sporadically (provided job precedence 48 /* Jobs are released immediately after meeting 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 49 constraints. Beware this can peg your CPUs if used in
48 the wrong applications. */ 50 the wrong applications. Only supported by EDF schedulers. */
49 EARLY 51 EARLY
50} release_policy_t; 52} release_policy_t;
51 53
@@ -78,7 +80,7 @@ struct rt_task {
78 unsigned int priority; 80 unsigned int priority;
79 task_class_t cls; 81 task_class_t cls;
80 budget_policy_t budget_policy; /* ignored by pfair */ 82 budget_policy_t budget_policy; /* ignored by pfair */
81 release_policy_t release_policy; /* ignored by non-edf */ 83 release_policy_t release_policy;
82}; 84};
83 85
84union np_flag { 86union np_flag {