]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Introduce new PGOpQueueable class for recovery push/reply messages.
authorSridhar Seshasayee <sseshasa@redhat.com>
Mon, 7 Sep 2020 18:56:40 +0000 (00:26 +0530)
committerSridhar Seshasayee <sseshasa@redhat.com>
Mon, 7 Sep 2020 20:08:17 +0000 (01:38 +0530)
Introduce a new PGOpQueueable class called PGRecoveryMsg to be used for
background recovery specific messages - MOSDPGPush and MOSDPGPushReply.
Earlier the above was categorized into the PGOpItem class leading to the
scheduler (for e.g. dmclock) giving higher importance to recovery IO
compared to client IO regardless of the weightage given to client IO.
This resulted in the poor performance of client IO.

This new class helps the existing and future (e.g. dmclock) IO schedulers
to schedule either client or recovery specific IO operations based on the
scheduling algorithm being employed and try to meet the QoS requirements.

Messages with CEPH_MSG_PRIO_HIGH or higher priority are given higher
importance.

Fixes: https://tracker.ceph.com/issues/47344
Signed-off-by: Sridhar Seshasayee <sseshasa@redhat.com>
src/osd/scheduler/OpSchedulerItem.cc
src/osd/scheduler/OpSchedulerItem.h

index 28069dcef3a841682eef79d36f96bbb783680ea5..66308dcc0e6d97bb43cea98206b6632ea2a99f36 100644 (file)
@@ -85,4 +85,14 @@ void PGDelete::run(
   osd->dequeue_delete(sdata, pg.get(), epoch_queued, handle);
 }
 
+void PGRecoveryMsg::run(
+  OSD *osd,
+  OSDShard *sdata,
+  PGRef& pg,
+  ThreadPool::TPHandle &handle)
+{
+  osd->dequeue_op(pg, op, handle);
+  pg->unlock();
+}
+
 }
index 1dd16ee8d2410d1cb8df0d1e770c0390532bbde4..cd91ff51a1f1d6b23ac4af8df0fdbe2cfc9a9460 100644 (file)
@@ -401,4 +401,32 @@ public:
   }
 };
 
+class PGRecoveryMsg : public PGOpQueueable {
+  OpRequestRef op;
+
+public:
+  PGRecoveryMsg(spg_t pg, OpRequestRef op) : PGOpQueueable(pg), op(std::move(op)) {}
+  op_type_t get_op_type() const final {
+    return op_type_t::bg_recovery;
+  }
+
+  std::ostream &print(std::ostream &rhs) const final {
+    return rhs << "PGRecoveryMsg(op=" << *(op->get_req()) << ")";
+  }
+
+  std::optional<OpRequestRef> maybe_get_op() const final {
+    return op;
+  }
+
+  op_scheduler_class get_scheduler_class() const final {
+    auto priority = op->get_req()->get_priority();
+    if (priority >= CEPH_MSG_PRIO_HIGH) {
+      return op_scheduler_class::immediate;
+    }
+    return op_scheduler_class::background_recovery;
+  }
+
+  void run(OSD *osd, OSDShard *sdata, PGRef& pg, ThreadPool::TPHandle &handle) final;
+};
+
 }