From: Sage Weil Date: Tue, 17 Dec 2013 20:15:51 +0000 (-0800) Subject: crush: expand info about tunables that we dump X-Git-Tag: v0.75~82^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=88365c2953ffdb74b2f65d5afbdbdef8eea1846a;p=ceph.git crush: expand info about tunables that we dump Include the tunables profile, and flags indicating whether it is optimal, legacy, or requires certain features. Signed-off-by: Sage Weil --- diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index eb0d556ffd8..5318ddd8a79 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -1071,11 +1071,29 @@ void CrushWrapper::dump(Formatter *f) const f->close_section(); f->open_object_section("tunables"); + dump_tunables(f); + f->close_section(); +} + +void CrushWrapper::dump_tunables(Formatter *f) const +{ f->dump_int("choose_local_tries", get_choose_local_tries()); f->dump_int("choose_local_fallback_tries", get_choose_local_fallback_tries()); f->dump_int("choose_total_tries", get_choose_total_tries()); f->dump_int("chooseleaf_descend_once", get_chooseleaf_descend_once()); - f->close_section(); + + // be helpful about it + if (has_bobtail_tunables()) + f->dump_string("profile", "bobtail"); + else if (has_argonaut_tunables()) + f->dump_string("profile", "argonaut"); + else + f->dump_string("profile", "unknown"); + f->dump_int("optimal_tunables", (int)has_optimal_tunables()); + f->dump_int("legacy_tunables", (int)has_legacy_tunables()); + + f->dump_int("require_feature_tunables", (int)has_nondefault_tunables()); + f->dump_int("require_feature_tunables2", (int)has_nondefault_tunables2()); } void CrushWrapper::dump_rules(Formatter *f) const diff --git a/src/crush/CrushWrapper.h b/src/crush/CrushWrapper.h index c0315c32a47..9931fae1e7f 100644 --- a/src/crush/CrushWrapper.h +++ b/src/crush/CrushWrapper.h @@ -151,6 +151,28 @@ public: crush->chooseleaf_descend_once = !!n; } + bool has_argonaut_tunables() const { + return + crush->choose_local_tries == 2 && + crush->choose_local_fallback_tries == 5 && + crush->choose_total_tries == 19 && + crush->chooseleaf_descend_once == 0; + } + bool has_bobtail_tunables() const { + return + crush->choose_local_tries == 0 && + crush->choose_local_fallback_tries == 0 && + crush->choose_total_tries == 50 && + crush->chooseleaf_descend_once == 1; + } + + bool has_optimal_tunables() const { + return has_bobtail_tunables(); + } + bool has_legacy_tunables() const { + return has_argonaut_tunables(); + } + bool has_nondefault_tunables() const { return (crush->choose_local_tries != 2 || @@ -163,13 +185,6 @@ public: } bool has_v2_rules() const; - bool has_optimal_tunables() const { - return - crush->choose_local_tries == 0 && - crush->choose_local_fallback_tries == 0 && - crush->choose_total_tries == 50 && - crush->chooseleaf_descend_once == 1; - } // bucket types int get_num_type_names() const { @@ -817,6 +832,7 @@ public: void decode_crush_bucket(crush_bucket** bptr, bufferlist::iterator &blp); void dump(Formatter *f) const; void dump_rules(Formatter *f) const; + void dump_tunables(Formatter *f) const; void list_rules(Formatter *f) const; void dump_tree(const vector<__u32>& w, ostream *out, Formatter *f) const; static void generate_test_instances(list& o);