out << "tunable choose_total_tries " << crush.get_choose_total_tries() << "\n";
if (crush.get_chooseleaf_descend_once() != 0)
out << "tunable chooseleaf_descend_once " << crush.get_chooseleaf_descend_once() << "\n";
+ if (crush.get_chooseleaf_vary_r() != 0)
+ out << "tunable chooseleaf_vary_r " << crush.get_chooseleaf_vary_r() << "\n";
out << "\n# devices\n";
for (int i=0; i<crush.get_max_devices(); i++) {
crush.set_choose_total_tries(val);
else if (name == "chooseleaf_descend_once")
crush.set_chooseleaf_descend_once(val);
+ else if (name == "chooseleaf_vary_r")
+ crush.set_chooseleaf_vary_r(val);
else {
err << "tunable " << name << " not recognized" << std::endl;
return -1;
::encode(crush->choose_local_fallback_tries, bl);
::encode(crush->choose_total_tries, bl);
::encode(crush->chooseleaf_descend_once, bl);
+ ::encode(crush->chooseleaf_vary_r, bl);
}
static void decode_32_or_64_string_map(map<int32_t,string>& m, bufferlist::iterator& blp)
if (!blp.end()) {
::decode(crush->chooseleaf_descend_once, blp);
}
+ if (!blp.end()) {
+ ::decode(crush->chooseleaf_vary_r, blp);
+ }
finalize();
}
catch (...) {
f->dump_int("chooseleaf_descend_once", get_chooseleaf_descend_once());
// be helpful about it
- if (has_bobtail_tunables())
+ if (has_firefly_tunables())
+ f->dump_string("profile", "firefly");
+ else if (has_bobtail_tunables())
f->dump_string("profile", "bobtail");
else if (has_argonaut_tunables())
f->dump_string("profile", "argonaut");
crush->choose_local_fallback_tries = 5;
crush->choose_total_tries = 19;
crush->chooseleaf_descend_once = 0;
+ crush->chooseleaf_vary_r = 0;
}
void set_tunables_bobtail() {
crush->choose_local_tries = 0;
crush->choose_local_fallback_tries = 0;
crush->choose_total_tries = 50;
crush->chooseleaf_descend_once = 1;
+ crush->chooseleaf_vary_r = 0;
+ }
+ void set_tunables_firefly() {
+ crush->choose_local_tries = 0;
+ crush->choose_local_fallback_tries = 0;
+ crush->choose_total_tries = 50;
+ crush->chooseleaf_descend_once = 1;
+ crush->chooseleaf_vary_r = 1;
}
void set_tunables_legacy() {
set_tunables_argonaut();
}
void set_tunables_optimal() {
- set_tunables_bobtail();
+ set_tunables_firefly();
}
void set_tunables_default() {
set_tunables_bobtail();
crush->chooseleaf_descend_once = !!n;
}
+ int get_chooseleaf_vary_r() const {
+ return crush->chooseleaf_vary_r;
+ }
+ void set_chooseleaf_vary_r(int n) {
+ crush->chooseleaf_vary_r = 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;
+ crush->chooseleaf_descend_once == 0 &&
+ crush->chooseleaf_vary_r == 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;
+ crush->chooseleaf_descend_once == 1 &&
+ crush->chooseleaf_vary_r == 0;
+ }
+ bool has_firefly_tunables() const {
+ return
+ crush->choose_local_tries == 0 &&
+ crush->choose_local_fallback_tries == 0 &&
+ crush->choose_total_tries == 50 &&
+ crush->chooseleaf_descend_once == 1 &&
+ crush->chooseleaf_vary_r == 1;
}
bool has_optimal_tunables() const {
- return has_bobtail_tunables();
+ return has_firefly_tunables();
}
bool has_legacy_tunables() const {
return has_argonaut_tunables();
return
crush->chooseleaf_descend_once != 0;
}
+ bool has_nondefault_tunables3() const {
+ return
+ crush->chooseleaf_vary_r != 0;
+ }
bool has_v2_rules() const;
this bit to determine if peers support NAK messages. */
#define CEPH_FEATURE_OSDMAP_ENC (1ULL<<39)
#define CEPH_FEATURE_MDS_INLINE_DATA (1ULL<<40)
+#define CEPH_FEATURE_CRUSH_TUNABLES3 (1ULL<<41)
/*
* The introduction of CEPH_FEATURE_OSD_SNAPMAPPER caused the feature
CEPH_FEATURE_OSD_ERASURE_CODES | \
CEPH_FEATURE_OSDMAP_ENC | \
CEPH_FEATURE_MDS_INLINE_DATA | \
+ CEPH_FEATURE_CRUSH_TUNABLES3 | \
0ULL)
#define CEPH_FEATURES_SUPPORTED_DEFAULT CEPH_FEATURES_ALL
#define CEPH_FEATURES_CRUSH \
(CEPH_FEATURE_CRUSH_TUNABLES | \
CEPH_FEATURE_CRUSH_TUNABLES2 | \
+ CEPH_FEATURE_CRUSH_TUNABLES3 | \
CEPH_FEATURE_CRUSH_V2)
#endif
features |= CEPH_FEATURE_CRUSH_TUNABLES2;
if (crush->has_v2_rules())
features |= CEPH_FEATURE_CRUSH_V2;
+ if (crush->has_nondefault_tunables3())
+ features |= CEPH_FEATURE_CRUSH_TUNABLES3;
mask |= CEPH_FEATURES_CRUSH;
for (map<int64_t,pg_pool_t>::const_iterator p = pools.begin(); p != pools.end(); ++p) {
set choose total descent attempts
--set-chooseleaf-descend-once <0|1>
set chooseleaf to (not) retry the recursive descent
+ --set-chooseleaf-vary-r <0|1>
+ set chooseleaf to (not) vary r based on parent
--output-name name
prepend the data file(s) generated during the
testing routine with name
cout << " set choose total descent attempts\n";
cout << " --set-chooseleaf-descend-once <0|1>\n";
cout << " set chooseleaf to (not) retry the recursive descent\n";
+ cout << " --set-chooseleaf-vary-r <0|1>\n";
+ cout << " set chooseleaf to (not) vary r based on parent\n";
cout << " --output-name name\n";
cout << " prepend the data file(s) generated during the\n";
cout << " testing routine with name\n";
int choose_local_fallback_tries = -1;
int choose_total_tries = -1;
int chooseleaf_descend_once = -1;
+ int chooseleaf_vary_r = -1;
CrushWrapper crush;
} else if (ceph_argparse_withint(args, i, &chooseleaf_descend_once, &err,
"--set_chooseleaf_descend_once", (char*)NULL)) {
adjust = true;
+ } else if (ceph_argparse_withint(args, i, &chooseleaf_vary_r, &err,
+ "--set_chooseleaf_vary_r", (char*)NULL)) {
+ adjust = true;
} else if (ceph_argparse_flag(args, i, "--reweight", (char*)NULL)) {
reweight = true;
} else if (ceph_argparse_withint(args, i, &add_item, &err, "--add_item", (char*)NULL)) {
crush.set_chooseleaf_descend_once(chooseleaf_descend_once);
modified = true;
}
+ if (chooseleaf_vary_r >= 0) {
+ crush.set_chooseleaf_vary_r(chooseleaf_vary_r);
+ modified = true;
+ }
if (modified) {
crush.finalize();