]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: avoid the config's get_val() overhead on the read path.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 31 Jan 2018 23:51:14 +0000 (00:51 +0100)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Thu, 1 Feb 2018 09:43:22 +0000 (10:43 +0100)
Profiling shows the overhead of the md_config_t::get_val<T>
can be significant. Unfortunately, it is being used in two
critical places across the read path.

The patch resorts to the legacy config infrastructure to
mitigate the performance penalty. It is expected it will
be superseded with a solution that allows to use the new,
intended routines without hurting performance.
`
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
src/common/legacy_config_opts.h
src/osd/PG.cc
src/osd/PrimaryLogPG.cc

index cf28ca39b3ceca1781ac33ccfb1841d260274e11..b6a53caadbc77911e34470e3c2620155b1c9e3ff 100644 (file)
@@ -812,6 +812,8 @@ OPTION(osd_fast_info, OPT_BOOL) // use fast info attr, if we can
 // determines whether PGLog::check() compares written out log to stored log
 OPTION(osd_debug_pg_log_writeout, OPT_BOOL)
 OPTION(osd_loop_before_reset_tphandle, OPT_U32) // Max number of loop before we reset thread-pool's handle
+OPTION(osd_max_snap_prune_intervals_per_epoch, OPT_U64) // Max number of snap intervals to report to mgr in pg_stat_t
+
 // default timeout while caling WaitInterval on an empty queue
 OPTION(threadpool_default_timeout, OPT_INT)
 // default wait time for an empty queue before pinging the hb timeout
index fd3e268170eec7e224f660c875dd28201c88f07a..6c580bc8979ea3707f151c26c9df577809fbbadc 100644 (file)
@@ -2912,7 +2912,7 @@ void PG::publish_stats_to_osd()
   if (get_osdmap()->require_osd_release >= CEPH_RELEASE_MIMIC) {
     // share (some of) our purged_snaps via the pg_stats. limit # of intervals
     // because we don't want to make the pg_stat_t structures too expensive.
-    unsigned max = cct->_conf->get_val<uint64_t>("osd_max_snap_prune_intervals_per_epoch");
+    unsigned max = cct->_conf->osd_max_snap_prune_intervals_per_epoch;
     unsigned num = 0;
     auto i = info.purged_snaps.begin();
     while (num < max && i != info.purged_snaps.end()) {
index c3c62f01aecd289344b5c793cb6b4d1b6a530f16..85056b44db6a53c998ccd9c5288894a09cb38d28 100644 (file)
@@ -5494,9 +5494,8 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector<OSDOp>& ops)
   object_info_t& oi = obs.oi;
   const hobject_t& soid = oi.soid;
   bool skip_data_digest = osd->store->has_builtin_csum() &&
-    g_conf->get_val<bool>("osd_skip_data_digest");
-  auto osd_max_object_size = cct->_conf->get_val<uint64_t>(
-    "osd_max_object_size");
+    cct->_conf->osd_skip_data_digest;
+  const uint64_t osd_max_object_size = cct->_conf->osd_max_object_size;
 
   PGTransaction* t = ctx->op_t.get();