aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/litmus.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-07-17 17:23:12 -0400
committerGlenn Elliott <gelliott@cs.unc.edu>2012-07-17 17:26:22 -0400
commit1c5a2a2cf3b7c99715fffc96cd80bfb03aef6648 (patch)
treef22a5a79c9baf95174f340b55e68df9a9b55dd7d /litmus/litmus.c
parent1253e42eae22b6439ac9f3027d01740c95b8dcd6 (diff)
Revisions based on review comments.
* Simplified jobs.c. * Fixed bug in density admissions check. * Renamed rdeadline to be relative_deadline.
Diffstat (limited to 'litmus/litmus.c')
-rw-r--r--litmus/litmus.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/litmus/litmus.c b/litmus/litmus.c
index 0ee0926f37d3..19de1201d964 100644
--- a/litmus/litmus.c
+++ b/litmus/litmus.c
@@ -103,8 +103,8 @@ asmlinkage long sys_set_rt_task_param(pid_t pid, struct rt_task __user * param)
103 } 103 }
104 104
105 /* set relative deadline to be implicit if left unspecified */ 105 /* set relative deadline to be implicit if left unspecified */
106 if (tp.rdeadline == 0) 106 if (tp.relative_deadline == 0)
107 tp.rdeadline = tp.period; 107 tp.relative_deadline = tp.period;
108 108
109 if (tp.exec_cost <= 0) 109 if (tp.exec_cost <= 0)
110 goto out_unlock; 110 goto out_unlock;
@@ -112,10 +112,10 @@ asmlinkage long sys_set_rt_task_param(pid_t pid, struct rt_task __user * param)
112 goto out_unlock; 112 goto out_unlock;
113 if (!cpu_online(tp.cpu)) 113 if (!cpu_online(tp.cpu))
114 goto out_unlock; 114 goto out_unlock;
115 if (tp.rdeadline < tp.exec_cost) 115 if (min(tp.relative_deadline, tp.period) < tp.exec_cost) /*density check*/
116 { 116 {
117 printk(KERN_INFO "litmus: real-time task %d rejected " 117 printk(KERN_INFO "litmus: real-time task %d rejected "
118 "because wcet greater than relative deadline\n", pid); 118 "because task density > 1.0\n", pid);
119 goto out_unlock; 119 goto out_unlock;
120 } 120 }
121 if (tp.cls != RT_CLASS_HARD && 121 if (tp.cls != RT_CLASS_HARD &&
@@ -325,12 +325,14 @@ long litmus_admit_task(struct task_struct* tsk)
325 325
326 BUG_ON(is_realtime(tsk)); 326 BUG_ON(is_realtime(tsk));
327 327
328 if (get_rt_rdeadline(tsk) == 0 || 328 if (get_rt_relative_deadline(tsk) == 0 ||
329 get_exec_cost(tsk) > get_rt_rdeadline(tsk)) { 329 get_exec_cost(tsk) >
330 min(get_rt_relative_deadline(tsk), get_period(tsk)) ) {
330 TRACE_TASK(tsk, 331 TRACE_TASK(tsk,
331 "litmus admit: invalid task parameters " 332 "litmus admit: invalid task parameters "
332 "(e = %lu, p = %lu, d = %lu)\n", 333 "(e = %lu, p = %lu, d = %lu)\n",
333 get_exec_cost(tsk), get_rt_period(tsk), get_rt_rdeadline(tsk)); 334 get_exec_cost(tsk), get_rt_period(tsk),
335 get_rt_relative_deadline(tsk));
334 retval = -EINVAL; 336 retval = -EINVAL;
335 goto out; 337 goto out;
336 } 338 }