From: Samuel Just Date: Thu, 13 Mar 2014 21:04:19 +0000 (-0700) Subject: PrioritizedQueue: cap costs at max_tokens_per_subqueue X-Git-Tag: v0.78~28^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2722a0a487e77ea2aa0d18caec0bdac50cb6a264;p=ceph.git PrioritizedQueue: cap costs at max_tokens_per_subqueue Otherwise, you can get a recovery op in the queue which has a cost higher than the max token value. It won't get serviced until all other queues also do not have enough tokens and higher priority queues are empty. Fixes: #7706 Signed-off-by: Samuel Just --- diff --git a/src/common/PrioritizedQueue.h b/src/common/PrioritizedQueue.h index e663f277693e..d936d5d86c4f 100644 --- a/src/common/PrioritizedQueue.h +++ b/src/common/PrioritizedQueue.h @@ -311,12 +311,16 @@ public: void enqueue(K cl, unsigned priority, unsigned cost, T item) { if (cost < min_cost) cost = min_cost; + if (cost > max_tokens_per_subqueue) + cost = max_tokens_per_subqueue; create_queue(priority)->enqueue(cl, cost, item); } void enqueue_front(K cl, unsigned priority, unsigned cost, T item) { if (cost < min_cost) cost = min_cost; + if (cost > max_tokens_per_subqueue) + cost = max_tokens_per_subqueue; create_queue(priority)->enqueue_front(cl, cost, item); }