|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Minios-devel] [UNIKRAFT PATCH] lib/uksched: Make waiting queue act like actual queues
Waiting queues were used as stacks (LIFO) instead of queues (FIFO). The
last added thread was the first one to be woken up which violates the
fairness quality of waiting queues. This patch fixes that by adding the
last added thread at the end of the queue.
The pthread-embedded library provides a test which verifies this propery
- the rwlock6 test.
Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
lib/uksched/include/uk/wait.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/uksched/include/uk/wait.h b/lib/uksched/include/uk/wait.h
index bf0e0c5c..94dae16f 100644
--- a/lib/uksched/include/uk/wait.h
+++ b/lib/uksched/include/uk/wait.h
@@ -60,7 +60,7 @@ void uk_waitq_add(struct uk_waitq *wq,
struct uk_waitq_entry *entry)
{
if (!entry->waiting) {
- UK_STAILQ_INSERT_HEAD(wq, entry, thread_list);
+ UK_STAILQ_INSERT_TAIL(wq, entry, thread_list);
entry->waiting = 1;
}
}
--
2.11.0
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |