Changeset 7812a7b5
- Timestamp:
- Jun 30, 2020, 1:21:39 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 398e8e9, 9f7fff4
- Parents:
- bdce852
- Location:
- libcfa/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/random.hfa
rbdce852 r7812a7b5 4 4 5 5 //-------------------------------------------------- 6 typedef __uint128_t __lehmer64_state_t; 7 static inline uint64_t __lehmer64( __lehmer64_state_t & state ) { 8 state *= 0xda942042e4dd58b5; 9 return state >> 64; 10 } 6 #if defined(__SIZEOF_INT128__) 7 typedef __uint128_t __lehmer64_state_t; 8 static inline uint64_t __lehmer64( __lehmer64_state_t & state ) { 9 state *= 0xda942042e4dd58b5; 10 return state >> 64; 11 } 11 12 12 13 //-------------------------------------------------- 13 typedef uint64_t __wyhash64_state_t; 14 static inline uint64_t __wyhash64( __wyhash64_state_t & state ) { 15 state += 0x60bee2bee120fc15; 16 __uint128_t tmp; 17 tmp = (__uint128_t) state * 0xa3b195354a39b70d; 18 uint64_t m1 = (tmp >> 64) ^ tmp; 19 tmp = (__uint128_t)m1 * 0x1b03738712fad5c9; 20 uint64_t m2 = (tmp >> 64) ^ tmp; 21 return m2; 22 } 14 typedef uint64_t __wyhash64_state_t; 15 static inline uint64_t __wyhash64( __wyhash64_state_t & state ) { 16 state += 0x60bee2bee120fc15; 17 __uint128_t tmp; 18 tmp = (__uint128_t) state * 0xa3b195354a39b70d; 19 uint64_t m1 = (tmp >> 64) ^ tmp; 20 tmp = (__uint128_t)m1 * 0x1b03738712fad5c9; 21 uint64_t m2 = (tmp >> 64) ^ tmp; 22 return m2; 23 } 24 #endif 23 25 24 26 //-------------------------------------------------- -
libcfa/src/concurrency/invoke.h
rbdce852 r7812a7b5 60 60 __uint128_t rand_seed; 61 61 #else 62 uint64 rand_seed;62 uint64_t rand_seed; 63 63 #endif 64 64 } kernelTLS __attribute__ ((tls_model ( "initial-exec" ))); -
libcfa/src/concurrency/io.cfa
rbdce852 r7812a7b5 505 505 /* paranoid */ verify(&cqe); 506 506 507 struct io_user_data * data = (struct io_user_data *) cqe.user_data;507 struct io_user_data * data = (struct io_user_data *)(uintptr_t)cqe.user_data; 508 508 __cfadbg_print_safe( io, "Kernel I/O : Performed reading io cqe %p, result %d for %p\n", data, cqe.res, data->thrd ); 509 509 … … 831 831 (this){ opcode, fd }; 832 832 this.off = off; 833 this.addr = (uint64_t) addr;833 this.addr = (uint64_t)(uintptr_t)addr; 834 834 this.len = len; 835 835 } … … 845 845 struct io_uring_sqe * sqe; \ 846 846 uint32_t idx; \ 847 [sqe, idx] = __submit_alloc( ring, (uint64_t) &data );847 [sqe, idx] = __submit_alloc( ring, (uint64_t)(uintptr_t)&data ); 848 848 849 849 #define __submit_wait \ 850 850 /*__cfaabi_bits_print_safe( STDERR_FILENO, "Preparing user data %p for %p\n", &data, data.thrd );*/ \ 851 verify( sqe->user_data == (uint64_t) &data ); \851 verify( sqe->user_data == (uint64_t)(uintptr_t)&data ); \ 852 852 __submit( ring, idx ); \ 853 853 park( __cfaabi_dbg_ctx ); \ -
libcfa/src/concurrency/kernel_private.hfa
rbdce852 r7812a7b5 92 92 93 93 static inline uint64_t __tls_rand() { 94 // kernelTLS.rand_seed ^= kernelTLS.rand_seed << 6;95 // kernelTLS.rand_seed ^= kernelTLS.rand_seed >> 21;96 // kernelTLS.rand_seed ^= kernelTLS.rand_seed << 7;97 // return kernelTLS.rand_seed;98 94 #if defined(__SIZEOF_INT128__) 99 95 return __lehmer64( kernelTLS.rand_seed ); 100 96 #else 101 return __ wyhash64( kernelTLS.rand_seed );97 return __xorshift64( kernelTLS.rand_seed ); 102 98 #endif 103 99 } -
libcfa/src/concurrency/stats.cfa
rbdce852 r7812a7b5 3 3 4 4 #include <unistd.h> // STDERR_FILENO 5 #include <inttypes.h> 5 6 #include "bits/debug.hfa" 6 7 #include "stats.hfa" … … 90 91 __cfaabi_bits_print_safe( STDOUT_FILENO, 91 92 "----- %s \"%s\" (%p) - Ready Q Stats -----\n" 92 "- total threads run : %'15 lu\n"93 "- total threads scheduled: %'15 lu\n"94 "- push average probe len : %'18.2lf, %'18.2lf%% (%'15 luattempts)\n"95 "- pop average probe len : %'18.2lf, %'18.2lf%% (%'15 luattempts)\n"96 "- local push avg prb len : %'18.2lf, %'18.2lf%% (%'15 luattempts)\n"97 "- local pop avg prb len : %'18.2lf, %'18.2lf%% (%'15 luattempts)\n"98 "- thread migrations : %'15 lu\n"93 "- total threads run : %'15" PRIu64 "\n" 94 "- total threads scheduled: %'15" PRIu64 "\n" 95 "- push average probe len : %'18.2lf, %'18.2lf%% (%'15" PRIu64 " attempts)\n" 96 "- pop average probe len : %'18.2lf, %'18.2lf%% (%'15" PRIu64 " attempts)\n" 97 "- local push avg prb len : %'18.2lf, %'18.2lf%% (%'15" PRIu64 " attempts)\n" 98 "- local pop avg prb len : %'18.2lf, %'18.2lf%% (%'15" PRIu64 " attempts)\n" 99 "- thread migrations : %'15" PRIu64 "\n" 99 100 "- Idle Sleep -\n" 100 "-- halts : %'15 lu\n"101 "-- cancelled halts : %'15 lu\n"102 "-- schedule wake : %'15 lu\n"103 "-- wake on exit : %'15 lu\n"101 "-- halts : %'15" PRIu64 "\n" 102 "-- cancelled halts : %'15" PRIu64 "\n" 103 "-- schedule wake : %'15" PRIu64 "\n" 104 "-- wake on exit : %'15" PRIu64 "\n" 104 105 "\n" 105 106 , cluster ? "Cluster" : "Processor", name, id … … 137 138 __cfaabi_bits_print_safe( STDOUT_FILENO, 138 139 "----- %s \"%s\" (%p) - I/O Stats -----\n" 139 "- total submit calls : %'15 lu\n"140 "- total submit calls : %'15" PRIu64 "\n" 140 141 "- avg ready entries : %'18.2lf\n" 141 142 "- avg submitted entries : %'18.2lf\n" 142 143 "- avg available entries : %'18.2lf\n" 143 "- total ready search : %'15 lu\n"144 "- total ready search : %'15" PRIu64 "\n" 144 145 "- avg ready search len : %'18.2lf\n" 145 146 "- avg ready search block : %'18.2lf\n" 146 "- total alloc search : %'15 lu\n"147 "- total alloc search : %'15" PRIu64 "\n" 147 148 "- avg alloc search len : %'18.2lf\n" 148 149 "- avg alloc search block : %'18.2lf\n" 149 "- total wait calls : %'15 lu (%'lu slow, %'lufast)\n"150 "- total wait calls : %'15" PRIu64 " (%'" PRIu64 " slow, %'" PRIu64 " fast)\n" 150 151 "- avg completion/wait : %'18.2lf\n" 151 152 "\n"
Note: See TracChangeset
for help on using the changeset viewer.