chore: rename request_arrival_timestamp

sledge_graph
Sean McBride 5 years ago
parent 2b161f2f86
commit 5c87885722

@ -44,7 +44,7 @@ struct sandbox {
struct arch_context ctxt; /* register context for context switch. */ struct arch_context ctxt; /* register context for context switch. */
uint64_t request_timestamp; uint64_t request_arrival_timestamp;
uint64_t absolute_deadline; uint64_t absolute_deadline;
uint64_t total_time; uint64_t total_time;

@ -14,8 +14,8 @@ struct sandbox_request {
char * arguments; char * arguments;
int socket_descriptor; int socket_descriptor;
struct sockaddr *socket_address; struct sockaddr *socket_address;
uint64_t request_timestamp; /* cycles */ uint64_t request_arrival_timestamp; /* cycles */
uint64_t absolute_deadline; /* cycles */ uint64_t absolute_deadline; /* cycles */
}; };
DEQUE_PROTOTYPE(sandbox, struct sandbox_request *); DEQUE_PROTOTYPE(sandbox, struct sandbox_request *);
@ -26,21 +26,21 @@ DEQUE_PROTOTYPE(sandbox, struct sandbox_request *);
* @param arguments the arguments that we'll pass to the serverless function * @param arguments the arguments that we'll pass to the serverless function
* @param socket_descriptor * @param socket_descriptor
* @param socket_address * @param socket_address
* @param request_timestamp the timestamp of when we receives the request from the network (in cycles) * @param request_arrival_timestamp the timestamp of when we receives the request from the network (in cycles)
* @return the new sandbox request * @return the new sandbox request
*/ */
static inline struct sandbox_request * static inline struct sandbox_request *
sandbox_request_allocate(struct module *module, char *arguments, int socket_descriptor, sandbox_request_allocate(struct module *module, char *arguments, int socket_descriptor,
const struct sockaddr *socket_address, uint64_t request_timestamp) const struct sockaddr *socket_address, uint64_t request_arrival_timestamp)
{ {
struct sandbox_request *sandbox_request = (struct sandbox_request *)malloc(sizeof(struct sandbox_request)); struct sandbox_request *sandbox_request = (struct sandbox_request *)malloc(sizeof(struct sandbox_request));
assert(sandbox_request); assert(sandbox_request);
sandbox_request->module = module; sandbox_request->module = module;
sandbox_request->arguments = arguments; sandbox_request->arguments = arguments;
sandbox_request->socket_descriptor = socket_descriptor; sandbox_request->socket_descriptor = socket_descriptor;
sandbox_request->socket_address = (struct sockaddr *)socket_address; sandbox_request->socket_address = (struct sockaddr *)socket_address;
sandbox_request->request_timestamp = request_timestamp; sandbox_request->request_arrival_timestamp = request_arrival_timestamp;
sandbox_request->absolute_deadline = request_timestamp sandbox_request->absolute_deadline = request_arrival_timestamp
+ module->relative_deadline_us * runtime_processor_speed_MHz; + module->relative_deadline_us * runtime_processor_speed_MHz;
debuglog("[%p: %s]\n", sandbox_request, sandbox_request->module->name); debuglog("[%p: %s]\n", sandbox_request, sandbox_request->module->name);

@ -55,7 +55,7 @@ local_runqueue_minheap_delete(struct sandbox *sandbox)
int rc = priority_queue_delete(&local_runqueue_minheap, sandbox); int rc = priority_queue_delete(&local_runqueue_minheap, sandbox);
if (rc == -1) { if (rc == -1) {
panic("Err: Thread Local %lu tried to delete sandbox %lu from runqueue, but was not present\n", panic("Err: Thread Local %lu tried to delete sandbox %lu from runqueue, but was not present\n",
pthread_self(), sandbox->request_timestamp); pthread_self(), sandbox->request_arrival_timestamp);
} }
} }

@ -74,7 +74,7 @@ listener_thread_main(void *dummy)
LISTENER_THREAD_MAX_EPOLL_EVENTS, -1); LISTENER_THREAD_MAX_EPOLL_EVENTS, -1);
/* Capture Start Time to calculate absolute deadline */ /* Capture Start Time to calculate absolute deadline */
uint64_t request_timestamp = __getcycles(); uint64_t request_arrival_timestamp = __getcycles();
for (int i = 0; i < request_count; i++) { for (int i = 0; i < request_count; i++) {
if (epoll_events[i].events & EPOLLERR) { if (epoll_events[i].events & EPOLLERR) {
perror("epoll_wait"); perror("epoll_wait");
@ -97,7 +97,7 @@ listener_thread_main(void *dummy)
/* Allocate a Sandbox Request */ /* Allocate a Sandbox Request */
struct sandbox_request *sandbox_request = struct sandbox_request *sandbox_request =
sandbox_request_allocate(module, module->name, socket_descriptor, sandbox_request_allocate(module, module->name, socket_descriptor,
(const struct sockaddr *)&client_address, request_timestamp); (const struct sockaddr *)&client_address, request_arrival_timestamp);
assert(sandbox_request); assert(sandbox_request);
/* Add to the Global Sandbox Request Scheduler */ /* Add to the Global Sandbox Request Scheduler */

@ -151,7 +151,7 @@ sandbox_build_and_send_client_response(struct sandbox *sandbox)
done: done:
assert(sndsz == sandbox->request_response_data_length); assert(sndsz == sandbox->request_response_data_length);
uint64_t end_time = __getcycles(); uint64_t end_time = __getcycles();
sandbox->total_time = end_time - sandbox->request_timestamp; sandbox->total_time = end_time - sandbox->request_arrival_timestamp;
uint64_t total_time_us = sandbox->total_time / runtime_processor_speed_MHz; uint64_t total_time_us = sandbox->total_time / runtime_processor_speed_MHz;
debuglog("%s():%d, %u, %lu\n", sandbox->module->name, sandbox->module->port, debuglog("%s():%d, %u, %lu\n", sandbox->module->name, sandbox->module->port,
@ -409,10 +409,10 @@ sandbox_allocate(struct sandbox_request *sandbox_request)
} }
/* Copy the socket descriptor, address, and arguments of the client invocation */ /* Copy the socket descriptor, address, and arguments of the client invocation */
sandbox->absolute_deadline = sandbox_request->absolute_deadline; sandbox->absolute_deadline = sandbox_request->absolute_deadline;
sandbox->arguments = (void *)sandbox_request->arguments; sandbox->arguments = (void *)sandbox_request->arguments;
sandbox->client_socket_descriptor = sandbox_request->socket_descriptor; sandbox->client_socket_descriptor = sandbox_request->socket_descriptor;
sandbox->request_timestamp = sandbox_request->request_timestamp; sandbox->request_arrival_timestamp = sandbox_request->request_arrival_timestamp;
/* Initialize the sandbox's context, stack, and instruction pointer */ /* Initialize the sandbox's context, stack, and instruction pointer */
arch_context_init(&sandbox->ctxt, (reg_t)current_sandbox_main, arch_context_init(&sandbox->ctxt, (reg_t)current_sandbox_main,

Loading…
Cancel
Save