Merge pull request #4228 from athanatos/wip-11280

Wip 11280

Reviewed-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2015-03-31 09:38:48 -07:00
commit 9d0dcc1f06
2 changed files with 12 additions and 5 deletions

View File

@ -1539,7 +1539,8 @@ void ReplicatedPG::do_op(OpRequestRef& op)
}
if (agent_state) {
agent_choose_mode();
if (agent_choose_mode(false, op))
return;
}
if ((m->get_flags() & CEPH_OSD_FLAG_IGNORE_CACHE) == 0 &&
@ -10858,12 +10859,13 @@ void ReplicatedPG::agent_choose_mode_restart()
unlock();
}
void ReplicatedPG::agent_choose_mode(bool restart)
bool ReplicatedPG::agent_choose_mode(bool restart, OpRequestRef op)
{
bool requeued = false;
// Let delay play out
if (agent_state->delaying) {
dout(20) << __func__ << this << " delaying, ignored" << dendl;
return;
return requeued;
}
uint64_t divisor = pool.info.get_pg_num_divisor(info.pgid.pgid);
@ -11011,8 +11013,11 @@ void ReplicatedPG::agent_choose_mode(bool restart)
<< dendl;
if (agent_state->evict_mode == TierAgentState::EVICT_MODE_FULL &&
is_active()) {
requeue_ops(waiting_for_cache_not_full);
if (op)
requeue_op(op);
requeue_ops(waiting_for_active);
requeue_ops(waiting_for_cache_not_full);
requeued = true;
}
agent_state->evict_mode = evict_mode;
}
@ -11040,6 +11045,7 @@ void ReplicatedPG::agent_choose_mode(bool restart)
osd->agent_adjust_pg(this, old_effort, agent_state->evict_effort);
}
}
return requeued;
}
void ReplicatedPG::agent_estimate_atime_temp(const hobject_t& oid,

View File

@ -917,7 +917,8 @@ protected:
/// clear agent state
void agent_clear();
void agent_choose_mode(bool restart = false); ///< choose (new) agent mode(s)
/// choose (new) agent mode(s), returns true if op is requeued
bool agent_choose_mode(bool restart = false, OpRequestRef op = OpRequestRef());
void agent_choose_mode_restart();
/// true if we can send an ondisk/commit for v