diff options
| author | Glenn Elliott <gelliott@cs.unc.edu> | 2013-11-26 14:42:45 -0500 |
|---|---|---|
| committer | Glenn Elliott <gelliott@cs.unc.edu> | 2013-11-26 14:42:45 -0500 |
| commit | d6e5eee7b7863d179e95962f0144c3daeba35a44 (patch) | |
| tree | 5de25724dea46139ff06b57b4c92bb04a6fe50c6 | |
| parent | 6ec2bbce01c4d4287504d4d6b1df7c4d3870abce (diff) | |
Add support for job splitting.wip-pgm
This patch adds support for job splittinig schedulers.
The default split factor for jobs is 1 (unchanged behavior).
| -rw-r--r-- | bin/rtspin.c | 7 | ||||
| -rw-r--r-- | src/litmus.c | 1 | ||||
| -rw-r--r-- | src/task.c | 1 |
3 files changed, 8 insertions, 1 deletions
diff --git a/bin/rtspin.c b/bin/rtspin.c index 167741d..224a201 100644 --- a/bin/rtspin.c +++ b/bin/rtspin.c | |||
| @@ -184,7 +184,7 @@ static int job(double exec_time, double program_end, int lock_od, double cs_leng | |||
| 184 | } | 184 | } |
| 185 | } | 185 | } |
| 186 | 186 | ||
| 187 | #define OPTSTR "p:z:c:wlveo:f:s:q:X:L:Q:" | 187 | #define OPTSTR "p:z:c:wlveo:f:s:q:X:L:Q:n:" |
| 188 | int main(int argc, char** argv) | 188 | int main(int argc, char** argv) |
| 189 | { | 189 | { |
| 190 | int ret; | 190 | int ret; |
| @@ -192,6 +192,7 @@ int main(int argc, char** argv) | |||
| 192 | lt_t period; | 192 | lt_t period; |
| 193 | double wcet_ms, period_ms; | 193 | double wcet_ms, period_ms; |
| 194 | unsigned int priority = LITMUS_LOWEST_PRIORITY; | 194 | unsigned int priority = LITMUS_LOWEST_PRIORITY; |
| 195 | int split_factor = 1; | ||
| 195 | int migrate = 0; | 196 | int migrate = 0; |
| 196 | int cluster = 0; | 197 | int cluster = 0; |
| 197 | int cluster_size = 1; | 198 | int cluster_size = 1; |
| @@ -226,6 +227,9 @@ int main(int argc, char** argv) | |||
| 226 | cluster = atoi(optarg); | 227 | cluster = atoi(optarg); |
| 227 | migrate = 1; | 228 | migrate = 1; |
| 228 | break; | 229 | break; |
| 230 | case 'n': | ||
| 231 | split_factor = atoi(optarg); | ||
| 232 | break; | ||
| 229 | case 'z': | 233 | case 'z': |
| 230 | cluster_size = atoi(optarg); | 234 | cluster_size = atoi(optarg); |
| 231 | break; | 235 | break; |
| @@ -334,6 +338,7 @@ int main(int argc, char** argv) | |||
| 334 | init_rt_task_param(¶m); | 338 | init_rt_task_param(¶m); |
| 335 | param.exec_cost = wcet; | 339 | param.exec_cost = wcet; |
| 336 | param.period = period; | 340 | param.period = period; |
| 341 | param.split = split_factor; | ||
| 337 | param.priority = priority; | 342 | param.priority = priority; |
| 338 | param.cls = class; | 343 | param.cls = class; |
| 339 | param.budget_policy = (want_enforcement) ? | 344 | param.budget_policy = (want_enforcement) ? |
diff --git a/src/litmus.c b/src/litmus.c index dce8e1b..febd7ed 100644 --- a/src/litmus.c +++ b/src/litmus.c | |||
| @@ -103,6 +103,7 @@ void init_rt_task_param(struct rt_task* tp) | |||
| 103 | tp->priority = LITMUS_LOWEST_PRIORITY; | 103 | tp->priority = LITMUS_LOWEST_PRIORITY; |
| 104 | tp->budget_policy = NO_ENFORCEMENT; | 104 | tp->budget_policy = NO_ENFORCEMENT; |
| 105 | tp->release_policy = TASK_SPORADIC; | 105 | tp->release_policy = TASK_SPORADIC; |
| 106 | tp->split = 1; | ||
| 106 | } | 107 | } |
| 107 | 108 | ||
| 108 | task_class_t str2class(const char* str) | 109 | task_class_t str2class(const char* str) |
| @@ -49,6 +49,7 @@ int __create_rt_task(rt_fn_t rt_prog, void *arg, int cluster, int cluster_size, | |||
| 49 | params.exec_cost = wcet; | 49 | params.exec_cost = wcet; |
| 50 | params.cls = class; | 50 | params.cls = class; |
| 51 | params.phase = 0; | 51 | params.phase = 0; |
| 52 | params.split = 1; | ||
| 52 | params.priority = priority; | 53 | params.priority = priority; |
| 53 | /* enforce budget for tasks that might not use sleep_next_period() */ | 54 | /* enforce budget for tasks that might not use sleep_next_period() */ |
| 54 | params.budget_policy = QUANTUM_ENFORCEMENT; | 55 | params.budget_policy = QUANTUM_ENFORCEMENT; |
