aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2013-05-19 22:31:49 -0400
committerGlenn Elliott <gelliott@cs.unc.edu>2013-05-19 22:31:49 -0400
commite8768d1ca3abd748be9e25c8899b9631c501f00f (patch)
tree248c14a2122d4c9da43f0aaa66a9f199758cb214
parent5f73f6b75bb8d37de13eea4278b36a3767e6ef5a (diff)
Final RTSS version
-rw-r--r--litmus/fifo_lock.c1
-rw-r--r--litmus/gpu_affinity.c4
-rw-r--r--litmus/ikglp_lock.c4
-rw-r--r--litmus/litmus.c13
-rw-r--r--litmus/locking.c5
5 files changed, 18 insertions, 9 deletions
diff --git a/litmus/fifo_lock.c b/litmus/fifo_lock.c
index ebb915621e9c..7bd6dafeb9fa 100644
--- a/litmus/fifo_lock.c
+++ b/litmus/fifo_lock.c
@@ -330,6 +330,7 @@ int fifo_mutex_unlock(struct litmus_lock* l)
330 int err = 0; 330 int err = 0;
331 331
332 if (mutex->owner != t) { 332 if (mutex->owner != t) {
333 TRACE_TASK(t, "does not hold fifo mutex %d\n", l->ident);
333 err = -EINVAL; 334 err = -EINVAL;
334 return err; 335 return err;
335 } 336 }
diff --git a/litmus/gpu_affinity.c b/litmus/gpu_affinity.c
index 3e76cd1e2291..e59814b998d3 100644
--- a/litmus/gpu_affinity.c
+++ b/litmus/gpu_affinity.c
@@ -16,8 +16,8 @@
16//#define HI_THRESHOLD 2 16//#define HI_THRESHOLD 2
17//#define LO_THRESHOLD 4 17//#define LO_THRESHOLD 4
18 18
19#define NUM_STDEV_NUM 3 19#define NUM_STDEV_NUM 2
20#define NUM_STDEV_DENOM 2 20#define NUM_STDEV_DENOM 1
21 21
22#define MIN(a, b) ((a < b) ? a : b) 22#define MIN(a, b) ((a < b) ? a : b)
23 23
diff --git a/litmus/ikglp_lock.c b/litmus/ikglp_lock.c
index 71d3c3392b16..b7ed08be3744 100644
--- a/litmus/ikglp_lock.c
+++ b/litmus/ikglp_lock.c
@@ -937,6 +937,7 @@ static void __ikglp_enqueue_on_fq(struct ikglp_semaphore *sem,
937 937
938 wait->cur_q = IKGLP_FQ; 938 wait->cur_q = IKGLP_FQ;
939 wait->fq = fq; 939 wait->fq = fq;
940 mb();
940 941
941 TRACE_TASK(t, "shortest queue is now %d\n", ikglp_get_idx(sem, fq)); 942 TRACE_TASK(t, "shortest queue is now %d\n", ikglp_get_idx(sem, fq));
942} 943}
@@ -1250,8 +1251,6 @@ int ikglp_lock(struct litmus_lock* l)
1250 1251
1251 fq = wait.fq; 1252 fq = wait.fq;
1252 1253
1253 BUG_ON(fq != ikglp_get_queue(sem, t));
1254
1255 tsk_rt(t)->blocked_lock_data = 0; 1254 tsk_rt(t)->blocked_lock_data = 0;
1256 1255
1257 replica = ikglp_get_idx(sem, fq); 1256 replica = ikglp_get_idx(sem, fq);
@@ -1825,6 +1824,7 @@ int ikglp_unlock(struct litmus_lock* l)
1825 fq = ikglp_get_queue(sem, t); // returns NULL if 't' is not owner. 1824 fq = ikglp_get_queue(sem, t); // returns NULL if 't' is not owner.
1826 1825
1827 if (!fq) { 1826 if (!fq) {
1827 TRACE_TASK(t, "does not hold a replica of lock %d\n", l->ident);
1828 err = -EINVAL; 1828 err = -EINVAL;
1829 goto out; 1829 goto out;
1830 } 1830 }
diff --git a/litmus/litmus.c b/litmus/litmus.c
index 924853c82343..ceaa31405884 100644
--- a/litmus/litmus.c
+++ b/litmus/litmus.c
@@ -93,6 +93,7 @@ asmlinkage long sys_set_rt_task_param(pid_t pid, struct rt_task __user * param)
93 printk("Setting up rt task parameters for process %d.\n", pid); 93 printk("Setting up rt task parameters for process %d.\n", pid);
94 94
95 if (pid < 0 || param == 0) { 95 if (pid < 0 || param == 0) {
96 printk("Invalid pid or NULL params\n");
96 goto out; 97 goto out;
97 } 98 }
98 if (copy_from_user(&tp, param, sizeof(tp))) { 99 if (copy_from_user(&tp, param, sizeof(tp))) {
@@ -119,12 +120,18 @@ asmlinkage long sys_set_rt_task_param(pid_t pid, struct rt_task __user * param)
119 if (tp.relative_deadline == 0) 120 if (tp.relative_deadline == 0)
120 tp.relative_deadline = tp.period; 121 tp.relative_deadline = tp.period;
121 122
122 if (tp.exec_cost <= 0) 123 if (tp.exec_cost <= 0) {
124 printk(KERN_INFO "invalid execution cost\n");
123 goto out_unlock; 125 goto out_unlock;
124 if (tp.period <= 0) 126 }
127 if (tp.period <= 0) {
128 printk(KERN_INFO "invalid period\n");
125 goto out_unlock; 129 goto out_unlock;
126 if (!cpu_online(tp.cpu)) 130 }
131 if (!cpu_online(tp.cpu)) {
132 printk(KERN_INFO "requested CPU is offline.\n");
127 goto out_unlock; 133 goto out_unlock;
134 }
128 if (min(tp.relative_deadline, tp.period) < tp.exec_cost) /*density check*/ 135 if (min(tp.relative_deadline, tp.period) < tp.exec_cost) /*density check*/
129 { 136 {
130 printk(KERN_INFO "litmus: real-time task %d rejected " 137 printk(KERN_INFO "litmus: real-time task %d rejected "
diff --git a/litmus/locking.c b/litmus/locking.c
index f1673535f114..513b5d3844c8 100644
--- a/litmus/locking.c
+++ b/litmus/locking.c
@@ -943,8 +943,9 @@ int wake_up_for_lock(struct task_struct* t)
943int flush_pending_wakes() 943int flush_pending_wakes()
944{ 944{
945 int count = 0, i; 945 int count = 0, i;
946 946 wake_queue_t *q;
947 wake_queue_t *q = &per_cpu(wqueues, smp_processor_id()); 947
948 q = &per_cpu(wqueues, smp_processor_id());
948 for(i = 0; i < q->count; ++i) 949 for(i = 0; i < q->count; ++i)
949 { 950 {
950 if (q->to_wake[i]) { 951 if (q->to_wake[i]) {