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 <sam.just@inktank.com>
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);
}