From ef1980f52877617510529e04d21cf3aeb3c43847 Mon Sep 17 00:00:00 2001 From: Zhiqiang Wang Date: Wed, 29 Oct 2014 10:45:50 +0800 Subject: [PATCH] osd: tiering: calculate object age during eviction when there is no hit set Signed-off-by: Zhiqiang Wang --- src/osd/ReplicatedPG.cc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/osd/ReplicatedPG.cc b/src/osd/ReplicatedPG.cc index f669cd665e34..cbea6f5dac74 100644 --- a/src/osd/ReplicatedPG.cc +++ b/src/osd/ReplicatedPG.cc @@ -11610,11 +11610,11 @@ bool ReplicatedPG::agent_maybe_evict(ObjectContextRef& obc) } } - if (agent_state->evict_mode != TierAgentState::EVICT_MODE_FULL && - hit_set) { + if (agent_state->evict_mode != TierAgentState::EVICT_MODE_FULL) { // is this object old and/or cold enough? int atime = -1, temp = 0; - agent_estimate_atime_temp(soid, &atime, NULL /*FIXME &temp*/); + if (hit_set) + agent_estimate_atime_temp(soid, &atime, NULL /*FIXME &temp*/); uint64_t atime_upper = 0, atime_lower = 0; if (atime < 0 && obc->obs.oi.mtime != utime_t()) { @@ -11624,8 +11624,13 @@ bool ReplicatedPG::agent_maybe_evict(ObjectContextRef& obc) atime = ceph_clock_now(NULL).sec() - obc->obs.oi.mtime; } } - if (atime < 0) - atime = pool.info.hit_set_period * pool.info.hit_set_count; // "infinite" + if (atime < 0) { + if (hit_set) { + atime = pool.info.hit_set_period * pool.info.hit_set_count; // "infinite" + } else { + atime_upper = 1000000; + } + } if (atime >= 0) { agent_state->atime_hist.add(atime); agent_state->atime_hist.get_position_micro(atime, &atime_lower, -- 2.47.3