]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: remove osd_auto_weight function
authorSage Weil <sage@redhat.com>
Wed, 1 Apr 2015 03:52:02 +0000 (20:52 -0700)
committerSage Weil <sage@redhat.com>
Sun, 5 Apr 2015 17:56:02 +0000 (10:56 -0700)
This is essentially dead code.

Signed-off-by: Sage Weil <sage@redhat.com>
src/common/config_opts.h
src/osd/OSD.cc

index 2b9c7e778ef09593c919ce0041170b475c4afa9b..74e8e4aedc2bb756f8281353cb6d48314f2ebd78 100644 (file)
@@ -631,7 +631,6 @@ OPTION(osd_deep_scrub_interval, OPT_FLOAT, 60*60*24*7) // once a week
 OPTION(osd_deep_scrub_stride, OPT_INT, 524288)
 OPTION(osd_deep_scrub_update_digest_min_age, OPT_INT, 2*60*60)   // objects must be this old (seconds) before we update the whole-object digest on scrub
 OPTION(osd_scan_list_ping_tp_interval, OPT_U64, 100)
-OPTION(osd_auto_weight, OPT_BOOL, false)
 OPTION(osd_class_dir, OPT_STR, CEPH_LIBDIR "/rados-classes") // where rados plugins are stored
 OPTION(osd_open_classes_on_start, OPT_BOOL, true)
 OPTION(osd_check_for_log_corruption, OPT_BOOL, false)
index a76f748369cf64a7ef5643fcaf00e920faa5dae1..3d22a7ab8686ae58a61eedb19ce15daf6694af2c 100644 (file)
@@ -1350,37 +1350,6 @@ int OSD::mkfs(CephContext *cct, ObjectStore *store, const string &dev,
       sb.whoami = whoami;
       sb.compat_features = get_osd_initial_compat_set();
 
-      // benchmark?
-      if (cct->_conf->osd_auto_weight) {
-       bufferlist bl;
-       bufferptr bp(1048576);
-       bp.zero();
-       bl.push_back(bp);
-       dout(0) << "testing disk bandwidth..." << dendl;
-       utime_t start = ceph_clock_now(cct);
-       object_t oid("disk_bw_test");
-       for (int i=0; i<1000; i++) {
-         ObjectStore::Transaction *t = new ObjectStore::Transaction;
-         t->write(META_COLL, hobject_t(sobject_t(oid, 0)), i*bl.length(), bl.length(), bl);
-         store->queue_transaction_and_cleanup(NULL, t);
-       }
-       store->sync();
-       utime_t end = ceph_clock_now(cct);
-       end -= start;
-       dout(0) << "measured " << (1000.0 / (double)end) << " mb/sec" << dendl;
-       ObjectStore::Transaction tr;
-       tr.remove(META_COLL, hobject_t(sobject_t(oid, 0)));
-       ret = store->apply_transaction(tr);
-       if (ret) {
-         derr << "OSD::mkfs: error while benchmarking: apply_transaction returned "
-              << ret << dendl;
-         goto umount_store;
-       }
-       
-       // set osd weight
-       sb.weight = (1000.0 / (double)end);
-      }
-
       bufferlist bl;
       ::encode(sb, bl);