From: Sridhar Seshasayee Date: Mon, 7 Sep 2020 18:56:40 +0000 (+0530) Subject: osd: Introduce new PGOpQueueable class for recovery push/reply messages. X-Git-Tag: v16.1.0~1127^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0af7d6de5e2ccb321af23f6b6dc4155c436fef1e;p=ceph.git osd: Introduce new PGOpQueueable class for recovery push/reply messages. 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 --- diff --git a/src/osd/scheduler/OpSchedulerItem.cc b/src/osd/scheduler/OpSchedulerItem.cc index 28069dcef3a8..66308dcc0e6d 100644 --- a/src/osd/scheduler/OpSchedulerItem.cc +++ b/src/osd/scheduler/OpSchedulerItem.cc @@ -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(); +} + } diff --git a/src/osd/scheduler/OpSchedulerItem.h b/src/osd/scheduler/OpSchedulerItem.h index 1dd16ee8d241..cd91ff51a1f1 100644 --- a/src/osd/scheduler/OpSchedulerItem.h +++ b/src/osd/scheduler/OpSchedulerItem.h @@ -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 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; +}; + }