aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/aux_tasks.c
diff options
context:
space:
mode:
Diffstat (limited to 'litmus/aux_tasks.c')
-rwxr-xr-xlitmus/aux_tasks.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/litmus/aux_tasks.c b/litmus/aux_tasks.c
index e5f3c82d32e9..20f477f6e3bc 100755
--- a/litmus/aux_tasks.c
+++ b/litmus/aux_tasks.c
@@ -6,12 +6,16 @@
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
9#include <linux/time.h>
10
11#define AUX_SLICE_NR_JIFFIES 1
12#define AUX_SLICE_NS ((NSEC_PER_SEC / HZ) * AUX_SLICE_NR_JIFFIES)
13
9static int admit_aux_task(struct task_struct *t) 14static int admit_aux_task(struct task_struct *t)
10{ 15{
11 int retval = 0; 16 int retval = 0;
12 struct task_struct *leader = t->group_leader; 17 struct task_struct *leader = t->group_leader;
13 18
14
15 /* budget enforcement increments job numbers. job numbers are used in 19 /* budget enforcement increments job numbers. job numbers are used in
16 * tie-breaking of aux_tasks. method helps ensure: 20 * tie-breaking of aux_tasks. method helps ensure:
17 * 1) aux threads with no inherited priority can starve another (they share 21 * 1) aux threads with no inherited priority can starve another (they share
@@ -23,9 +27,9 @@ static int admit_aux_task(struct task_struct *t)
23 * fail-safe. 27 * fail-safe.
24 */ 28 */
25 struct rt_task tp = { 29 struct rt_task tp = {
26 .period = 1000000, /* 1ms */ 30 .period = AUX_SLICE_NS,
27 .relative_deadline = 1000000, 31 .relative_deadline = AUX_SLICE_NS,
28 .exec_cost = 1000000, /* allow full utilization with buget tracking */ 32 .exec_cost = AUX_SLICE_NS, /* allow full utilization with buget tracking */
29 .phase = 0, 33 .phase = 0,
30 .cpu = task_cpu(leader), /* take CPU of group leader */ 34 .cpu = task_cpu(leader), /* take CPU of group leader */
31 .budget_policy = QUANTUM_ENFORCEMENT, 35 .budget_policy = QUANTUM_ENFORCEMENT,