From a37dd14ec86c6e2b4e6703714baacb8261b04f02 Mon Sep 17 00:00:00 2001 From: Haomai Wang Date: Mon, 23 Oct 2017 13:50:11 +0800 Subject: [PATCH] iosdc/Objecter: using coarse_mono instead Signed-off-by: Haomai Wang --- src/osdc/Objecter.cc | 20 ++++++++++---------- src/osdc/Objecter.h | 22 +++++++++++----------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/osdc/Objecter.cc b/src/osdc/Objecter.cc index c9ff9efa4dd62..beb78c2a3c655 100644 --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@ -677,7 +677,7 @@ void Objecter::_send_linger_ping(LingerOp *info) return; } - ceph::mono_time now = ceph::mono_clock::now(); + ceph::coarse_mono_time now = ceph::coarse_mono_clock::now(); ldout(cct, 10) << __func__ << " " << info->linger_id << " now " << now << dendl; @@ -703,7 +703,7 @@ void Objecter::_send_linger_ping(LingerOp *info) logger->inc(l_osdc_linger_ping); } -void Objecter::_linger_ping(LingerOp *info, int r, mono_time sent, +void Objecter::_linger_ping(LingerOp *info, int r, ceph::coarse_mono_time sent, uint32_t register_gen) { LingerOp::unique_lock l(info->watch_lock); @@ -730,10 +730,10 @@ int Objecter::linger_check(LingerOp *info) { LingerOp::shared_lock l(info->watch_lock); - mono_time stamp = info->watch_valid_thru; + ceph::coarse_mono_time stamp = info->watch_valid_thru; if (!info->watch_pending_async.empty()) stamp = MIN(info->watch_valid_thru, info->watch_pending_async.front()); - auto age = mono_clock::now() - stamp; + auto age = ceph::coarse_mono_clock::now() - stamp; ldout(cct, 10) << __func__ << " " << info->linger_id << " err " << info->last_error @@ -785,7 +785,7 @@ Objecter::LingerOp *Objecter::linger_register(const object_t& oid, if (info->target.base_oloc.key == oid) info->target.base_oloc.key.clear(); info->target.flags = flags; - info->watch_valid_thru = mono_clock::now(); + info->watch_valid_thru = ceph::coarse_mono_clock::now(); unique_lock l(rwlock); @@ -2127,7 +2127,7 @@ void Objecter::tick() // look for laggy requests - auto cutoff = ceph::mono_clock::now(); + auto cutoff = ceph::coarse_mono_clock::now(); cutoff -= ceph::make_timespan(cct->_conf->objecter_timeout); // timeout unsigned laggy_ops = 0; @@ -3141,7 +3141,7 @@ MOSDOp *Objecter::_prepare_osd_op(Op *op) flags |= CEPH_OSD_FLAG_FULL_FORCE; op->target.paused = false; - op->stamp = ceph::mono_clock::now(); + op->stamp = ceph::coarse_mono_clock::now(); hobject_t hobj = op->target.get_hobj(); MOSDOp *m = new MOSDOp(client_inc, op->tid, @@ -4019,7 +4019,7 @@ void Objecter::_pool_op_submit(PoolOp *op) if (op->snapid) m->snapid = op->snapid; if (op->crush_rule) m->crush_rule = op->crush_rule; monc->send_mon_message(m); - op->last_submit = ceph::mono_clock::now(); + op->last_submit = ceph::coarse_mono_clock::now(); logger->inc(l_osdc_poolop_send); } @@ -4168,7 +4168,7 @@ void Objecter::_poolstat_submit(PoolStatOp *op) monc->send_mon_message(new MGetPoolStats(monc->get_fsid(), op->tid, op->pools, last_seen_pgmap_version)); - op->last_submit = ceph::mono_clock::now(); + op->last_submit = ceph::coarse_mono_clock::now(); logger->inc(l_osdc_poolstat_send); } @@ -4270,7 +4270,7 @@ void Objecter::_fs_stats_submit(StatfsOp *op) monc->send_mon_message(new MStatfs(monc->get_fsid(), op->tid, op->data_pool, last_seen_pgmap_version)); - op->last_submit = ceph::mono_clock::now(); + op->last_submit = ceph::coarse_mono_clock::now(); logger->inc(l_osdc_statfs_send); } diff --git a/src/osdc/Objecter.h b/src/osdc/Objecter.h index 3358d6bb24e8c..a2719d94be42a 100644 --- a/src/osdc/Objecter.h +++ b/src/osdc/Objecter.h @@ -1233,7 +1233,7 @@ private: using unique_lock = std::unique_lock; using shared_lock = boost::shared_lock; using shunique_lock = ceph::shunique_lock; - ceph::timer timer; + ceph::timer timer; PerfCounters *logger; @@ -1355,7 +1355,7 @@ public: version_t *objver; epoch_t *reply_epoch; - ceph::mono_time stamp; + ceph::coarse_mono_time stamp; epoch_t map_dne_bound; @@ -1556,7 +1556,7 @@ public: Context *onfinish; uint64_t ontimeout; - ceph::mono_time last_submit; + ceph::coarse_mono_time last_submit; }; struct StatfsOp { @@ -1566,7 +1566,7 @@ public: Context *onfinish; uint64_t ontimeout; - ceph::mono_time last_submit; + ceph::coarse_mono_time last_submit; }; struct PoolOp { @@ -1581,7 +1581,7 @@ public: snapid_t snapid; bufferlist *blp; - ceph::mono_time last_submit; + ceph::coarse_mono_time last_submit; PoolOp() : tid(0), pool(0), onfinish(NULL), ontimeout(0), pool_op(0), auid(0), crush_rule(0), snapid(0), blp(NULL) {} }; @@ -1607,7 +1607,7 @@ public: Context *onfinish = nullptr; uint64_t ontimeout = 0; - ceph::mono_time last_submit; + ceph::coarse_mono_time last_submit; CommandOp( int target_osd, @@ -1676,7 +1676,7 @@ public: version_t *pobjver; bool is_watch; - ceph::mono_time watch_valid_thru; ///< send time for last acked ping + ceph::coarse_mono_time watch_valid_thru; ///< send time for last acked ping int last_error; ///< error from last failed ping|reconnect, if any boost::shared_mutex watch_lock; using lock_guard = std::unique_lock; @@ -1686,7 +1686,7 @@ public: // queue of pending async operations, with the timestamp of // when they were queued. - list watch_pending_async; + list watch_pending_async; uint32_t register_gen; bool registered; @@ -1708,7 +1708,7 @@ public: void _queued_async() { // watch_lock ust be locked unique - watch_pending_async.push_back(ceph::mono_clock::now()); + watch_pending_async.push_back(ceph::coarse_mono_clock::now()); } void finished_async() { unique_lock l(watch_lock); @@ -1779,7 +1779,7 @@ public: struct C_Linger_Ping : public Context { Objecter *objecter; LingerOp *info; - ceph::mono_time sent; + ceph::coarse_mono_time sent; uint32_t register_gen; C_Linger_Ping(Objecter *o, LingerOp *l) : objecter(o), info(l), register_gen(info->register_gen) { @@ -1929,7 +1929,7 @@ public: void _linger_commit(LingerOp *info, int r, bufferlist& outbl); void _linger_reconnect(LingerOp *info, int r); void _send_linger_ping(LingerOp *info); - void _linger_ping(LingerOp *info, int r, ceph::mono_time sent, + void _linger_ping(LingerOp *info, int r, ceph::coarse_mono_time sent, uint32_t register_gen); int _normalize_watch_error(int r); -- 2.39.5