diff options
author | Christopher Kenna <cjk@cs.unc.edu> | 2011-08-27 17:48:58 -0400 |
---|---|---|
committer | Christopher Kenna <cjk@cs.unc.edu> | 2011-08-27 17:48:58 -0400 |
commit | 1c5cda5df118735a0e84fd3277d933f58ea814c8 (patch) | |
tree | 07a21bb5d91803651cd88667afe968db80bf2634 /include | |
parent | 0e059210db4aef3ed1cff173652c23f257ccfa20 (diff) |
Refactor the mixed-criticality (MC) plugin.
Add linux kernel configuration option CONFIG_LITMUS_MC.
Attempt to restore rt_param.h to its original state as much as possible.
Remove fields from rt_task and rt_job and move them into a new mc_data
struct. Added mc_data field to rt_param compiled in only if using MC
plugin.
Make a new MC plugin specific header that contains a mc_data struct,
which is a container for mc_task struct and a mc_job struct.
Update sched_mc.c to use the new data structures. Also, add some macros
that simplify the code, e.g., getting task criticality quickly.
Add system call to set MC plugin specific stuff. Check for the change in
liblitmus.
Add a few lines to exit_litmus to reclaim the MC plugin mc_data struct
in the task_struct on task exit.
Diffstat (limited to 'include')
-rw-r--r-- | include/litmus/rt_param.h | 20 | ||||
-rw-r--r-- | include/litmus/sched_mc.h | 36 | ||||
-rw-r--r-- | include/litmus/unistd_32.h | 3 | ||||
-rw-r--r-- | include/litmus/unistd_64.h | 4 |
4 files changed, 49 insertions, 14 deletions
diff --git a/include/litmus/rt_param.h b/include/litmus/rt_param.h index 3a456e7135d8..4ded23d658d0 100644 --- a/include/litmus/rt_param.h +++ b/include/litmus/rt_param.h | |||
@@ -27,14 +27,6 @@ typedef enum { | |||
27 | RT_CLASS_BEST_EFFORT | 27 | RT_CLASS_BEST_EFFORT |
28 | } task_class_t; | 28 | } task_class_t; |
29 | 29 | ||
30 | /* criticality levels */ | ||
31 | typedef enum { | ||
32 | CRIT_LEVEL_A, | ||
33 | CRIT_LEVEL_B, | ||
34 | CRIT_LEVEL_C, | ||
35 | CRIT_LEVEL_D, | ||
36 | } crit_level_t; | ||
37 | |||
38 | typedef enum { | 30 | typedef enum { |
39 | NO_ENFORCEMENT, /* job may overrun unhindered */ | 31 | NO_ENFORCEMENT, /* job may overrun unhindered */ |
40 | QUANTUM_ENFORCEMENT, /* budgets are only checked on quantum boundaries */ | 32 | QUANTUM_ENFORCEMENT, /* budgets are only checked on quantum boundaries */ |
@@ -48,7 +40,6 @@ struct rt_task { | |||
48 | unsigned int cpu; | 40 | unsigned int cpu; |
49 | task_class_t cls; | 41 | task_class_t cls; |
50 | budget_policy_t budget_policy; /* ignored by pfair */ | 42 | budget_policy_t budget_policy; /* ignored by pfair */ |
51 | crit_level_t crit; | ||
52 | }; | 43 | }; |
53 | 44 | ||
54 | /* The definition of the data that is shared between the kernel and real-time | 45 | /* The definition of the data that is shared between the kernel and real-time |
@@ -99,12 +90,12 @@ struct rt_job { | |||
99 | * Increase this sequence number when a job is released. | 90 | * Increase this sequence number when a job is released. |
100 | */ | 91 | */ |
101 | unsigned int job_no; | 92 | unsigned int job_no; |
102 | |||
103 | lt_t ghost_budget; | ||
104 | int is_ghost; | ||
105 | }; | 93 | }; |
106 | 94 | ||
107 | struct pfair_param; | 95 | struct pfair_param; |
96 | #ifdef CONFIG_PLUGIN_MC | ||
97 | struct mc_data; | ||
98 | #endif | ||
108 | 99 | ||
109 | /* RT task parameters for scheduling extensions | 100 | /* RT task parameters for scheduling extensions |
110 | * These parameters are inherited during clone and therefore must | 101 | * These parameters are inherited during clone and therefore must |
@@ -127,6 +118,11 @@ struct rt_param { | |||
127 | lt_t boost_start_time; | 118 | lt_t boost_start_time; |
128 | #endif | 119 | #endif |
129 | 120 | ||
121 | #ifdef CONFIG_PLUGIN_MC | ||
122 | /* mixed criticality specific data */ | ||
123 | struct mc_data *mc_data; | ||
124 | #endif | ||
125 | |||
130 | /* user controlled parameters */ | 126 | /* user controlled parameters */ |
131 | struct rt_task task_params; | 127 | struct rt_task task_params; |
132 | 128 | ||
diff --git a/include/litmus/sched_mc.h b/include/litmus/sched_mc.h new file mode 100644 index 000000000000..941a9f4470cc --- /dev/null +++ b/include/litmus/sched_mc.h | |||
@@ -0,0 +1,36 @@ | |||
1 | #ifndef _LINUX_SCHED_MC_H_ | ||
2 | #define _LINUX_SCHED_MC_H_ | ||
3 | |||
4 | #include <litmus/rt_param.h> | ||
5 | |||
6 | /* criticality levels */ | ||
7 | enum crit_level { | ||
8 | /* probably don't need to assign these (paranoid) */ | ||
9 | CRIT_LEVEL_A = 0, | ||
10 | CRIT_LEVEL_B = 1, | ||
11 | CRIT_LEVEL_C = 2, | ||
12 | CRIT_LEVEL_D = 3, | ||
13 | NUM_CRIT_LEVELS = 4, | ||
14 | }; | ||
15 | |||
16 | |||
17 | struct mc_task { | ||
18 | enum crit_level crit; | ||
19 | }; | ||
20 | |||
21 | struct mc_job { | ||
22 | int is_ghost:1; | ||
23 | lt_t ghost_budget; | ||
24 | }; | ||
25 | |||
26 | #ifdef __KERNEL__ | ||
27 | /* only used in the kernel (no user space) */ | ||
28 | |||
29 | struct mc_data { | ||
30 | struct mc_task mc_task; | ||
31 | struct mc_job mc_job; | ||
32 | }; | ||
33 | |||
34 | #endif /* __KERNEL__ */ | ||
35 | |||
36 | #endif | ||
diff --git a/include/litmus/unistd_32.h b/include/litmus/unistd_32.h index 94264c27d9ac..71be3cd8d469 100644 --- a/include/litmus/unistd_32.h +++ b/include/litmus/unistd_32.h | |||
@@ -17,5 +17,6 @@ | |||
17 | #define __NR_wait_for_ts_release __LSC(9) | 17 | #define __NR_wait_for_ts_release __LSC(9) |
18 | #define __NR_release_ts __LSC(10) | 18 | #define __NR_release_ts __LSC(10) |
19 | #define __NR_null_call __LSC(11) | 19 | #define __NR_null_call __LSC(11) |
20 | #define __NR_set_rt_task_mc_param __LSC(12) | ||
20 | 21 | ||
21 | #define NR_litmus_syscalls 12 | 22 | #define NR_litmus_syscalls 13 |
diff --git a/include/litmus/unistd_64.h b/include/litmus/unistd_64.h index d5ced0d2642c..95cb74495104 100644 --- a/include/litmus/unistd_64.h +++ b/include/litmus/unistd_64.h | |||
@@ -29,5 +29,7 @@ __SYSCALL(__NR_wait_for_ts_release, sys_wait_for_ts_release) | |||
29 | __SYSCALL(__NR_release_ts, sys_release_ts) | 29 | __SYSCALL(__NR_release_ts, sys_release_ts) |
30 | #define __NR_null_call __LSC(11) | 30 | #define __NR_null_call __LSC(11) |
31 | __SYSCALL(__NR_null_call, sys_null_call) | 31 | __SYSCALL(__NR_null_call, sys_null_call) |
32 | #define __NR_set_rt_task_mc_param __LSC(12) | ||
33 | __SYSCALL(__NR_set_rt_task_mc_param, sys_set_rt_task_mc_param) | ||
32 | 34 | ||
33 | #define NR_litmus_syscalls 12 | 35 | #define NR_litmus_syscalls 13 |