From: Kefu Chai Date: Sun, 14 Jun 2015 16:03:45 +0000 (+0800) Subject: Merge pull request #4690 from branch-predictor/wip-radosbench-memjuggle X-Git-Tag: v9.0.3~188 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ac4477926f49dc91e012d61096dbbdde5650bc8a;p=ceph.git Merge pull request #4690 from branch-predictor/wip-radosbench-memjuggle tools: improve the performance of rados and rest_bench Don't delete, recreate and re-fill buffers in rados bench. Fixes the high CPU usage by rados bench on fast SSDs and ramdisks/memstore. Reviewed-by: Loic Dachary --- ac4477926f49dc91e012d61096dbbdde5650bc8a diff --cc src/common/obj_bencher.cc index 8fd963ba4db4,f39f7a355683..20295577650d --- a/src/common/obj_bencher.cc +++ b/src/common/obj_bencher.cc @@@ -617,19 -623,13 +623,18 @@@ int ObjBencher::seq_read_bench(int seco lock.Lock(); ++data.started; ++data.in_flight; - snprintf(data.object_contents, data.object_size, "I'm the %16dth object!", current_index); - lock.Unlock(); - if (memcmp(data.object_contents, cur_contents->c_str(), data.object_size) != 0) { - cerr << name[slot] << " is not correct!" << std::endl; - ++errors; + if (!no_verify) { + snprintf(data.object_contents, data.object_size, "I'm the %16dth object!", current_index); + lock.Unlock(); + if (memcmp(data.object_contents, cur_contents->c_str(), data.object_size) != 0) { + cerr << name[slot] << " is not correct!" << std::endl; + ++errors; + } + } else { + lock.Unlock(); } + name[slot] = newName; - delete cur_contents; } //wait for final reads to complete @@@ -819,18 -817,13 +826,17 @@@ int ObjBencher::rand_read_bench(int sec lock.Lock(); ++data.started; ++data.in_flight; - snprintf(data.object_contents, data.object_size, "I'm the %16dth object!", current_index); - lock.Unlock(); - if (memcmp(data.object_contents, cur_contents->c_str(), data.object_size) != 0) { - cerr << name[slot] << " is not correct!" << std::endl; - ++errors; + if (!no_verify) { + snprintf(data.object_contents, data.object_size, "I'm the %16dth object!", current_index); + lock.Unlock(); + if (memcmp(data.object_contents, cur_contents->c_str(), data.object_size) != 0) { + cerr << name[slot] << " is not correct!" << std::endl; + ++errors; + } + } else { + lock.Unlock(); } name[slot] = newName; - delete cur_contents; } //wait for final reads to complete