diff --git a/runtime/include/http_total.h b/runtime/include/http_total.h index 455b0546..f84a4817 100644 --- a/runtime/include/http_total.h +++ b/runtime/include/http_total.h @@ -39,12 +39,12 @@ static inline void http_total_increment_response(int status_code) { #ifdef HTTP_TOTAL_COUNTERS - if (status_code >= 200 && status_code <= 299) { + /*if (status_code >= 200 && status_code <= 299) { atomic_fetch_add(&http_total_2XX, 1); } else if (status_code >= 400 && status_code <= 499) { atomic_fetch_add(&http_total_4XX, 1); } else if (status_code >= 500 && status_code <= 599) { atomic_fetch_add(&http_total_5XX, 1); - } + }*/ #endif } diff --git a/runtime/include/module.h b/runtime/include/module.h index b2ab6ad8..468190d8 100644 --- a/runtime/include/module.h +++ b/runtime/include/module.h @@ -60,7 +60,7 @@ static inline void module_acquire(struct module *module) { assert(module->reference_count < UINT32_MAX); - atomic_fetch_add(&module->reference_count, 1); + //atomic_fetch_add(&module->reference_count, 1); return; } @@ -158,8 +158,8 @@ module_entrypoint(struct module *module) static inline void module_release(struct module *module) { - assert(module->reference_count > 0); - atomic_fetch_sub(&module->reference_count, 1); + //assert(module->reference_count > 0); + //atomic_fetch_sub(&module->reference_count, 1); return; } diff --git a/runtime/include/sandbox_functions.h b/runtime/include/sandbox_functions.h index 754d40c9..7ead5400 100644 --- a/runtime/include/sandbox_functions.h +++ b/runtime/include/sandbox_functions.h @@ -55,6 +55,6 @@ static inline void sandbox_process_scheduler_updates(struct sandbox *sandbox) { if (tenant_is_paid(sandbox->tenant)) { - atomic_fetch_sub(&sandbox->tenant->remaining_budget, sandbox->last_state_duration); + //atomic_fetch_sub(&sandbox->tenant->remaining_budget, sandbox->last_state_duration); } } diff --git a/runtime/include/sandbox_state.h b/runtime/include/sandbox_state.h index d74069af..cad5bfde 100644 --- a/runtime/include/sandbox_state.h +++ b/runtime/include/sandbox_state.h @@ -48,7 +48,7 @@ static inline void sandbox_state_totals_increment(sandbox_state_t state) { #ifdef SANDBOX_STATE_TOTALS - atomic_fetch_add(&sandbox_state_totals[state], 1); + //atomic_fetch_add(&sandbox_state_totals[state], 1); #endif } @@ -56,7 +56,7 @@ static inline void sandbox_state_totals_decrement(sandbox_state_t state) { #ifdef SANDBOX_STATE_TOTALS - if (atomic_load(&sandbox_state_totals[state]) == 0) panic("Underflow of %s\n", sandbox_state_stringify(state)); - atomic_fetch_sub(&sandbox_state_totals[state], 1); + //if (atomic_load(&sandbox_state_totals[state]) == 0) panic("Underflow of %s\n", sandbox_state_stringify(state)); + //atomic_fetch_sub(&sandbox_state_totals[state], 1); #endif } diff --git a/runtime/include/sandbox_total.h b/runtime/include/sandbox_total.h index cc2d59e4..b0ca1752 100644 --- a/runtime/include/sandbox_total.h +++ b/runtime/include/sandbox_total.h @@ -15,5 +15,6 @@ sandbox_total_initialize() static inline uint64_t sandbox_total_postfix_increment() { - return atomic_fetch_add(&sandbox_total, 1) + 1; + //return atomic_fetch_add(&sandbox_total, 1) + 1; + return 1; } diff --git a/runtime/include/software_interrupt_counts.h b/runtime/include/software_interrupt_counts.h index 9daa5afe..2090ed94 100644 --- a/runtime/include/software_interrupt_counts.h +++ b/runtime/include/software_interrupt_counts.h @@ -56,7 +56,7 @@ static inline void software_interrupt_counts_deferred_sigalrm_replay_increment() { #ifdef LOG_SOFTWARE_INTERRUPT_COUNTS - atomic_fetch_add(&software_interrupt_counts_deferred_sigalrm_replay[worker_thread_idx], 1); + //atomic_fetch_add(&software_interrupt_counts_deferred_sigalrm_replay[worker_thread_idx], 1); #endif } @@ -64,7 +64,7 @@ static inline void software_interrupt_counts_sigalrm_kernel_increment() { #ifdef LOG_SOFTWARE_INTERRUPT_COUNTS - atomic_fetch_add(&software_interrupt_counts_sigalrm_kernel[worker_thread_idx], 1); + //atomic_fetch_add(&software_interrupt_counts_sigalrm_kernel[worker_thread_idx], 1); #endif } @@ -72,7 +72,7 @@ static inline void software_interrupt_counts_sigalrm_thread_increment() { #ifdef LOG_SOFTWARE_INTERRUPT_COUNTS - atomic_fetch_add(&software_interrupt_counts_sigalrm_thread[worker_thread_idx], 1); + //atomic_fetch_add(&software_interrupt_counts_sigalrm_thread[worker_thread_idx], 1); #endif } @@ -80,7 +80,7 @@ static inline void software_interrupt_counts_sigfpe_increment() { #ifdef LOG_SOFTWARE_INTERRUPT_COUNTS - atomic_fetch_add(&software_interrupt_counts_sigfpe[worker_thread_idx], 1); + //atomic_fetch_add(&software_interrupt_counts_sigfpe[worker_thread_idx], 1); #endif } @@ -88,7 +88,7 @@ static inline void software_interrupt_counts_sigsegv_increment() { #ifdef LOG_SOFTWARE_INTERRUPT_COUNTS - atomic_fetch_add(&software_interrupt_counts_sigsegv[worker_thread_idx], 1); + //atomic_fetch_add(&software_interrupt_counts_sigsegv[worker_thread_idx], 1); #endif } @@ -96,7 +96,7 @@ static inline void software_interrupt_counts_sigusr_increment() { #ifdef LOG_SOFTWARE_INTERRUPT_COUNTS - atomic_fetch_add(&software_interrupt_counts_sigusr[worker_thread_idx], 1); + //atomic_fetch_add(&software_interrupt_counts_sigusr[worker_thread_idx], 1); #endif } diff --git a/runtime/src/admissions_control.c b/runtime/src/admissions_control.c index 77d67051..7ee0605b 100644 --- a/runtime/src/admissions_control.c +++ b/runtime/src/admissions_control.c @@ -40,7 +40,7 @@ admissions_control_add(uint64_t admissions_estimate) { #ifdef ADMISSIONS_CONTROL assert(admissions_estimate > 0); - atomic_fetch_add(&admissions_control_admitted, admissions_estimate); + //atomic_fetch_add(&admissions_control_admitted, admissions_estimate); #ifdef LOG_ADMISSIONS_CONTROL debuglog("Runtime Admitted: %lu / %lu\n", admissions_control_admitted, admissions_control_capacity); diff --git a/runtime/src/software_interrupt.c b/runtime/src/software_interrupt.c index 080ab4bb..445f7afc 100644 --- a/runtime/src/software_interrupt.c +++ b/runtime/src/software_interrupt.c @@ -138,7 +138,7 @@ software_interrupt_handle_signals(int signal_type, siginfo_t *signal_info, void /* Signals should not nest */ assert(handler_depth == 0); - atomic_fetch_add(&handler_depth, 1); + //atomic_fetch_add(&handler_depth, 1); ucontext_t *interrupted_context = (ucontext_t *)interrupted_context_raw; struct sandbox *current_sandbox = current_sandbox_get(); @@ -172,7 +172,7 @@ software_interrupt_handle_signals(int signal_type, siginfo_t *signal_info, void global_timeout_queue_process_promotions(); } propagate_sigalrm(signal_info); - atomic_fetch_add(&deferred_sigalrm, 1); + //atomic_fetch_add(&deferred_sigalrm, 1); } break; @@ -197,7 +197,7 @@ software_interrupt_handle_signals(int signal_type, siginfo_t *signal_info, void software_interrupt_counts_sigfpe_increment(); if (likely(current_sandbox && current_sandbox->state == SANDBOX_RUNNING_USER)) { - atomic_fetch_sub(&handler_depth, 1); + //atomic_fetch_sub(&handler_depth, 1); current_sandbox_trap(WASM_TRAP_ILLEGAL_ARITHMETIC_OPERATION); } else { panic("Runtime SIGFPE\n"); @@ -209,7 +209,7 @@ software_interrupt_handle_signals(int signal_type, siginfo_t *signal_info, void software_interrupt_counts_sigsegv_increment(); if (likely(current_sandbox && current_sandbox->state == SANDBOX_RUNNING_USER)) { - atomic_fetch_sub(&handler_depth, 1); + //atomic_fetch_sub(&handler_depth, 1); current_sandbox_trap(WASM_TRAP_OUT_OF_BOUNDS_LINEAR_MEMORY); } else { panic("Runtime SIGSEGV\n"); @@ -225,9 +225,10 @@ software_interrupt_handle_signals(int signal_type, siginfo_t *signal_info, void /* calculate the throughput */ time_t t_end = time(NULL); double seconds = difftime(t_end, t_start); - double throughput = atomic_load(&sandbox_state_totals[SANDBOX_COMPLETE]) / seconds; + //double throughput = atomic_load(&sandbox_state_totals[SANDBOX_COMPLETE]) / seconds; + double throughput = total_local_requests / seconds; uint32_t total_sandboxes_error = atomic_load(&sandbox_state_totals[SANDBOX_ERROR]); - printf("throughput is %f, error request is %u global total request %d worker %d total requests is %u worker total_held %"PRIu64" longest_held %"PRIu64" listener total_held %"PRIu64" longest_held %"PRIu64"\n", + printf("throughput is %f error request is %u global total request %d worker %d total requests is %u worker total_held %"PRIu64" longest_held %"PRIu64" listener total_held %"PRIu64" longest_held %"PRIu64"\n", throughput, total_sandboxes_error, atomic_load(&sandbox_state_totals[SANDBOX_COMPLETE]), worker_thread_idx, total_local_requests, total_held[worker_thread_idx], longest_held[worker_thread_idx], total_held[200], longest_held[200]); fflush(stdout); pthread_exit(0); @@ -249,7 +250,7 @@ software_interrupt_handle_signals(int signal_type, siginfo_t *signal_info, void } } - atomic_fetch_sub(&handler_depth, 1); + //atomic_fetch_sub(&handler_depth, 1); return; }