From: Samuel Just Date: Tue, 7 Oct 2014 18:42:14 +0000 (-0700) Subject: Merge remote-tracking branch 'guangyy/wip-9008' into giant X-Git-Tag: v0.87~38 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1d22575cb097752f4cff3b24899b7eb21ed73a0f;p=ceph.git Merge remote-tracking branch 'guangyy/wip-9008' into giant --- 1d22575cb097752f4cff3b24899b7eb21ed73a0f diff --cc src/osdc/Objecter.cc index 5f2e15eae810,7af51e3d268c..a2c4ddb33d2d --- a/src/osdc/Objecter.cc +++ b/src/osdc/Objecter.cc @@@ -1689,19 -1684,23 +1689,26 @@@ ceph_tid_t Objecter::_op_submit_with_bu assert(op->ops.size() == op->out_rval.size()); assert(op->ops.size() == op->out_handler.size()); - if (osd_timeout > 0) { - op->ontimeout = new C_CancelOp(op, this); - timer.add_event_after(osd_timeout, op->ontimeout); - } - // throttle. before we look at any state, because // take_op_budget() may drop our lock while it blocks. - _take_op_budget(op); + if (!op->ctx_budgeted || (ctx_budget && (*ctx_budget == -1))) { + int op_budget = _take_op_budget(op); + // take and pass out the budget for the first OP + // in the context session + if (ctx_budget && (*ctx_budget == -1)) { + *ctx_budget = op_budget; + } + } - return _op_submit(op, lc); + ceph_tid_t tid = _op_submit(op, lc); + + if (osd_timeout > 0) { + Mutex::Locker l(timer_lock); + op->ontimeout = new C_CancelOp(tid, this); + timer.add_event_after(osd_timeout, op->ontimeout); + } + + return tid; } ceph_tid_t Objecter::_op_submit(Op *op, RWLock::Context& lc) @@@ -2295,14 -2294,9 +2302,14 @@@ void Objecter::_finish_op(Op *op assert(op->session->lock.is_wlocked()); - if (op->budgeted) + if (!op->ctx_budgeted && op->budgeted) put_op_budget(op); + if (op->ontimeout) { + Mutex::Locker l(timer_lock); + timer.cancel_event(op->ontimeout); + } + _session_op_remove(op->session, op); logger->dec(l_osdc_op_active);