From bee57b8587b02ec6f4b3dfa3c16d817f03fca5d1 Mon Sep 17 00:00:00 2001 From: Taewoong Kim Date: Wed, 2 Nov 2016 14:28:29 +0900 Subject: [PATCH] Fix to use other client's previous tag for prop_delta calculation when there is no tag in other client's queue. If there were active clients but no tag in their queue, newly inserted client could have wrong prop_delta. Signed-off-by: Taewoong Kim --- src/dmclock_server.h | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/dmclock_server.h b/src/dmclock_server.h index 6fc80bc..ee9ec4a 100644 --- a/src/dmclock_server.h +++ b/src/dmclock_server.h @@ -710,13 +710,17 @@ namespace crimson { // don't use ourselves (or anything else that might be // listed as idle) since we're now in the map if (!c.second->idle) { + double p; // use either lowest proportion tag or previous proportion tag if (c.second->has_request()) { - double p = c.second->next_request().tag.proportion + + p = c.second->next_request().tag.proportion + c.second->prop_delta; - if (p < lowest_prop_tag) { - lowest_prop_tag = p; - } + } else { + p = c.second->get_req_tag().proportion + c.second->prop_delta; + } + + if (p < lowest_prop_tag) { + lowest_prop_tag = p; } } }