[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH] lib/uksched: Make waiting queue act like actual queues



Hi Costin,

thanks for the patch. That behavior seems indeed much more sane.

Reviewed-by: Florian Schmidt <florian.schmidt@xxxxxxxxx>

On 6/3/19 2:40 PM, Costin Lupu wrote:
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;
        }
  }


--
Dr. Florian Schmidt
フローリアン・シュミット
Research Scientist,
Systems and Machine Learning Group
NEC Laboratories Europe
Kurfürsten-Anlage 36, D-69115 Heidelberg
Tel.     +49 (0)6221 4342-265
Fax:     +49 (0)6221 4342-155
e-mail:  florian.schmidt@xxxxxxxxx
============================================================
Registered at Amtsgericht Mannheim, Germany, HRB728558

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.