]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: flush log in caller(s), not scatter_writebehind
authorSage Weil <sage@newdream.net>
Mon, 14 Sep 2009 22:34:47 +0000 (15:34 -0700)
committerSage Weil <sage@newdream.net>
Mon, 14 Sep 2009 22:34:47 +0000 (15:34 -0700)
Otherwise scatter_tick(), in particular, will call scatter_writebehind
a zillion times and generate lots of small log flushes.  Instead, flush
at the end of the whole tick.

src/mds/Locker.cc
src/mds/journal.cc

index 614994518bbb1040a6b25593670e0f8c58a1121e..bb7ac65aab7f5cd19cc220aa352900c0bac7a4f6 100644 (file)
@@ -487,6 +487,7 @@ void Locker::eval_gather(SimpleLock *lock, bool first, bool *need_issue)
 
       if (lock->is_updated()) {
        scatter_writebehind((ScatterLock*)lock);
+       mds->mdlog->flush();
        return;
       }
       
@@ -2562,6 +2563,7 @@ bool Locker::simple_sync(SimpleLock *lock, bool *need_issue)
     if (!gather && lock->is_updated()) {
       lock->get_parent()->auth_pin(lock);
       scatter_writebehind((ScatterLock*)lock);
+      mds->mdlog->flush();
       return false;
     }
 
@@ -2685,6 +2687,7 @@ void Locker::simple_lock(SimpleLock *lock, bool *need_issue)
   if (!gather && lock->is_updated()) {
     lock->get_parent()->auth_pin(lock);
     scatter_writebehind((ScatterLock*)lock);
+    mds->mdlog->flush();
     return;
   }
 
@@ -2824,7 +2827,6 @@ void Locker::scatter_writebehind(ScatterLock *lock)
   
   mds->mdlog->submit_entry(le);
   mds->mdlog->wait_for_sync(new C_Locker_ScatterWB(this, lock, mut));
-  mds->mdlog->flush();
 }
 
 void Locker::scatter_writebehind_finish(ScatterLock *lock, Mutation *mut)
@@ -3003,6 +3005,7 @@ void Locker::scatter_tick()
     updated_scatterlocks.pop_front();
     scatter_nudge(lock, 0);
   }
+  mds->mdlog->flush();
 }
 
 
@@ -3543,6 +3546,7 @@ void Locker::handle_file_lock(ScatterLock *lock, MLock *m)
       dout(7) << "handle_file_lock trying nudge on " << *lock
              << " on " << *lock->get_parent() << dendl;
       scatter_nudge(lock, 0);
+      mds->mdlog->flush();
     } else {
       dout(7) << "handle_file_lock IGNORING nudge on non-auth " << *lock
              << " on " << *lock->get_parent() << dendl;
index 2cb4750c0e1fa075931d72ef2a482e4c7e6e44a2..4112be7202e48bb3abcc521bd4264bd5aa5ac154 100644 (file)
@@ -273,6 +273,7 @@ C_Gather *LogSegment::try_to_expire(MDS *mds)
 
   if (gather) {
     dout(6) << "LogSegment(" << offset << ").try_to_expire waiting" << dendl;
+    mds->mdlog->flush();
   } else {
     dout(6) << "LogSegment(" << offset << ").try_to_expire success" << dendl;
   }