From: Sage Weil Date: Thu, 23 Apr 2015 00:22:32 +0000 (-0700) Subject: os/newstore: release wal throttle when wal completes, not when queued X-Git-Tag: v9.1.0~242^2~49 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=dd79b4d8328801ce23594ca05f1a71dc85ca4ef2;p=ceph.git os/newstore: release wal throttle when wal completes, not when queued 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 --- diff --git a/src/os/newstore/NewStore.cc b/src/os/newstore/NewStore.cc index b1222d02c0d9..1367e6e5bc1a 100644 --- a/src/os/newstore/NewStore.cc +++ b/src/os/newstore/NewStore.cc @@ -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(); diff --git a/src/os/newstore/NewStore.h b/src/os/newstore/NewStore.h index 961b55cce1e3..fbe1cf0423e7 100644 --- a/src/os/newstore/NewStore.h +++ b/src/os/newstore/NewStore.h @@ -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 {