Avoing recalculating in op finish stage.
Signed-off-by: Jianpeng Ma <jianpeng.ma@intel.com>
// op->session->lock is locked unique or op->session is null
- if (!op->ctx_budgeted && op->budgeted)
- put_op_budget(op);
+ if (!op->ctx_budgeted && op->budget >= 0) {
+ put_op_budget_bytes(op->budget);
+ op->budget = -1;
+ }
if (op->ontimeout && r != -ETIMEDOUT)
timer.cancel_event(op->ontimeout);
epoch_t map_dne_bound;
- bool budgeted;
+ int budget;
/// true if we should resend this message on failure
bool should_resend;
objver(ov),
reply_epoch(NULL),
map_dne_bound(0),
- budgeted(false),
+ budget(-1),
should_resend(true),
ctx_budgeted(false),
data_offset(offset) {
op_throttle_bytes.take(op_budget);
op_throttle_ops.take(1);
}
- op->budgeted = true;
+ op->budget = op_budget;
return op_budget;
}
int take_linger_budget(LingerOp *info);
op_throttle_bytes.put(op_budget);
op_throttle_ops.put(1);
}
- void put_op_budget(Op *op) {
- assert(op->budgeted);
- int op_budget = calc_op_budget(op->ops);
- put_op_budget_bytes(op_budget);
- }
void put_nlist_context_budget(NListContext *list_context);
Throttle op_throttle_bytes, op_throttle_ops;