]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/newstore: release wal throttle when wal completes, not when queued
authorSage Weil <sage@redhat.com>
Thu, 23 Apr 2015 00:22:32 +0000 (17:22 -0700)
committerSage Weil <sage@redhat.com>
Tue, 1 Sep 2015 17:39:39 +0000 (13:39 -0400)
If we take the aio path, the io is queued immediately and the resources
are released back to the pool.  Instead release them when wal completes.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/newstore/NewStore.cc
src/os/newstore/NewStore.h

index b1222d02c0d9efa59106fe30676ead3389adb7b7..1367e6e5bc1a57b8a089579aa5f0c5311c2e13fa 100644 (file)
@@ -2402,6 +2402,8 @@ int NewStore::_wal_finish(TransContext *txc)
   wal_transaction_t& wt = *txc->wal_txn;
   dout(20) << __func__ << " txc " << " seq " << wt.seq << txc << dendl;
 
+  wal_wq.release_throttle(txc);
+
   string key;
   get_wal_key(wt.seq, &key);
   KeyValueDB::Transaction cleanup = db->get_transaction();
index 961b55cce1e3386adbfb475708c15941aca15ca4..fbe1cf0423e7b35e15373474020ae01a8971d10d 100644 (file)
@@ -412,9 +412,6 @@ public:
        // requeue at the end to minimize contention
        wal_queue.push_back(*i->osr);
       }
-      --ops;
-      bytes -= i->wal_txn->get_bytes();
-      throttle_cond.Signal();
 
       // preserve wal ordering for this sequencer by taking the lock
       // while still holding the queue lock
@@ -445,6 +442,14 @@ public:
        throttle_cond.Wait(lock);
       }
     }
+
+    void release_throttle(TransContext *txc) {
+      lock();
+      --ops;
+      bytes -= txc->wal_txn->get_bytes();
+      throttle_cond.Signal();
+      unlock();
+    }
   };
 
   struct KVSyncThread : public Thread {