Skip to content

Commit

Permalink
Fix to use other client's previous tag for prop_delta calculation
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
TaewoongKim committed Nov 2, 2016
1 parent 1335fda commit bee57b8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/dmclock_server.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}
Expand Down

0 comments on commit bee57b8

Please sign in to comment.