]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #4690 from branch-predictor/wip-radosbench-memjuggle
authorKefu Chai <tchaikov@gmail.com>
Sun, 14 Jun 2015 16:03:45 +0000 (00:03 +0800)
committerKefu Chai <tchaikov@gmail.com>
Sun, 14 Jun 2015 16:03:45 +0000 (00:03 +0800)
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 <ldachary@redhat.com>
1  2 
src/common/buffer.cc
src/common/obj_bencher.cc
src/include/buffer.h

Simple merge
index 8fd963ba4db4e3b0e8273170af4970d207469a2f,f39f7a355683e9fef2004bfb2b6d8bc82a1bc415..20295577650d2d0cfc1b41c57d61eeb415d5cc9e
@@@ -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
Simple merge