aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/litmus.c
diff options
context:
space:
mode:
Diffstat (limited to 'litmus/litmus.c')
-rw-r--r--litmus/litmus.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/litmus/litmus.c b/litmus/litmus.c
index 301390148d02..81384327e850 100644
--- a/litmus/litmus.c
+++ b/litmus/litmus.c
@@ -102,21 +102,25 @@ asmlinkage long sys_set_rt_task_param(pid_t pid, struct rt_task __user * param)
102 goto out_unlock; 102 goto out_unlock;
103 } 103 }
104 104
105 /* set relative deadline to be implicit if left unspecified */
106 if (tp.relative_deadline == 0)
107 tp.relative_deadline = tp.period;
108
105 if (tp.exec_cost <= 0) 109 if (tp.exec_cost <= 0)
106 goto out_unlock; 110 goto out_unlock;
107 if (tp.period <= 0) 111 if (tp.period <= 0)
108 goto out_unlock; 112 goto out_unlock;
109 if (!cpu_online(tp.cpu)) 113 if (!cpu_online(tp.cpu))
110 goto out_unlock; 114 goto out_unlock;
111 if (tp.period < tp.exec_cost) 115 if (min(tp.relative_deadline, tp.period) < tp.exec_cost) /*density check*/
112 { 116 {
113 printk(KERN_INFO "litmus: real-time task %d rejected " 117 printk(KERN_INFO "litmus: real-time task %d rejected "
114 "because wcet > period\n", pid); 118 "because task density > 1.0\n", pid);
115 goto out_unlock; 119 goto out_unlock;
116 } 120 }
117 if ( tp.cls != RT_CLASS_HARD && 121 if (tp.cls != RT_CLASS_HARD &&
118 tp.cls != RT_CLASS_SOFT && 122 tp.cls != RT_CLASS_SOFT &&
119 tp.cls != RT_CLASS_BEST_EFFORT) 123 tp.cls != RT_CLASS_BEST_EFFORT)
120 { 124 {
121 printk(KERN_INFO "litmus: real-time task %d rejected " 125 printk(KERN_INFO "litmus: real-time task %d rejected "
122 "because its class is invalid\n", pid); 126 "because its class is invalid\n", pid);
@@ -321,11 +325,14 @@ long litmus_admit_task(struct task_struct* tsk)
321 325
322 BUG_ON(is_realtime(tsk)); 326 BUG_ON(is_realtime(tsk));
323 327
324 if (get_rt_period(tsk) == 0 || 328 if (get_rt_relative_deadline(tsk) == 0 ||
325 get_exec_cost(tsk) > get_rt_period(tsk)) { 329 get_exec_cost(tsk) >
326 TRACE_TASK(tsk, "litmus admit: invalid task parameters " 330 min(get_rt_relative_deadline(tsk), get_rt_period(tsk)) ) {
327 "(%lu, %lu)\n", 331 TRACE_TASK(tsk,
328 get_exec_cost(tsk), get_rt_period(tsk)); 332 "litmus admit: invalid task parameters "
333 "(e = %lu, p = %lu, d = %lu)\n",
334 get_exec_cost(tsk), get_rt_period(tsk),
335 get_rt_relative_deadline(tsk));
329 retval = -EINVAL; 336 retval = -EINVAL;
330 goto out; 337 goto out;
331 } 338 }