]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd/osd_operations: introduce concurrent lock_obc phase
authorYingxin Cheng <yingxin.cheng@intel.com>
Thu, 25 Jan 2024 02:42:17 +0000 (10:42 +0800)
committerYingxin Cheng <yingxin.cheng@intel.com>
Thu, 9 May 2024 02:06:39 +0000 (10:06 +0800)
Signed-off-by: Yingxin Cheng <yingxin.cheng@intel.com>
src/crimson/osd/osd_operation_external_tracking.h
src/crimson/osd/osd_operations/client_request.cc
src/crimson/osd/osd_operations/client_request.h
src/crimson/osd/osd_operations/common/pg_pipeline.h
src/crimson/osd/osd_operations/internal_client_request.cc
src/crimson/osd/osd_operations/internal_client_request.h

index 4fffd8e82b00bb7468197e5139b5bdfe95a95982..28738a11dda4df3bc4a9dd29f34165073a7dce81 100644 (file)
@@ -38,6 +38,8 @@ struct LttngBackend
       BlockingEvent::ExitBarrierEvent::Backend,
     ClientRequest::PGPipeline::RecoverMissingSnaps::BlockingEvent::Backend,
     ClientRequest::PGPipeline::GetOBC::BlockingEvent::Backend,
+    ClientRequest::PGPipeline::LockOBC::BlockingEvent::Backend,
+    ClientRequest::PGPipeline::LockOBC::BlockingEvent::ExitBarrierEvent::Backend,
     ClientRequest::PGPipeline::Process::BlockingEvent::Backend,
     ClientRequest::PGPipeline::WaitRepop::BlockingEvent::Backend,
     ClientRequest::PGPipeline::WaitRepop::BlockingEvent::ExitBarrierEvent::Backend,
@@ -127,6 +129,15 @@ struct LttngBackend
               const ClientRequest::PGPipeline::GetOBC& blocker) override {
   }
 
+  void handle(ClientRequest::PGPipeline::LockOBC::BlockingEvent& ev,
+              const Operation& op,
+              const ClientRequest::PGPipeline::LockOBC& blocker) override {
+  }
+
+  void handle(ClientRequest::PGPipeline::LockOBC::BlockingEvent::ExitBarrierEvent& ev,
+              const Operation& op) override {
+  }
+
   void handle(ClientRequest::PGPipeline::Process::BlockingEvent& ev,
               const Operation& op,
               const ClientRequest::PGPipeline::Process& blocker) override {
@@ -169,6 +180,8 @@ struct HistoricBackend
       BlockingEvent::ExitBarrierEvent::Backend,
     ClientRequest::PGPipeline::RecoverMissingSnaps::BlockingEvent::Backend,
     ClientRequest::PGPipeline::GetOBC::BlockingEvent::Backend,
+    ClientRequest::PGPipeline::LockOBC::BlockingEvent::Backend,
+    ClientRequest::PGPipeline::LockOBC::BlockingEvent::ExitBarrierEvent::Backend,
     ClientRequest::PGPipeline::Process::BlockingEvent::Backend,
     ClientRequest::PGPipeline::WaitRepop::BlockingEvent::Backend,
     ClientRequest::PGPipeline::WaitRepop::BlockingEvent::ExitBarrierEvent::Backend,
@@ -258,6 +271,15 @@ struct HistoricBackend
               const ClientRequest::PGPipeline::GetOBC& blocker) override {
   }
 
+  void handle(ClientRequest::PGPipeline::LockOBC::BlockingEvent& ev,
+              const Operation& op,
+              const ClientRequest::PGPipeline::LockOBC& blocker) override {
+  }
+
+  void handle(ClientRequest::PGPipeline::LockOBC::BlockingEvent::ExitBarrierEvent& ev,
+              const Operation& op) override {
+  }
+
   void handle(ClientRequest::PGPipeline::Process::BlockingEvent& ev,
               const Operation& op,
               const ClientRequest::PGPipeline::Process& blocker) override {
index 3f2399684a321d39660ec5d16e305d15a2773674..b48e52ff31edaa077d8ec29709a5622869761e43 100644 (file)
@@ -343,6 +343,9 @@ ClientRequest::process_op(
 
   DEBUGDPP("{}.{}: past scrub blocker, getting obc",
           *pg, *this, this_instance_id);
+  // call with_locked_obc() in order, but wait concurrently for loading.
+  ihref.enter_stage_sync(
+      client_pp(*pg).lock_obc, *this);
   auto process = pg->with_locked_obc(
     m->get_hobj(), op_info,
     [FNAME, this, pg, this_instance_id, &ihref] (
index d5cbc94c1c40b142d5e4ef8a199ef22dfada2eef..259d616ec24c42d9d49c561e240fc5c628440774 100644 (file)
@@ -115,6 +115,7 @@ public:
       PGPipeline::RecoverMissingSnaps::BlockingEvent,
       scrub::PGScrubber::BlockingEvent,
       PGPipeline::GetOBC::BlockingEvent,
+      PGPipeline::LockOBC::BlockingEvent,
       PGPipeline::Process::BlockingEvent,
       PGPipeline::WaitRepop::BlockingEvent,
       PGPipeline::SendReply::BlockingEvent,
index 58fa07b8b4d2537c5c978d0a0d2f71799664ce32..d6a5f686654b46ae1ccd76460c63afe86e096992 100644 (file)
@@ -23,6 +23,9 @@ protected:
   struct GetOBC : OrderedExclusivePhaseT<GetOBC> {
     static constexpr auto type_name = "CommonPGPipeline::get_obc";
   } get_obc;
+  struct LockOBC : OrderedConcurrentPhaseT<LockOBC> {
+    static constexpr auto type_name = "CommonPGPipeline::lock_obc";
+  } lock_obc;
   struct Process : OrderedExclusivePhaseT<Process> {
     static constexpr auto type_name = "CommonPGPipeline::process";
   } process;
index 7be582ff2761976b7580ea62bd213766e3616c70..d72c128683da98b1fc25276fba24968c024c6edf 100644 (file)
@@ -84,6 +84,8 @@ seastar::future<> InternalClientRequest::start()
             [[maybe_unused]] const int ret = op_info.set_from_op(
               std::as_const(osd_ops), pg->get_pgid().pgid, *pg->get_osdmap());
             assert(ret == 0);
+            // call with_locked_obc() in order, but wait concurrently for loading.
+            enter_stage_sync(client_pp().lock_obc);
             return pg->with_locked_obc(get_target_oid(), op_info,
               [&osd_ops, this](auto, auto obc) {
               return enter_stage<interruptor>(client_pp().process
index 8eed12e050e19fa6b212f1859c55bdbb43b4fe0a..97ce0492f54751cacf91f58ec0a45e6fd678d167 100644 (file)
@@ -56,6 +56,7 @@ public:
     PGActivationBlocker::BlockingEvent,
     CommonPGPipeline::RecoverMissing::BlockingEvent,
     CommonPGPipeline::GetOBC::BlockingEvent,
+    CommonPGPipeline::LockOBC::BlockingEvent,
     CommonPGPipeline::Process::BlockingEvent,
     CompletionEvent
   > tracking_events;