This is to avoid the extreme case that the agent continuously does
flush, but not evict. This may lead to the cache pool to be full.
Signed-off-by: Zhiqiang Wang <zhiqiang.wang@intel.com>
continue;
}
+ if (agent_state->evict_mode != TierAgentState::EVICT_MODE_IDLE &&
+ agent_maybe_evict(obc))
+ ++started;
if (agent_state->flush_mode != TierAgentState::FLUSH_MODE_IDLE &&
agent_flush_quota > 0 && agent_maybe_flush(obc)) {
++started;
--agent_flush_quota;
}
- if (agent_state->evict_mode != TierAgentState::EVICT_MODE_IDLE &&
- agent_maybe_evict(obc))
- ++started;
if (started >= start_max) {
// If finishing early, set "next" to the next object
if (++p != ls.end())