set<PGRef>::iterator agent_queue_pos;
bool agent_valid_iterator;
int agent_ops;
+ int flush_mode_high_count; //once have one pg with FLUSH_MODE_HIGH then flush objects with high speed
set<hobject_t> agent_oids;
bool agent_active;
struct AgentThread : public Thread {
return agent_ops;
}
+ void agent_inc_high_count() {
+ Mutex::Locker l(agent_lock);
+ flush_mode_high_count ++;
+ }
+
+ void agent_dec_high_count() {
+ Mutex::Locker l(agent_lock);
+ flush_mode_high_count --;
+ }
+
// -- Objecter, for teiring reads/writes from/to other OSDs --
Objecter *objecter;
// flush mode
TierAgentState::flush_mode_t flush_mode = TierAgentState::FLUSH_MODE_IDLE;
uint64_t flush_target = pool.info.cache_target_dirty_ratio_micro;
+ uint64_t flush_high_target = pool.info.cache_target_dirty_high_ratio_micro;
uint64_t flush_slop = (float)flush_target * g_conf->osd_agent_slop;
- if (restart || agent_state->flush_mode == TierAgentState::FLUSH_MODE_IDLE)
+ if (restart || agent_state->flush_mode == TierAgentState::FLUSH_MODE_IDLE) {
flush_target += flush_slop;
- else
+ flush_high_target += flush_slop;
+ } else {
flush_target -= MIN(flush_target, flush_slop);
+ flush_high_target -= MIN(flush_high_target, flush_slop);
+ }
if (info.stats.stats_invalid) {
// idle; stats can't be trusted until we scrub.
dout(20) << __func__ << " stats invalid (post-split), idle" << dendl;
+ } else if (dirty_micro > flush_high_target) {
+ flush_mode = TierAgentState::FLUSH_MODE_HIGH;
} else if (dirty_micro > flush_target) {
- flush_mode = TierAgentState::FLUSH_MODE_ACTIVE;
+ flush_mode = TierAgentState::FLUSH_MODE_LOW;
}
// evict mode
<< " -> "
<< TierAgentState::get_flush_mode_name(flush_mode)
<< dendl;
+ if (flush_mode == TierAgentState::FLUSH_MODE_HIGH)
+ osd->agent_inc_high_count();
+ if (agent_state->flush_mode == TierAgentState::FLUSH_MODE_HIGH)
+ osd->agent_dec_high_count();
agent_state->flush_mode = flush_mode;
}
if (evict_mode != agent_state->evict_mode) {