diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2011-05-24 22:05:14 -0400 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2011-05-24 22:05:14 -0400 |
commit | 78eaa72a6d6d39bdc567a1dee29a5f31fbae863b (patch) | |
tree | 8f60b73d384aa826790e0fc7d39144cd56b358e6 | |
parent | d0598c54028251a018650665043156266664e0bf (diff) | |
parent | 7d754596756240fa918b94cd0c3011c77a638987 (diff) |
Merge branch 'master' of ssh://cvs.cs.unc.edu/cvs/proj/litmus/repo/litmus2010 into wip-edf-hsb
-rw-r--r-- | include/litmus/litmus.h | 2 | ||||
-rw-r--r-- | litmus/litmus.c | 8 | ||||
-rw-r--r-- | litmus/locking.c | 12 | ||||
-rw-r--r-- | litmus/sched_gsn_edf.c | 4 | ||||
-rw-r--r-- | litmus/sched_psn_edf.c | 6 |
5 files changed, 18 insertions, 14 deletions
diff --git a/include/litmus/litmus.h b/include/litmus/litmus.h index 94086e2b38db..e7769ca36ec0 100644 --- a/include/litmus/litmus.h +++ b/include/litmus/litmus.h | |||
@@ -26,7 +26,7 @@ static inline int in_list(struct list_head* list) | |||
26 | ); | 26 | ); |
27 | } | 27 | } |
28 | 28 | ||
29 | struct task_struct* waitqueue_first(wait_queue_head_t *wq); | 29 | struct task_struct* __waitqueue_remove_first(wait_queue_head_t *wq); |
30 | 30 | ||
31 | #define NO_CPU 0xffffffff | 31 | #define NO_CPU 0xffffffff |
32 | 32 | ||
diff --git a/litmus/litmus.c b/litmus/litmus.c index 657b4eda96e6..64f82aa0e246 100644 --- a/litmus/litmus.c +++ b/litmus/litmus.c | |||
@@ -111,6 +111,14 @@ asmlinkage long sys_set_rt_task_param(pid_t pid, struct rt_task __user * param) | |||
111 | "because wcet > period\n", pid); | 111 | "because wcet > period\n", pid); |
112 | goto out_unlock; | 112 | goto out_unlock; |
113 | } | 113 | } |
114 | if ( tp.cls != RT_CLASS_HARD && | ||
115 | tp.cls != RT_CLASS_SOFT && | ||
116 | tp.cls != RT_CLASS_BEST_EFFORT) | ||
117 | { | ||
118 | printk(KERN_INFO "litmus: real-time task %d rejected " | ||
119 | "because its class is invalid\n"); | ||
120 | goto out_unlock; | ||
121 | } | ||
114 | if (tp.budget_policy != NO_ENFORCEMENT && | 122 | if (tp.budget_policy != NO_ENFORCEMENT && |
115 | tp.budget_policy != QUANTUM_ENFORCEMENT && | 123 | tp.budget_policy != QUANTUM_ENFORCEMENT && |
116 | tp.budget_policy != PRECISE_ENFORCEMENT) | 124 | tp.budget_policy != PRECISE_ENFORCEMENT) |
diff --git a/litmus/locking.c b/litmus/locking.c index 728b56835cf7..2693f1aca859 100644 --- a/litmus/locking.c +++ b/litmus/locking.c | |||
@@ -107,16 +107,18 @@ asmlinkage long sys_litmus_unlock(int lock_od) | |||
107 | return err; | 107 | return err; |
108 | } | 108 | } |
109 | 109 | ||
110 | struct task_struct* waitqueue_first(wait_queue_head_t *wq) | 110 | struct task_struct* __waitqueue_remove_first(wait_queue_head_t *wq) |
111 | { | 111 | { |
112 | wait_queue_t *q; | 112 | wait_queue_t* q; |
113 | struct task_struct* t = NULL; | ||
113 | 114 | ||
114 | if (waitqueue_active(wq)) { | 115 | if (waitqueue_active(wq)) { |
115 | q = list_entry(wq->task_list.next, | 116 | q = list_entry(wq->task_list.next, |
116 | wait_queue_t, task_list); | 117 | wait_queue_t, task_list); |
117 | return (struct task_struct*) q->private; | 118 | t = (struct task_struct*) q->private; |
118 | } else | 119 | __remove_wait_queue(wq, q); |
119 | return NULL; | 120 | } |
121 | return(t); | ||
120 | } | 122 | } |
121 | 123 | ||
122 | 124 | ||
diff --git a/litmus/sched_gsn_edf.c b/litmus/sched_gsn_edf.c index 2a649beed791..3092797480f8 100644 --- a/litmus/sched_gsn_edf.c +++ b/litmus/sched_gsn_edf.c | |||
@@ -778,8 +778,6 @@ int gsnedf_fmlp_lock(struct litmus_lock* l) | |||
778 | * ->owner. We can thus check it without acquiring the spin | 778 | * ->owner. We can thus check it without acquiring the spin |
779 | * lock. */ | 779 | * lock. */ |
780 | BUG_ON(sem->owner != t); | 780 | BUG_ON(sem->owner != t); |
781 | |||
782 | remove_wait_queue(&sem->wait, &wait); | ||
783 | } else { | 781 | } else { |
784 | /* it's ours now */ | 782 | /* it's ours now */ |
785 | sem->owner = t; | 783 | sem->owner = t; |
@@ -805,7 +803,7 @@ int gsnedf_fmlp_unlock(struct litmus_lock* l) | |||
805 | } | 803 | } |
806 | 804 | ||
807 | /* check if there are jobs waiting for this resource */ | 805 | /* check if there are jobs waiting for this resource */ |
808 | next = waitqueue_first(&sem->wait); | 806 | next = __waitqueue_remove_first(&sem->wait); |
809 | if (next) { | 807 | if (next) { |
810 | /* next becomes the resouce holder */ | 808 | /* next becomes the resouce holder */ |
811 | sem->owner = next; | 809 | sem->owner = next; |
diff --git a/litmus/sched_psn_edf.c b/litmus/sched_psn_edf.c index abb06fa53e3a..71c02409efa2 100644 --- a/litmus/sched_psn_edf.c +++ b/litmus/sched_psn_edf.c | |||
@@ -442,10 +442,6 @@ int psnedf_fmlp_lock(struct litmus_lock* l) | |||
442 | * ->owner. We can thus check it without acquiring the spin | 442 | * ->owner. We can thus check it without acquiring the spin |
443 | * lock. */ | 443 | * lock. */ |
444 | BUG_ON(sem->owner != t); | 444 | BUG_ON(sem->owner != t); |
445 | |||
446 | /* FIXME: could we punt the dequeuing to the previous job, | ||
447 | * which is holding the spinlock anyway? */ | ||
448 | remove_wait_queue(&sem->wait, &wait); | ||
449 | } else { | 445 | } else { |
450 | /* it's ours now */ | 446 | /* it's ours now */ |
451 | sem->owner = t; | 447 | sem->owner = t; |
@@ -478,7 +474,7 @@ int psnedf_fmlp_unlock(struct litmus_lock* l) | |||
478 | unboost_priority(t); | 474 | unboost_priority(t); |
479 | 475 | ||
480 | /* check if there are jobs waiting for this resource */ | 476 | /* check if there are jobs waiting for this resource */ |
481 | next = waitqueue_first(&sem->wait); | 477 | next = __waitqueue_remove_first(&sem->wait); |
482 | if (next) { | 478 | if (next) { |
483 | /* boost next job */ | 479 | /* boost next job */ |
484 | boost_priority(next); | 480 | boost_priority(next); |