aboutsummaryrefslogtreecommitdiffstats
path: root/litmus/sched_gsn_edf.c
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2011-03-31 10:47:01 -0400
committerGlenn Elliott <gelliott@cs.unc.edu>2011-03-31 10:47:01 -0400
commit0f6a8e02773f8c23b5b6a3dbfa044e50c9d7d811 (patch)
treeae9ee07707eaeefc6f7c3cc09d74e40e8c3a1eef /litmus/sched_gsn_edf.c
parentc05eaa8091d2cadc20363d44a85ee454262f4bc2 (diff)
Improve FMLP queue management.wip-fmlp-dequeue
The next owner of a FMLP-protected resource is dequeued from the FMLP FIFO queue by unlock() (when the resource is freed by the previous owner) instead of performing the dequeue by the next owner immediately after it has been woken up. This simplifies the code a little bit and also reduces potential spinlock contention.
Diffstat (limited to 'litmus/sched_gsn_edf.c')
-rw-r--r--litmus/sched_gsn_edf.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/litmus/sched_gsn_edf.c b/litmus/sched_gsn_edf.c
index c5c9600c33d8..08b8847ede97 100644
--- a/litmus/sched_gsn_edf.c
+++ b/litmus/sched_gsn_edf.c
@@ -776,8 +776,6 @@ int gsnedf_fmlp_lock(struct litmus_lock* l)
776 * ->owner. We can thus check it without acquiring the spin 776 * ->owner. We can thus check it without acquiring the spin
777 * lock. */ 777 * lock. */
778 BUG_ON(sem->owner != t); 778 BUG_ON(sem->owner != t);
779
780 remove_wait_queue(&sem->wait, &wait);
781 } else { 779 } else {
782 /* it's ours now */ 780 /* it's ours now */
783 sem->owner = t; 781 sem->owner = t;
@@ -803,7 +801,7 @@ int gsnedf_fmlp_unlock(struct litmus_lock* l)
803 } 801 }
804 802
805 /* check if there are jobs waiting for this resource */ 803 /* check if there are jobs waiting for this resource */
806 next = waitqueue_first(&sem->wait); 804 next = __waitqueue_remove_first(&sem->wait);
807 if (next) { 805 if (next) {
808 /* next becomes the resouce holder */ 806 /* next becomes the resouce holder */
809 sem->owner = next; 807 sem->owner = next;