diff options
author | Sage Weil <sage@inktank.com> | 2013-03-22 09:15:52 -0700 |
---|---|---|
committer | Sage Weil <sage@inktank.com> | 2013-03-22 09:15:52 -0700 |
commit | 0981e4666bd70f191302cd2e6f10c5a7c2d503bd (patch) | |
tree | f2fc9c76b77642e6d2a9d26e203211cd13bd1533 | |
parent | a35b8650931b441621c130c85e30cb6f3a0a7f93 (diff) | |
parent | 38a5acbb82779e6cae2f913a0402b04be458969a (diff) | |
download | ceph-0981e4666bd70f191302cd2e6f10c5a7c2d503bd.tar.gz |
Merge branch 'next'
-rw-r--r-- | src/common/config_opts.h | 2 | ||||
-rw-r--r-- | src/mon/AuthMonitor.cc | 6 | ||||
-rw-r--r-- | src/os/FileJournal.cc | 25 |
3 files changed, 22 insertions, 11 deletions
diff --git a/src/common/config_opts.h b/src/common/config_opts.h index f012091f870..62d2d4cc010 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -485,7 +485,7 @@ OPTION(filestore_fail_eio, OPT_BOOL, true) // fail/crash on EIO OPTION(filestore_replica_fadvise, OPT_BOOL, true) OPTION(filestore_debug_verify_split, OPT_BOOL, false) OPTION(journal_dio, OPT_BOOL, true) -OPTION(journal_aio, OPT_BOOL, false) +OPTION(journal_aio, OPT_BOOL, true) // max bytes to search ahead in journal searching for corruption OPTION(journal_max_corrupt_search, OPT_U64, 10<<20) diff --git a/src/mon/AuthMonitor.cc b/src/mon/AuthMonitor.cc index 71f7bf69a5f..264fb221a10 100644 --- a/src/mon/AuthMonitor.cc +++ b/src/mon/AuthMonitor.cc @@ -439,14 +439,16 @@ bool AuthMonitor::prep_auth(MAuth *m, bool paxos_writable) if (!s->global_id) { s->global_id = assign_global_id(m, paxos_writable); if (!s->global_id) { + + delete s->auth_handler; + s->auth_handler = NULL; + if (mon->is_leader() && paxos_writable) { dout(10) << "increasing global id, waitlisting message" << dendl; wait_for_active(new C_RetryMessage(this, m)); goto done; } - delete s->auth_handler; - s->auth_handler = NULL; s->put(); if (!mon->is_leader()) { diff --git a/src/os/FileJournal.cc b/src/os/FileJournal.cc index 52765359b9f..576c965fb3b 100644 --- a/src/os/FileJournal.cc +++ b/src/os/FileJournal.cc @@ -1127,19 +1127,28 @@ void FileJournal::write_thread_entry() // should we back off to limit aios in flight? try to do this // adaptively so that we submit larger aios once we have lots of // them in flight. - int exp = MIN(aio_num * 2, 24); - long unsigned min_new = 1ull << exp; - long unsigned cur = throttle_bytes.get_current(); - dout(20) << "write_thread_entry aio throttle: aio num " << aio_num << " bytes " << aio_bytes - << " ... exp " << exp << " min_new " << min_new - << " ... pending " << cur << dendl; - if (cur < min_new) { + // + // NOTE: our condition here is based on aio_num (protected by + // aio_lock) and throttle_bytes (part of the write queue). when + // we sleep, we *only* wait for aio_num to change, and do not + // wake when more data is queued. this is not strictly correct, + // but should be fine given that we will have plenty of aios in + // flight if we hit this limit to ensure we keep the device + // saturated. + while (aio_num > 0) { + int exp = MIN(aio_num * 2, 24); + long unsigned min_new = 1ull << exp; + long unsigned cur = throttle_bytes.get_current(); + dout(20) << "write_thread_entry aio throttle: aio num " << aio_num << " bytes " << aio_bytes + << " ... exp " << exp << " min_new " << min_new + << " ... pending " << cur << dendl; + if (cur >= min_new) + break; dout(20) << "write_thread_entry deferring until more aios complete: " << aio_num << " aios with " << aio_bytes << " bytes needs " << min_new << " bytes to start a new aio (currently " << cur << " pending)" << dendl; aio_cond.Wait(aio_lock); dout(20) << "write_thread_entry woke up" << dendl; - continue; } } #endif |