// max agent flush ops
OPTION(osd_agent_max_ops, OPT_INT, 4)
+OPTION(osd_agent_max_low_ops, OPT_INT, 2)
OPTION(osd_agent_min_evict_effort, OPT_FLOAT, .1)
OPTION(osd_agent_quantize_effort, OPT_FLOAT, .1)
OPTION(osd_agent_delay_time, OPT_FLOAT, 5.0)
}
PGRef pg = *agent_queue_pos;
int max = g_conf->osd_agent_max_ops - agent_ops;
+ int agent_flush_quota = max;
+ if (!flush_mode_high_count)
+ agent_flush_quota = g_conf->osd_agent_max_low_ops - agent_ops;
+ dout(10) << "high_count " << flush_mode_high_count << " agent_ops " << agent_ops << " flush_quota " << agent_flush_quota << dendl;
agent_lock.Unlock();
- if (!pg->agent_work(max)) {
+ if (!pg->agent_work(max, agent_flush_quota)) {
dout(10) << __func__ << " " << *pg
<< " no agent_work, delay for " << g_conf->osd_agent_delay_time
<< " seconds" << dendl;
virtual void get_watchers(std::list<obj_watch_item_t>&) = 0;
virtual bool agent_work(int max) = 0;
+ virtual bool agent_work(int max, int agent_flush_quota) = 0;
virtual void agent_stop() = 0;
virtual void agent_delay() = 0;
virtual void agent_clear() = 0;
}
// Return false if no objects operated on since start of object hash space
-bool ReplicatedPG::agent_work(int start_max)
+bool ReplicatedPG::agent_work(int start_max, int agent_flush_quota)
{
lock();
if (!agent_state) {
}
if (agent_state->flush_mode != TierAgentState::FLUSH_MODE_IDLE &&
- agent_maybe_flush(obc))
+ 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;
friend struct C_HitSetFlushing;
void agent_setup(); ///< initialize agent state
- bool agent_work(int max); ///< entry point to do some agent work
+ bool agent_work(int max) ///< entry point to do some agent work
+ {
+ return agent_work(max, max);
+ }
+ bool agent_work(int max, int agent_flush_quota);
bool agent_maybe_flush(ObjectContextRef& obc); ///< maybe flush
bool agent_maybe_evict(ObjectContextRef& obc); ///< maybe evict