|
|
|
@ -23,13 +23,18 @@ sandbox_set_as_running(struct sandbox *sandbox, sandbox_state_t last_state)
|
|
|
|
|
case SANDBOX_RUNNABLE: {
|
|
|
|
|
uint64_t start_execution = now - system_start_timestamp;
|
|
|
|
|
uint64_t last = sandbox->last_update_timestamp;
|
|
|
|
|
uint32_t last_rs = sandbox->remaining_slack;
|
|
|
|
|
sandbox->remaining_slack -= (now - sandbox->last_update_timestamp);
|
|
|
|
|
uint64_t last_rs = sandbox->remaining_slack;
|
|
|
|
|
int64_t rs = sandbox->remaining_slack - (now - sandbox->last_update_timestamp);
|
|
|
|
|
if (rs < 0) {
|
|
|
|
|
sandbox->remaining_slack = 0;
|
|
|
|
|
} else {
|
|
|
|
|
sandbox->remaining_slack = rs;
|
|
|
|
|
}
|
|
|
|
|
sandbox->last_update_timestamp = now;
|
|
|
|
|
sandbox->runnable_duration += duration_of_last_state;
|
|
|
|
|
current_sandbox_set(sandbox);
|
|
|
|
|
runtime_worker_threads_deadline[worker_thread_idx] = sandbox->absolute_deadline;
|
|
|
|
|
mem_log("time %lu sandbox starts running, request id:%d name %s obj=%p remaining slack %lu, last_rs %u now %lu last %lu \n", start_execution,
|
|
|
|
|
mem_log("time %lu sandbox starts running, request id:%d name %s obj=%p remaining slack %lu, last_rs %lu now %lu last %lu \n", start_execution,
|
|
|
|
|
sandbox->id, sandbox->module->name, sandbox, sandbox->remaining_slack, last_rs, now, last);
|
|
|
|
|
/* Does not handle context switch because the caller knows if we need to use fast or slow switched */
|
|
|
|
|
break;
|
|
|
|
|