From: xie xingguo Date: Tue, 13 Jun 2017 11:25:17 +0000 (+0800) Subject: os/bluestore: initialize finishers properly X-Git-Tag: v12.1.0~120^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=14ff4a584f2f650182debef3c698d09ca7275b31;p=ceph.git os/bluestore: initialize finishers properly We shall set m_finishers according to our backend hard driver's type now. Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index e89986833920..a9083f8f7964 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -3302,17 +3302,6 @@ BlueStore::BlueStore(CephContext *cct, const string& path) _init_logger(); cct->_conf->add_observer(this); set_cache_shards(1); - - if (cct->_conf->bluestore_shard_finishers) { - m_finisher_num = cct->_conf->osd_op_num_shards; - } - - for (int i = 0; i < m_finisher_num; ++i) { - ostringstream oss; - oss << "finisher-" << i; - Finisher *f = new Finisher(cct, oss.str(), "finisher"); - finishers.push_back(f); - } } BlueStore::BlueStore(CephContext *cct, @@ -8051,6 +8040,29 @@ void BlueStore::_osr_unregister_all() void BlueStore::_kv_start() { dout(10) << __func__ << dendl; + + if (cct->_conf->bluestore_shard_finishers) { + if (cct->_conf->osd_op_num_shards) { + m_finisher_num = cct->_conf->osd_op_num_shards; + } else { + assert(bdev); + if (bdev->is_rotational()) { + m_finisher_num = cct->_conf->osd_op_num_shards_hdd; + } else { + m_finisher_num = cct->_conf->osd_op_num_shards_ssd; + } + } + } + + assert(m_finisher_num != 0); + + for (int i = 0; i < m_finisher_num; ++i) { + ostringstream oss; + oss << "finisher-" << i; + Finisher *f = new Finisher(cct, oss.str(), "finisher"); + finishers.push_back(f); + } + for (auto f : finishers) { f->start(); }