]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
*** empty log message ***
authorsage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Fri, 10 Feb 2006 05:27:26 +0000 (05:27 +0000)
committersage <sage@29311d96-e01e-0410-9327-a35deaab8ce9>
Fri, 10 Feb 2006 05:27:26 +0000 (05:27 +0000)
git-svn-id: https://ceph.svn.sf.net/svnroot/ceph@600 29311d96-e01e-0410-9327-a35deaab8ce9

ceph/client/SyntheticClient.cc
ceph/config.cc
ceph/osd/FakeStore.cc
ceph/osd/FakeStore.h
ceph/osd/OBFSStore.cc
ceph/osd/OSD.cc
ceph/script/comb.pl [new file with mode: 0755]
ceph/script/runset.pl

index b2072d38a04a0efc34b099c72d0c63868f04a728..cd4807641478b3fda38bba6bf8981bb77ae60c58 100644 (file)
@@ -660,7 +660,10 @@ int SyntheticClient::write_file(string& fn, int size, int wrsize)   // size is i
   if (fd < 0) return fd;
 
   for (unsigned i=0; i<chunks; i++) {
-       if (time_to_stop()) break;
+       if (time_to_stop()) {
+         dout(0) << "stopping" << endl;
+         break;
+       }
        dout(2) << "writing block " << i << "/" << chunks << endl;
        
        // fill buf with a fingerprint
index 960ec2a20a31fee729264b4023aabc7091ad1a26..1c8b64ba04e89273490e13fbb6c16678aad28e9a 100644 (file)
@@ -326,7 +326,7 @@ void parse_config_options(vector<char*>& args)
        else if (strcmp(args[i], "--fakestore") == 0) {
          g_conf.ebofs = 0;
          g_conf.osd_pg_bits = 5;
-         //g_conf.fake_osd_sync = 2;
+         g_conf.osd_maxthreads = 1;   // fucking hell
        }
        else if (strcmp(args[i], "--fakestore_fsync") == 0) 
          g_conf.fakestore_fsync = atoi(args[++i]);
@@ -335,7 +335,7 @@ void parse_config_options(vector<char*>& args)
 
        else if (strcmp(args[i], "--obfs") == 0) {
          g_conf.uofs = 1;
-         //g_conf.fake_osd_sync = 2;
+         g_conf.osd_maxthreads = 1;   // until feng merges joel's fixes
        }
 
        else if (strcmp(args[i], "--osd_mkfs") == 0) 
index 56a44c96c1b59b0dbe254eb55314016c132a4983..1e59ea979afbf6c3ba362cd427c05967f292843e 100644 (file)
@@ -58,13 +58,13 @@ int FakeStore::mount()
        return r;
   }
 
-  {
+  /*{
        char name[80];
        sprintf(name,"osd%d.fakestore.threadpool", whoami);
        fsync_threadpool = new ThreadPool<FakeStore, pair<int,Context*> >(name, g_conf.fakestore_syncthreads, 
                                                                                                                                          (void (*)(FakeStore*, pair<int,Context*>*))dofsync, 
                                                                                                                                          this);
-  }
+                                                                                                                                         }*/
 
   // all okay.
   return 0;
@@ -77,7 +77,7 @@ int FakeStore::umount()
   // close collections db files
   //close_collections();
 
-  delete fsync_threadpool;
+  //delete fsync_threadpool;
 
   // nothing
   return 0;
@@ -93,14 +93,14 @@ int FakeStore::statfs(struct statfs *buf)
 
 ///////////
 
-void FakeStore::do_fsync(int fd, Context *c)
+/*void FakeStore::do_fsync(int fd, Context *c)
 {
   ::fsync(fd);
   ::close(fd);
   dout(10) << "do_fsync finished on " << fd << " context " << c << endl;
   c->finish(0);
   delete c;
-}
+}*/
 
 
 ////
@@ -362,7 +362,7 @@ int FakeStore::write(object_t oid,
                                                          onsafe);
          ::close(fd);
        } else { 
-         queue_fsync(fd, onsafe);
+         assert(0); //queue_fsync(fd, onsafe);
        }
   } else {
        ::close(fd);
index 037646958d0e12364b6382344298dbda8ef86e7b..76b20c28da1a993679ca8d9e31f1f73fdc155db7 100644 (file)
@@ -15,6 +15,7 @@ using namespace std;
 #include <ext/hash_map>
 using namespace __gnu_cxx;
 
+
 // fake attributes in memory, if we need to.
 
 
@@ -32,6 +33,7 @@ class FakeStore : public ObjectStore,
   void wipe_dir(string mydir);
 
 
+  /*
   // async fsync
   class ThreadPool<class FakeStore, pair<int, class Context*> >  *fsync_threadpool;
   void queue_fsync(int fd, class Context *c) {
@@ -43,7 +45,7 @@ class FakeStore : public ObjectStore,
        f->do_fsync(af->first, af->second);
        delete af;
   }
-
+  */
 
  public:
   FakeStore(char *base, int whoami);
index 2962282f808a67b4e5b8b9be30f28c7526d32126..885c67eeaf1fcb67cfdc0e52399d4a493111ded3 100644 (file)
@@ -5,6 +5,8 @@ extern "C" {
 #include "../../uofs/uofs.h"
 }
 
+#include "common/Timer.h"
+
 #include "include/types.h"
 
 #include <unistd.h>
@@ -21,7 +23,7 @@ extern "C" {
 
 #include "config.h"
 #undef dout
-#define  dout(l)    if (l<=g_conf.debug) cout << "osd" << whoami << ".obfsstore "
+#define  dout(l)    if (l<=g_conf.debug) cout << "osd" << whoami << ".obfs "
 
 OBFSStore::OBFSStore(int whoami, char *param, char *dev)
 {
@@ -200,14 +202,12 @@ int OBFSStore::read(object_t oid, size_t len,
 int OBFSStore::write(object_t oid, size_t len,
                                         off_t offset, bufferlist& bl, bool fsync)
 {
-       int ret;//, sync = 0;
+       int ret = 0;
        
        //dout(0) << "calling write function!" << endl;
        //if (whoami == 0)
        //      dout(0) << oid << " 0  " << len << " " << offset << " 101" << endl;
-       //if (fsync) sync = 1;
 
-       ret = 0;
        for (list<bufferptr>::iterator p = bl.buffers().begin();
                 p != bl.buffers().end();
                 p++) {
@@ -224,9 +224,7 @@ int OBFSStore::write(object_t oid, size_t len,
 int OBFSStore::write(object_t oid, size_t len,
                     off_t offset, bufferlist& bl, Context *onflush)
 {
-  write(oid, len, offset, bl, false);
-
-  g_timer.add_event_after((float)g_conf.uofs_fake_sync,
-                                                 onsafe);
-  return 0;
+  int r = write(oid, len, offset, bl, false);
+  g_timer.add_event_after((float)g_conf.uofs_fake_sync, onflush);
+  return r;
 }
index 581680e458a03b6154843c76908b76e2dacccddf..3e770208e0094eb70d7bea65ad41e2b1afa48fb5 100644 (file)
@@ -220,7 +220,7 @@ void OSD::lock_object(object_t oid)
   osd_lock.Lock();
   if (object_lock.count(oid)) {
        Cond c;
-       dout(15) << "lock_object " << hex << oid << dec << " waiting as " << &c << endl;
+       dout(0) << "lock_object " << hex << oid << dec << " waiting as " << &c << endl;
        object_lock_waiters[oid].push_back(&c);
        c.Wait(osd_lock);
        assert(object_lock.count(oid));
diff --git a/ceph/script/comb.pl b/ceph/script/comb.pl
new file mode 100755 (executable)
index 0000000..0e4e634
--- /dev/null
@@ -0,0 +1,75 @@
+#!/usr/bin/perl
+
+use strict;
+
+my $xaxis = shift @ARGV;
+my @vars;
+while (@ARGV) {
+       $_ = shift @ARGV;
+       last if ($_ eq '-');
+       push(@vars, $_);
+}
+my @dirs;
+while (@ARGV) {
+       $_ = shift @ARGV;
+       last if ($_ eq '-');
+       push(@dirs, $_) if -d $_;
+}
+my @filt = @ARGV;
+push( @filt, '.' ) unless @filt;
+
+print "#xaxis $xaxis
+#vars @vars
+#dirs @dirs
+#filt @filt
+";
+
+sub load_sum {
+       my $fn = shift @_;
+
+       open(I, "$fn");
+       my $k = <I>;
+       chomp($k);
+       my @k = split(/\s+/,$k);
+       shift @k;
+
+       my $s;
+       while (<I>) {
+               chomp;
+               s/^\#//;
+               next unless $_;
+               my @l = split(/\s+/,$_);
+               my $k = shift @l;
+               for my $f (@k) {
+                       $s->{$k}->{$f} = shift @l;
+               }
+       }               
+       return $s;
+}
+
+
+my %res;
+my @key;
+my %didkey;
+for my $f (@filt) {
+       for my $d (@dirs) {
+               next if ($f ne '.' && $d !~ /$f/);                      
+
+               my ($x) = $d =~ /$xaxis=(\d+)/;
+               
+               for my $v (@vars) {
+                       my ($what, $field) = split(/\./, $v);
+                       my $s = &load_sum("$d/sum.$what");
+                       
+                       #print "\t$v";
+                       push( @{$res{$x}}, $s->{'avgval'}->{$field} );
+                       push( @key, "$f.$field" ) unless $didkey{"$f.$field"};
+                       $didkey{"$f.$field"} = 1;
+               }
+       }
+}
+
+print join("\t", "#", @key) . "\n";
+for my $x (sort {$a <=> $b} keys %res) {
+       print join("\t", $x, @{$res{$x}}) . "\n";
+}
index 17e6c5a6609c5f5e089c0efe7fb654f9cf950b8a..07cbe45f8c2cdf0c4da4c56d6d83a32e4c718729 100755 (executable)
@@ -116,7 +116,12 @@ sub run {
        $c .= " --syn until $h->{'until'}" if $h->{'until'};
        $c .= " --syn writefile $h->{'writefile_mb'} $h->{'writefile_size'}" if $h->{'writefile'};
        $c .= ' ' . $h->{'custom'} if $h->{'custom'};
+
+       # HACKS
+       #$c .= " --osd_maxthreads 0" if $h->{'fs'} ne 'ebofs';
+
        $c .= " --log_name $fn";
+
        
        print "-> $c\n";
        my $r;