change sandbox init order: when generate a new sandbox, enqueue it to the local queue and init (allocate memory to) it when get the request from local queue

remove_atomic_variables_for_self_to_localqueue
Xiaosu Lyu 3 years ago
parent 9582ed445e
commit c4f40cc5bf

@ -26,7 +26,7 @@
#define RUNTIME_MAX_EPOLL_EVENTS 128
#define RUNTIME_MAX_TENANT_COUNT 32
#define RUNTIME_RELATIVE_DEADLINE_US_MAX 3600000000 /* One Hour. Fits in uint32_t */
#define RUNTIME_RUNQUEUE_SIZE 102400 /* Minimum guaranteed size. Might grow! */
#define RUNTIME_RUNQUEUE_SIZE 1024 /* Minimum guaranteed size. Might grow! */
#define RUNTIME_TENANT_QUEUE_SIZE 4096
enum RUNTIME_SIGALRM_HANDLER

@ -129,9 +129,16 @@ scheduler_edf_get_next()
get_first_request = true;
}
}
return local_runqueue_get_next();
} else {
struct sandbox *local = local_runqueue_get_next();
if (local->state == SANDBOX_INITIALIZED) {
sandbox_prepare_execution_environment(local);
sandbox_set_as_init(local, SANDBOX_INITIALIZED);
}
return local;
}
/* Return what is at the head of the local runqueue or NULL if empty */
return local_runqueue_get_next();
}
static inline struct sandbox *

@ -96,9 +96,7 @@ current_sandbox_exit()
// exit(-1);
//}
sandbox_prepare_execution_environment(sandbox);
assert(sandbox->state == SANDBOX_INITIALIZED);
sandbox_set_as_runnable(sandbox, SANDBOX_INITIALIZED);
local_runqueue_add(sandbox);
/****************************end**************************/
scheduler_cooperative_sched(true);

Loading…
Cancel
Save