diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-09-16 18:29:36 -0400 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-09-16 18:29:36 -0400 |
commit | c58a74c8ad2d2b1b01be12afb9bac58dfef0d16a (patch) | |
tree | 60dbed545715ecf91ab7409789c1a9effd791348 /litmus/aux_tasks.c | |
parent | 4e8f9b7c2e9134ca31feb91dee3609a95df6de56 (diff) |
Added CONFIG_REALTIME_AUX_TASKS option
Auxillary task features were enabled by CONFIG_LITMUS_LOCKING.
Made auxillary tasks a seperate feature that depends upon
CONFIG_LITMUS_LOCKING.
Diffstat (limited to 'litmus/aux_tasks.c')
-rw-r--r-- | litmus/aux_tasks.c | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/litmus/aux_tasks.c b/litmus/aux_tasks.c index 5057137bbbea..b0617accdf7f 100644 --- a/litmus/aux_tasks.c +++ b/litmus/aux_tasks.c | |||
@@ -1,8 +1,8 @@ | |||
1 | #ifdef CONFIG_LITMUS_LOCKING | ||
2 | |||
3 | #include <litmus/sched_plugin.h> | 1 | #include <litmus/sched_plugin.h> |
4 | #include <litmus/trace.h> | 2 | #include <litmus/trace.h> |
5 | #include <litmus/litmus.h> | 3 | #include <litmus/litmus.h> |
4 | |||
5 | #ifdef CONFIG_REALTIME_AUX_TASKS | ||
6 | #include <litmus/rt_param.h> | 6 | #include <litmus/rt_param.h> |
7 | #include <litmus/aux_tasks.h> | 7 | #include <litmus/aux_tasks.h> |
8 | 8 | ||
@@ -23,14 +23,11 @@ static int admit_aux_task(struct task_struct *t) | |||
23 | * fail-safe. | 23 | * fail-safe. |
24 | */ | 24 | */ |
25 | struct rt_task tp = { | 25 | struct rt_task tp = { |
26 | //.period = MAGIC_AUX_TASK_PERIOD, | 26 | .period = 1000000, /* 1ms */ |
27 | //.relative_deadline = MAGIC_AUX_TASK_PERIOD, | ||
28 | .period = 1000000, /* has to wait 1 ms before it can run again once it has exhausted budget */ | ||
29 | .relative_deadline = 1000000, | 27 | .relative_deadline = 1000000, |
30 | .exec_cost = 1000000, /* allow full utilization */ | 28 | .exec_cost = 1000000, /* allow full utilization */ |
31 | .phase = 0, | 29 | .phase = 0, |
32 | .cpu = task_cpu(leader), /* take CPU of group leader */ | 30 | .cpu = task_cpu(leader), /* take CPU of group leader */ |
33 | //.budget_policy = NO_ENFORCEMENT, | ||
34 | .budget_policy = QUANTUM_ENFORCEMENT, | 31 | .budget_policy = QUANTUM_ENFORCEMENT, |
35 | .budget_signal_policy = NO_SIGNALS, | 32 | .budget_signal_policy = NO_SIGNALS, |
36 | .cls = RT_CLASS_BEST_EFFORT | 33 | .cls = RT_CLASS_BEST_EFFORT |
@@ -280,7 +277,7 @@ static int aux_task_owner_max_priority_order(struct binheap_node *a, | |||
280 | } | 277 | } |
281 | 278 | ||
282 | 279 | ||
283 | static long __do_enable_slave_non_rt_threads(void) | 280 | static long __do_enable_aux_tasks(void) |
284 | { | 281 | { |
285 | long retval = 0; | 282 | long retval = 0; |
286 | struct task_struct *leader; | 283 | struct task_struct *leader; |
@@ -344,7 +341,7 @@ static long __do_enable_slave_non_rt_threads(void) | |||
344 | return retval; | 341 | return retval; |
345 | } | 342 | } |
346 | 343 | ||
347 | static long __do_disable_slave_non_rt_threads(void) | 344 | static long __do_disable_aux_tasks(void) |
348 | { | 345 | { |
349 | long retval = 0; | 346 | long retval = 0; |
350 | struct task_struct *leader; | 347 | struct task_struct *leader; |
@@ -385,17 +382,17 @@ static long __do_disable_slave_non_rt_threads(void) | |||
385 | return retval; | 382 | return retval; |
386 | } | 383 | } |
387 | 384 | ||
388 | asmlinkage long sys_slave_non_rt_threads(int enable) | 385 | asmlinkage long sys_set_aux_tasks(int enable) |
389 | { | 386 | { |
390 | long retval; | 387 | long retval; |
391 | 388 | ||
392 | read_lock_irq(&tasklist_lock); | 389 | read_lock_irq(&tasklist_lock); |
393 | 390 | ||
394 | if (enable) { | 391 | if (enable) { |
395 | retval = __do_enable_slave_non_rt_threads(); | 392 | retval = __do_enable_aux_tasks(); |
396 | } | 393 | } |
397 | else { | 394 | else { |
398 | retval = __do_disable_slave_non_rt_threads(); | 395 | retval = __do_disable_aux_tasks(); |
399 | } | 396 | } |
400 | 397 | ||
401 | read_unlock_irq(&tasklist_lock); | 398 | read_unlock_irq(&tasklist_lock); |
@@ -405,9 +402,9 @@ asmlinkage long sys_slave_non_rt_threads(int enable) | |||
405 | 402 | ||
406 | #else | 403 | #else |
407 | 404 | ||
408 | asmlinkage long sys_slave_non_rt_tasks(int enable) | 405 | asmlinkage long sys_set_aux_tasks(int enable) |
409 | { | 406 | { |
410 | printk("Unsupported. Recompile with CONFIG_LITMUS_LOCKING.\n"); | 407 | printk("Unsupported. Recompile with CONFIG_REALTIME_AUX_TASKS.\n"); |
411 | return -EINVAL; | 408 | return -EINVAL; |
412 | } | 409 | } |
413 | 410 | ||