From d9a3bf043bbaefc30482a96daa7165abcfec3577 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 13 Sep 2017 16:28:10 -0400 Subject: [PATCH] osd: use global id instead of entity_inst_t as client identifier entity_inst_t is huge; use uint64_t instead. Note that this will currently confuse mds.0 vs osd.0, but we plan to switch the mds to use mds.$gid soon anyway so that will go away. Signed-off-by: Sage Weil --- src/osd/OSD.cc | 2 +- src/osd/OSD.h | 14 +++++++------- src/osd/PGQueueable.h | 12 ++++++------ src/osd/mClockClientQueue.h | 4 ++-- src/osd/mClockOpClassQueue.h | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 0dd61552747..d74000e70b9 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -1697,7 +1697,7 @@ void OSDService::queue_for_snap_trim(PG *pg) cct->_conf->osd_snap_trim_cost, cct->_conf->osd_snap_trim_priority, ceph_clock_now(), - entity_inst_t(), + 0, pg->get_osdmap()->get_epoch()))); } diff --git a/src/osd/OSD.h b/src/osd/OSD.h index 575d84c7e15..b864dda040c 100644 --- a/src/osd/OSD.h +++ b/src/osd/OSD.h @@ -871,7 +871,7 @@ public: cct->_conf->osd_scrub_cost, scrub_queue_priority, ceph_clock_now(), - entity_inst_t(), + 0, pg->get_osdmap()->get_epoch())); } @@ -899,7 +899,7 @@ private: cct->_conf->osd_recovery_cost, cct->_conf->osd_recovery_priority, ceph_clock_now(), - entity_inst_t(), + 0, p.first)); } public: @@ -1650,7 +1650,7 @@ private: unordered_map pg_slots; /// priority queue - std::unique_ptr, entity_inst_t>> pqueue; + std::unique_ptr, uint64_t>> pqueue; void _enqueue_front(pair item, unsigned cutoff) { unsigned priority = item.second.get_priority(); @@ -1674,13 +1674,13 @@ private: false, cct) { if (opqueue == io_queue::weightedpriority) { pqueue = std::unique_ptr - ,entity_inst_t>>( - new WeightedPriorityQueue,entity_inst_t>( + ,uint64_t>>( + new WeightedPriorityQueue,uint64_t>( max_tok_per_prio, min_cost)); } else if (opqueue == io_queue::prioritized) { pqueue = std::unique_ptr - ,entity_inst_t>>( - new PrioritizedQueue,entity_inst_t>( + ,uint64_t>>( + new PrioritizedQueue,uint64_t>( max_tok_per_prio, min_cost)); } else if (opqueue == io_queue::mclock_opclass) { pqueue = std::unique_ptr diff --git a/src/osd/PGQueueable.h b/src/osd/PGQueueable.h index cb32e52b782..9eeadc038e6 100644 --- a/src/osd/PGQueueable.h +++ b/src/osd/PGQueueable.h @@ -65,7 +65,7 @@ class PGQueueable { int cost; unsigned priority; utime_t start_time; - entity_inst_t owner; + uint64_t owner; ///< global id (e.g., client.XXX) epoch_t map_epoch; ///< an epoch we expect the PG to exist in struct RunVis : public boost::static_visitor<> { @@ -108,22 +108,22 @@ public: : qvariant(op), cost(op->get_req()->get_cost()), priority(op->get_req()->get_priority()), start_time(op->get_req()->get_recv_stamp()), - owner(op->get_req()->get_source_inst()), + owner(op->get_req()->get_source().num()), map_epoch(e) {} PGQueueable( const PGSnapTrim &op, int cost, unsigned priority, utime_t start_time, - const entity_inst_t &owner, epoch_t e) + uint64_t owner, epoch_t e) : qvariant(op), cost(cost), priority(priority), start_time(start_time), owner(owner), map_epoch(e) {} PGQueueable( const PGScrub &op, int cost, unsigned priority, utime_t start_time, - const entity_inst_t &owner, epoch_t e) + uint64_t owner, epoch_t e) : qvariant(op), cost(cost), priority(priority), start_time(start_time), owner(owner), map_epoch(e) {} PGQueueable( const PGRecovery &op, int cost, unsigned priority, utime_t start_time, - const entity_inst_t &owner, epoch_t e) + uint64_t owner, epoch_t e) : qvariant(op), cost(cost), priority(priority), start_time(start_time), owner(owner), map_epoch(e) {} @@ -142,7 +142,7 @@ public: unsigned get_priority() const { return priority; } int get_cost() const { return cost; } utime_t get_start_time() const { return start_time; } - entity_inst_t get_owner() const { return owner; } + uint64_t get_owner() const { return owner; } epoch_t get_map_epoch() const { return map_epoch; } const QVariant& get_variant() const { return qvariant; } }; // struct PGQueueable diff --git a/src/osd/mClockClientQueue.h b/src/osd/mClockClientQueue.h index 4a4a7b5f744..3d8824914eb 100644 --- a/src/osd/mClockClientQueue.h +++ b/src/osd/mClockClientQueue.h @@ -29,7 +29,7 @@ namespace ceph { using Request = std::pair; - using Client = entity_inst_t; + using Client = uint64_t; // This class exists to bridge the ceph code, which treats the class @@ -41,7 +41,7 @@ namespace ceph { enum class osd_op_type_t { client_op, osd_subop, bg_snaptrim, bg_recovery, bg_scrub }; - using InnerClient = std::pair; + using InnerClient = std::pair; using queue_t = mClockQueue; diff --git a/src/osd/mClockOpClassQueue.h b/src/osd/mClockOpClassQueue.h index d12c49a0d4a..6b87335b109 100644 --- a/src/osd/mClockOpClassQueue.h +++ b/src/osd/mClockOpClassQueue.h @@ -29,7 +29,7 @@ namespace ceph { using Request = std::pair; - using Client = entity_inst_t; + using Client = uint64_t; // This class exists to bridge the ceph code, which treats the class -- 2.39.5