Changeset fd1f65e
- Timestamp:
- Apr 1, 2021, 8:02:19 PM (3 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- a344425
- Parents:
- b580bcc
- Location:
- libcfa/src/concurrency
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/ready_queue.cfa
rb580bcc rfd1f65e 244 244 __cfadbg_print_safe(ready_queue, "Kernel : Pushing %p on cluster %p\n", thrd, cltr); 245 245 246 #if !defined(__CFA_NO_STATISTICS__) 247 const bool external = cltr == kernelTLS().this_processor->cltr; 248 #endif 249 246 250 // write timestamp 247 251 thrd->link.ts = rdtscl(); … … 266 270 [i, local] = idx_from_r(r, preferred); 267 271 272 i %= __atomic_load_n( &lanes.count, __ATOMIC_RELAXED ); 273 268 274 #if !defined(__CFA_NO_STATISTICS__) 269 if(local) { 270 __tls_stats()->ready.pick.push.local++; 271 } 272 #endif 273 274 i %= __atomic_load_n( &lanes.count, __ATOMIC_RELAXED ); 275 276 #if !defined(__CFA_NO_STATISTICS__) 277 __tls_stats()->ready.pick.push.attempt++; 275 if(external) { 276 if(local) __atomic_fetch_add(&cltr->stats->ready.pick.ext.local, 1, __ATOMIC_RELAXED); 277 __atomic_fetch_add(&cltr->stats->ready.pick.ext.attempt, 1, __ATOMIC_RELAXED); 278 } 279 else { 280 if(local) __tls_stats()->ready.pick.push.local++; 281 __tls_stats()->ready.pick.push.attempt++; 282 } 278 283 #endif 279 284 … … 310 315 // Update statistics 311 316 #if !defined(__CFA_NO_STATISTICS__) 312 #if defined(BIAS) 313 if( local ) __tls_stats()->ready.pick.push.lsuccess++; 314 #endif 315 __tls_stats()->ready.pick.push.success++; 317 if(external) { 318 if(local) __atomic_fetch_add(&cltr->stats->ready.pick.ext.lsuccess, 1, __ATOMIC_RELAXED); 319 __atomic_fetch_add(&cltr->stats->ready.pick.ext.success, 1, __ATOMIC_RELAXED); 320 } 321 else { 322 if(local) __tls_stats()->ready.pick.push.lsuccess++; 323 __tls_stats()->ready.pick.push.success++; 324 } 316 325 #endif 317 326 -
libcfa/src/concurrency/stats.cfa
rb580bcc rfd1f65e 13 13 stats->ready.pick.push.local = 0; 14 14 stats->ready.pick.push.lsuccess = 0; 15 stats->ready.pick.ext.attempt = 0; 16 stats->ready.pick.ext.success = 0; 17 stats->ready.pick.ext.local = 0; 18 stats->ready.pick.ext.lsuccess = 0; 15 19 stats->ready.pick.pop .probe = 0; 16 20 stats->ready.pick.pop .attempt = 0; … … 47 51 __atomic_fetch_add( &cltr->ready.pick.push.local , proc->ready.pick.push.local , __ATOMIC_SEQ_CST ); proc->ready.pick.push.local = 0; 48 52 __atomic_fetch_add( &cltr->ready.pick.push.lsuccess, proc->ready.pick.push.lsuccess, __ATOMIC_SEQ_CST ); proc->ready.pick.push.lsuccess = 0; 53 __atomic_fetch_add( &cltr->ready.pick.ext.attempt , proc->ready.pick.ext.attempt , __ATOMIC_SEQ_CST ); proc->ready.pick.ext.attempt = 0; 54 __atomic_fetch_add( &cltr->ready.pick.ext.success , proc->ready.pick.ext.success , __ATOMIC_SEQ_CST ); proc->ready.pick.ext.success = 0; 55 __atomic_fetch_add( &cltr->ready.pick.ext.local , proc->ready.pick.ext.local , __ATOMIC_SEQ_CST ); proc->ready.pick.ext.local = 0; 56 __atomic_fetch_add( &cltr->ready.pick.ext.lsuccess , proc->ready.pick.ext.lsuccess , __ATOMIC_SEQ_CST ); proc->ready.pick.ext.lsuccess = 0; 49 57 __atomic_fetch_add( &cltr->ready.pick.pop .probe , proc->ready.pick.pop .probe , __ATOMIC_SEQ_CST ); proc->ready.pick.pop .probe = 0; 50 58 __atomic_fetch_add( &cltr->ready.pick.pop .attempt , proc->ready.pick.pop .attempt , __ATOMIC_SEQ_CST ); proc->ready.pick.pop .attempt = 0; … … 80 88 if( flags & CFA_STATS_READY_Q ) { 81 89 double push_len = ((double)ready.pick.push.attempt) / ready.pick.push.success; 90 double ext_len = ((double)ready.pick.ext .attempt) / ready.pick.ext .success; 82 91 double pop_len = ((double)ready.pick.pop .attempt) / ready.pick.pop .success; 83 92 84 93 double lpush_len = ((double)ready.pick.push.local) / ready.pick.push.lsuccess; 94 double lext_len = ((double)ready.pick.ext .local) / ready.pick.ext .lsuccess; 85 95 double lpop_len = ((double)ready.pick.pop .local) / ready.pick.pop .lsuccess; 86 96 … … 89 99 "- total threads : %'15" PRIu64 "run, %'15" PRIu64 "schd (%'" PRIu64 "mig )\n" 90 100 "- push avg probe : %'3.2lf, %'3.2lfl (%'15" PRIu64 " attempts, %'15" PRIu64 " locals)\n" 101 "- ext avg probe : %'3.2lf, %'3.2lfl (%'15" PRIu64 " attempts, %'15" PRIu64 " locals)\n" 91 102 "- pop avg probe : %'3.2lf, %'3.2lfl (%'15" PRIu64 " attempts, %'15" PRIu64 " locals)\n" 92 103 "- Idle Sleep : %'15" PRIu64 "h, %'15" PRIu64 "c, %'15" PRIu64 "w, %'15" PRIu64 "e\n" … … 97 108 , ready.threads.migration 98 109 , push_len, lpush_len, ready.pick.push.attempt, ready.pick.push.local 110 , ext_len , lext_len , ready.pick.ext .attempt, ready.pick.ext .local 99 111 , pop_len , lpop_len , ready.pick.pop .attempt, ready.pick.pop .local 100 112 , ready.sleep.halts, ready.sleep.cancels, ready.sleep.wakes, ready.sleep.exits -
libcfa/src/concurrency/stats.hfa
rb580bcc rfd1f65e 31 31 volatile uint64_t lsuccess; 32 32 } push; 33 34 struct { 35 // number of attemps at pushing something 36 volatile uint64_t attempt; 37 38 // number of successes at pushing 39 volatile uint64_t success; 40 41 // number of attemps at pushing something to preferred queues 42 volatile uint64_t local; 43 44 // number of successes at pushing to preferred queues 45 volatile uint64_t lsuccess; 46 } ext; 33 47 34 48 // Pop statistic
Note: See TracChangeset
for help on using the changeset viewer.