From 64c7f313f9bf7a4296b0fbda2e32a1551bb9f5b7 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Thu, 1 Feb 2018 00:51:14 +0100 Subject: [PATCH] osd: avoid the config's get_val() overhead on the read path. Profiling shows the overhead of the md_config_t::get_val 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 --- src/common/legacy_config_opts.h | 2 ++ src/osd/PG.cc | 2 +- src/osd/PrimaryLogPG.cc | 5 ++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/common/legacy_config_opts.h b/src/common/legacy_config_opts.h index cf28ca39b3c..b6a53caadbc 100644 --- a/src/common/legacy_config_opts.h +++ b/src/common/legacy_config_opts.h @@ -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 diff --git a/src/osd/PG.cc b/src/osd/PG.cc index fd3e268170e..6c580bc8979 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -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("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()) { diff --git a/src/osd/PrimaryLogPG.cc b/src/osd/PrimaryLogPG.cc index c3c62f01aec..85056b44db6 100644 --- a/src/osd/PrimaryLogPG.cc +++ b/src/osd/PrimaryLogPG.cc @@ -5494,9 +5494,8 @@ int PrimaryLogPG::do_osd_ops(OpContext *ctx, vector& 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("osd_skip_data_digest"); - auto osd_max_object_size = cct->_conf->get_val( - "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(); -- 2.39.5