]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: Separate removal and recovery thread pools
authorDavid Zafman <dzafman@redhat.com>
Tue, 9 Oct 2018 16:11:29 +0000 (09:11 -0700)
committerDavid Zafman <dzafman@redhat.com>
Tue, 13 Nov 2018 20:18:24 +0000 (12:18 -0800)
The name "disk_tp" was misleading because it was only used for
removal and recovery.

Signed-off-by: David Zafman <dzafman@redhat.com>
This backport is not cherry-picked from master since the remove
threadpool was folded into the main op queue post-luminous, so the
code is almost entirely different.

src/common/legacy_config_opts.h
src/common/options.cc
src/osd/OSD.cc
src/osd/OSD.h

index a51870ef64289ba12163b40b4c0a02ec4792995f..8232fdc3d788eb92fea4ea6c2fac40b28344cb89 100644 (file)
@@ -665,7 +665,8 @@ OPTION(osd_peering_wq_threads, OPT_INT)
 OPTION(osd_peering_wq_batch_size, OPT_U64)
 OPTION(osd_op_pq_max_tokens_per_priority, OPT_U64)
 OPTION(osd_op_pq_min_cost, OPT_U64)
-OPTION(osd_disk_threads, OPT_INT)
+OPTION(osd_remove_threads, OPT_INT)
+OPTION(osd_recovery_threads, OPT_INT)
 OPTION(osd_disk_thread_ioprio_class, OPT_STR) // rt realtime be best effort idle
 OPTION(osd_disk_thread_ioprio_priority, OPT_INT) // 0-7
 OPTION(osd_recover_clone_overlap, OPT_BOOL)   // preserve clone_overlap during recovery/migration
index ff3bb1a1be193d7c4e66310a83f106cb24982ce8..970a12f3fe6144874819e5150cf49d3d144a02f7 100644 (file)
@@ -1950,7 +1950,11 @@ std::vector<Option> get_global_options() {
     .set_default(65536)
     .set_description(""),
 
-    Option("osd_disk_threads", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    Option("osd_remove_threads", Option::TYPE_INT, Option::LEVEL_ADVANCED)
+    .set_default(1)
+    .set_description(""),
+
+    Option("osd_recovery_threads", Option::TYPE_INT, Option::LEVEL_ADVANCED)
     .set_default(1)
     .set_description(""),
 
index 810e8583b73e8785b0812240b0b0cbbe235a8d40..75063ef84ae4460a50a6d3b190eb7befda8f3921 100644 (file)
@@ -216,7 +216,7 @@ OSDService::OSDService(OSD *osd) :
   monc(osd->monc),
   peering_wq(osd->peering_wq),
   recovery_gen_wq("recovery_gen_wq", cct->_conf->osd_recovery_thread_timeout,
-                 &osd->disk_tp),
+                 &osd->recovery_tp),
   class_handler(osd->class_handler),
   pg_epoch_lock("OSDService::pg_epoch_lock"),
   publish_lock("OSDService::publish_lock"),
@@ -1972,7 +1972,8 @@ OSD::OSD(CephContext *cct_, ObjectStore *store_,
             "osd_peering_tp_threads"),
   osd_op_tp(cct, "OSD::osd_op_tp", "tp_osd_tp",
            get_num_op_threads()),
-  disk_tp(cct, "OSD::disk_tp", "tp_osd_disk", cct->_conf->osd_disk_threads, "osd_disk_threads"),
+  remove_tp(cct, "OSD::remove_tp", "tp_osd_remove", cct->_conf->osd_remove_threads, "osd_remove_threads"),
+  recovery_tp(cct, "OSD::recovery_tp", "tp_osd_recovery", cct->_conf->osd_recovery_threads, "osd_recovery_threads"),
   command_tp(cct, "OSD::command_tp", "tp_osd_cmd",  1),
   session_waiting_lock("OSD::session_waiting_lock"),
   osdmap_subscribe_lock("OSD::osdmap_subscribe_lock"),
@@ -2023,7 +2024,7 @@ OSD::OSD(CephContext *cct_, ObjectStore *store_,
     store,
     cct->_conf->osd_remove_thread_timeout,
     cct->_conf->osd_remove_thread_suicide_timeout,
-    &disk_tp),
+    &remove_tp),
   service(this)
 {
   monc->set_messenger(client_messenger);
@@ -2671,7 +2672,8 @@ int OSD::init()
   service.max_oldest_map = superblock.oldest_map;
 
   osd_op_tp.start();
-  disk_tp.start();
+  remove_tp.start();
+  recovery_tp.start();
   command_tp.start();
 
   set_disk_tp_priority();
@@ -3424,9 +3426,13 @@ int OSD::shutdown()
   command_tp.stop();
   dout(10) << "command tp stopped" << dendl;
 
-  disk_tp.drain();
-  disk_tp.stop();
-  dout(10) << "disk tp paused (new)" << dendl;
+  remove_tp.drain();
+  remove_tp.stop();
+  dout(10) << "remove tp paused (new)" << dendl;
+
+  recovery_tp.drain();
+  recovery_tp.stop();
+  dout(10) << "recovery tp paused (new)" << dendl;
 
   dout(10) << "stopping agent" << dendl;
   service.agent_stop();
@@ -10086,12 +10092,14 @@ void OSD::set_disk_tp_priority()
     return;
   int cls =
     ceph_ioprio_string_to_class(cct->_conf->osd_disk_thread_ioprio_class);
-  if (cls < 0)
+  if (cls < 0) {
     derr << __func__ << cpp_strerror(cls) << ": "
         << "osd_disk_thread_ioprio_class is " << cct->_conf->osd_disk_thread_ioprio_class
         << " but only the following values are allowed: idle, be or rt" << dendl;
-  else
-    disk_tp.set_ioprio(cls, cct->_conf->osd_disk_thread_ioprio_priority);
+  } else {
+    remove_tp.set_ioprio(cls, cct->_conf->osd_disk_thread_ioprio_priority);
+    recovery_tp.set_ioprio(cls, cct->_conf->osd_disk_thread_ioprio_priority);
+  }
 }
 
 // --------------------------------
index 4523fb2807f2e62db2fc3532ed65e13f88492976..003f3b7b51d097f30fe35d8881d1b3e1869474f9 100644 (file)
@@ -1392,7 +1392,8 @@ private:
 
   ThreadPool peering_tp;
   ShardedThreadPool osd_op_tp;
-  ThreadPool disk_tp;
+  ThreadPool remove_tp;
+  ThreadPool recovery_tp;
   ThreadPool command_tp;
 
   void set_disk_tp_priority();