]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: Include the dmclock request parameters when the op is enqueued
authorByungsu Park <bspark8@sk.com>
Wed, 1 Nov 2017 06:51:01 +0000 (15:51 +0900)
committerTaewoong Kim <taewoong.kim@sk.com>
Wed, 8 Nov 2017 12:44:59 +0000 (21:44 +0900)
on mclock queue.

Signed-off-by: Byungsu Park <bspark8@sk.com>
src/common/mClockPriorityQueue.h
src/osd/OpQueueItem.h
src/osd/mClockClientQueue.cc

index 7618118b59df420e350ce095b7a962636815fc45..f51c22b53b47c026bfed6a0e33e80239b958d093 100644 (file)
@@ -309,6 +309,12 @@ namespace ceph {
       queue.add_request(std::move(item), cl, cost);
     }
 
+    void enqueue_distributed(K cl, unsigned priority, unsigned cost, T&& item,
+                            const dmc::ReqParams& req_params) {
+      // priority is ignored
+      queue.add_request(std::move(item), cl, req_params, cost);
+    }
+
     void enqueue_front(K cl,
                       unsigned priority,
                       unsigned cost,
index e768fea1396ef78109bb8c66e1730e96c48536a5..43a544da5e849ca0ba11f002e0872b280a55b9a5 100644 (file)
@@ -21,6 +21,8 @@
 #include "include/utime.h"
 #include "osd/OpRequest.h"
 #include "osd/PG.h"
+#include "common/mClockCommon.h"
+#include "messages/MOSDOp.h"
 
 
 class OSD;
@@ -73,6 +75,7 @@ public:
 private:
   OpQueueable::Ref qitem;
   int cost;
+  dmc::ReqParams qos_params;
   unsigned priority;
   utime_t start_time;
   uint64_t owner;  ///< global id (e.g., client.XXX)
@@ -92,7 +95,15 @@ public:
       start_time(start_time),
       owner(owner),
       map_epoch(e)
-  {}
+  {
+    if (auto op = maybe_get_op()) {
+      auto req = (*op)->get_req();
+      if (req->get_type() == CEPH_MSG_OSD_OP) {
+       const MOSDOp *m = static_cast<const MOSDOp*>(req);
+       qos_params = m->get_qos_params();
+      }
+    }
+  }
   OpQueueItem(OpQueueItem &&) = default;
   OpQueueItem(const OpQueueItem &) = delete;
   OpQueueItem &operator=(OpQueueItem &&) = default;
@@ -125,6 +136,8 @@ public:
   utime_t get_start_time() const { return start_time; }
   uint64_t get_owner() const { return owner; }
   epoch_t get_map_epoch() const { return map_epoch; }
+  dmc::ReqParams get_qos_params() const { return qos_params; }
+  void set_qos_params(dmc::ReqParams qparams) { qos_params =  qparams; }
 
   friend ostream& operator<<(ostream& out, const OpQueueItem& item) {
     return out << "OpQueueItem("
index b30ddb8c8b325ca866ff2ee5d48ab2ada4d555cd..47f86a50e0514c1fd9b09e68c38dcb1d98ee4fa7 100644 (file)
@@ -77,8 +77,9 @@ namespace ceph {
                                         unsigned priority,
                                         unsigned cost,
                                         Request&& item) {
-    queue.enqueue(get_inner_client(cl, item), priority, cost,
-                 std::move(item));
+    auto qos_params = item.get_qos_params();
+    queue.enqueue_distributed(get_inner_client(cl, item), priority, cost,
+                             std::move(item), qos_params);
   }
 
   // Enqueue the op in the front of the regular queue