Changeset d2fadeb
- Timestamp:
- Apr 19, 2021, 5:07:16 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:
- 59f3f61, 665edf40, ddd473f
- Parents:
- 4aa495f
- Location:
- libcfa/src/concurrency
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/ready_queue.cfa
r4aa495f rd2fadeb 35 35 static const size_t cache_line_size = 64; 36 36 37 #if !defined(__CFA_NO_STATISTICS__) 38 #define __STATS(...) __VA_ARGS__ 39 #else 40 #define __STATS(...) 41 #endif 42 37 43 // No overriden function, no environment variable, no define 38 44 // fall back to a magic number … … 52 58 #endif 53 59 60 static inline struct $thread * try_pop(struct cluster * cltr, unsigned w __STATS(, __stats_readyQ_pop_t & stats)); 61 static inline struct $thread * try_pop(struct cluster * cltr, unsigned i, unsigned j __STATS(, __stats_readyQ_pop_t & stats)); 62 static inline struct $thread * search(struct cluster * cltr); 54 63 static inline [unsigned, bool] idx_from_r(unsigned r, unsigned preferred); 55 static inline struct $thread * try_pop(struct cluster * cltr, unsigned w);56 static inline struct $thread * try_pop(struct cluster * cltr, unsigned i, unsigned j);57 static inline struct $thread * search(struct cluster * cltr);58 64 59 65 … … 269 275 270 276 #if !defined(__CFA_NO_STATISTICS__) 271 if(external) { 272 if(local) __atomic_fetch_add(&cltr->stats->ready.pick.ext.local, 1, __ATOMIC_RELAXED); 273 __atomic_fetch_add(&cltr->stats->ready.pick.ext.attempt, 1, __ATOMIC_RELAXED); 274 } 275 else { 276 if(local) __tls_stats()->ready.pick.push.local++; 277 __tls_stats()->ready.pick.push.attempt++; 278 } 277 if(unlikely(external)) __atomic_fetch_add(&cltr->stats->ready.push.extrn.attempt, 1, __ATOMIC_RELAXED); 278 else if(local) __tls_stats()->ready.push.local.attempt++; 279 else __tls_stats()->ready.push.share.attempt++; 279 280 #endif 280 281 … … 302 303 // Update statistics 303 304 #if !defined(__CFA_NO_STATISTICS__) 304 if(external) { 305 if(local) __atomic_fetch_add(&cltr->stats->ready.pick.ext.lsuccess, 1, __ATOMIC_RELAXED); 306 __atomic_fetch_add(&cltr->stats->ready.pick.ext.success, 1, __ATOMIC_RELAXED); 307 } 308 else { 309 if(local) __tls_stats()->ready.pick.push.lsuccess++; 310 __tls_stats()->ready.pick.push.success++; 311 } 305 if(unlikely(external)) __atomic_fetch_add(&cltr->stats->ready.push.extrn.success, 1, __ATOMIC_RELAXED); 306 else if(local) __tls_stats()->ready.push.local.success++; 307 else __tls_stats()->ready.push.share.success++; 312 308 #endif 313 309 } … … 334 330 [j, localj] = idx_from_r(rj, preferred); 335 331 336 #if !defined(__CFA_NO_STATISTICS__)337 if(locali && localj) {338 __tls_stats()->ready.pick.pop.local++;339 }340 #endif341 342 332 i %= count; 343 333 j %= count; 344 334 345 335 // try popping from the 2 picked lists 346 struct $thread * thrd = try_pop(cltr, i, j );336 struct $thread * thrd = try_pop(cltr, i, j __STATS(, *(locali || localj ? &__tls_stats()->ready.pop.local : &__tls_stats()->ready.pop.help))); 347 337 if(thrd) { 348 #if !defined(__CFA_NO_STATISTICS__)349 if( locali || localj ) __tls_stats()->ready.pick.pop.lsuccess++;350 #endif351 338 return thrd; 352 339 } … … 374 361 unsigned i; 375 362 do { 363 #if !defined(__CFA_NO_STATISTICS__) 364 if(unlikely(external)) __atomic_fetch_add(&cltr->stats->ready.push.extrn.attempt, 1, __ATOMIC_RELAXED); 365 else __tls_stats()->ready.push.local.attempt++; 366 #endif 367 376 368 if(unlikely(external)) { 377 369 i = __tls_rand() % lanes.count; … … 398 390 // Unlock and return 399 391 __atomic_unlock( &lanes.data[i].lock ); 392 #endif 393 394 #if !defined(__CFA_NO_STATISTICS__) 395 if(unlikely(external)) __atomic_fetch_add(&cltr->stats->ready.push.extrn.success, 1, __ATOMIC_RELAXED); 396 else __tls_stats()->ready.push.local.success++; 400 397 #endif 401 398 … … 422 419 } 423 420 else if(lanes.tscs[proc->rdq.target].tv < proc->rdq.cutoff) { 424 $thread * t = try_pop(cltr, proc->rdq.target );421 $thread * t = try_pop(cltr, proc->rdq.target __STATS(, __tls_stats()->ready.pop.help)); 425 422 proc->rdq.target = -1u; 426 423 if(t) return t; … … 429 426 for(READYQ_SHARD_FACTOR) { 430 427 unsigned i = proc->rdq.id + (--proc->rdq.itr % READYQ_SHARD_FACTOR); 431 if($thread * t = try_pop(cltr, i )) return t;428 if($thread * t = try_pop(cltr, i __STATS(, __tls_stats()->ready.pop.local))) return t; 432 429 } 433 430 return 0p; … … 437 434 for(25) { 438 435 unsigned i = __tls_rand() % lanes.count; 439 $thread * t = try_pop(cltr, i );436 $thread * t = try_pop(cltr, i __STATS(, __tls_stats()->ready.pop.steal)); 440 437 if(t) return t; 441 438 } … … 453 450 //----------------------------------------------------------------------- 454 451 // try to pop from a lane given by index w 455 static inline struct $thread * try_pop(struct cluster * cltr, unsigned w) with (cltr->ready_queue) { 452 static inline struct $thread * try_pop(struct cluster * cltr, unsigned w __STATS(, __stats_readyQ_pop_t & stats)) with (cltr->ready_queue) { 453 __STATS( stats.attempt++; ) 454 456 455 // Get relevant elements locally 457 456 __intrusive_lane_t & lane = lanes.data[w]; 458 457 459 458 // If list looks empty retry 460 if( is_empty(lane) ) return 0p; 459 if( is_empty(lane) ) { 460 __STATS( stats.espec++; ) 461 return 0p; 462 } 461 463 462 464 // If we can't get the lock retry 463 if( !__atomic_try_acquire(&lane.lock) ) return 0p; 465 if( !__atomic_try_acquire(&lane.lock) ) { 466 __STATS( stats.elock++; ) 467 return 0p; 468 } 464 469 465 470 // If list is empty, unlock and retry 466 471 if( is_empty(lane) ) { 467 472 __atomic_unlock(&lane.lock); 473 __STATS( stats.eempty++; ) 468 474 return 0p; 469 475 } … … 480 486 481 487 // Update statistics 482 #if !defined(__CFA_NO_STATISTICS__) 483 __tls_stats()->ready.pick.pop.success++; 484 #endif 488 __STATS( stats.success++; ) 485 489 486 490 #if defined(USE_WORK_STEALING) … … 501 505 for(i; count) { 502 506 unsigned idx = (offset + i) % count; 503 struct $thread * thrd = try_pop(cltr, idx );507 struct $thread * thrd = try_pop(cltr, idx __STATS(, __tls_stats()->ready.pop.search)); 504 508 if(thrd) { 505 509 return thrd; … … 539 543 //----------------------------------------------------------------------- 540 544 // Given 2 indexes, pick the list with the oldest push an try to pop from it 541 static inline struct $thread * try_pop(struct cluster * cltr, unsigned i, unsigned j) with (cltr->ready_queue) { 542 #if !defined(__CFA_NO_STATISTICS__) 543 __tls_stats()->ready.pick.pop.attempt++; 544 #endif 545 545 static inline struct $thread * try_pop(struct cluster * cltr, unsigned i, unsigned j __STATS(, __stats_readyQ_pop_t & stats)) with (cltr->ready_queue) { 546 546 // Pick the bet list 547 547 int w = i; … … 550 550 } 551 551 552 return try_pop(cltr, w );552 return try_pop(cltr, w __STATS(, stats)); 553 553 } 554 554 -
libcfa/src/concurrency/stats.cfa
r4aa495f rd2fadeb 10 10 #if !defined(__CFA_NO_STATISTICS__) 11 11 void __init_stats( struct __stats_t * stats ) { 12 stats->ready.pick.push.attempt = 0; 13 stats->ready.pick.push.success = 0; 14 stats->ready.pick.push.local = 0; 15 stats->ready.pick.push.lsuccess = 0; 16 stats->ready.pick.ext.attempt = 0; 17 stats->ready.pick.ext.success = 0; 18 stats->ready.pick.ext.local = 0; 19 stats->ready.pick.ext.lsuccess = 0; 20 stats->ready.pick.pop .probe = 0; 21 stats->ready.pick.pop .attempt = 0; 22 stats->ready.pick.pop .success = 0; 23 stats->ready.pick.pop .local = 0; 24 stats->ready.pick.pop .lsuccess = 0; 12 stats->ready.push.local.attempt = 0; 13 stats->ready.push.local.success = 0; 14 stats->ready.push.share.attempt = 0; 15 stats->ready.push.share.success = 0; 16 stats->ready.push.extrn.attempt = 0; 17 stats->ready.push.extrn.success = 0; 18 stats->ready.pop.local .attempt = 0; 19 stats->ready.pop.local .success = 0; 20 stats->ready.pop.local .elock = 0; 21 stats->ready.pop.local .eempty = 0; 22 stats->ready.pop.local .espec = 0; 23 stats->ready.pop.help .attempt = 0; 24 stats->ready.pop.help .success = 0; 25 stats->ready.pop.help .elock = 0; 26 stats->ready.pop.help .eempty = 0; 27 stats->ready.pop.help .espec = 0; 28 stats->ready.pop.steal .attempt = 0; 29 stats->ready.pop.steal .success = 0; 30 stats->ready.pop.steal .elock = 0; 31 stats->ready.pop.steal .eempty = 0; 32 stats->ready.pop.steal .espec = 0; 33 stats->ready.pop.search.attempt = 0; 34 stats->ready.pop.search.success = 0; 35 stats->ready.pop.search.elock = 0; 36 stats->ready.pop.search.eempty = 0; 37 stats->ready.pop.search.espec = 0; 25 38 stats->ready.threads.migration = 0; 26 39 stats->ready.threads.threads = 0; … … 54 67 55 68 void __tally_stats( struct __stats_t * cltr, struct __stats_t * proc ) { 56 __atomic_fetch_add( &cltr->ready.pick.push.attempt , proc->ready.pick.push.attempt , __ATOMIC_SEQ_CST ); proc->ready.pick.push.attempt = 0; 57 __atomic_fetch_add( &cltr->ready.pick.push.success , proc->ready.pick.push.success , __ATOMIC_SEQ_CST ); proc->ready.pick.push.success = 0; 58 __atomic_fetch_add( &cltr->ready.pick.push.local , proc->ready.pick.push.local , __ATOMIC_SEQ_CST ); proc->ready.pick.push.local = 0; 59 __atomic_fetch_add( &cltr->ready.pick.push.lsuccess, proc->ready.pick.push.lsuccess, __ATOMIC_SEQ_CST ); proc->ready.pick.push.lsuccess = 0; 60 __atomic_fetch_add( &cltr->ready.pick.ext.attempt , proc->ready.pick.ext.attempt , __ATOMIC_SEQ_CST ); proc->ready.pick.ext.attempt = 0; 61 __atomic_fetch_add( &cltr->ready.pick.ext.success , proc->ready.pick.ext.success , __ATOMIC_SEQ_CST ); proc->ready.pick.ext.success = 0; 62 __atomic_fetch_add( &cltr->ready.pick.ext.local , proc->ready.pick.ext.local , __ATOMIC_SEQ_CST ); proc->ready.pick.ext.local = 0; 63 __atomic_fetch_add( &cltr->ready.pick.ext.lsuccess , proc->ready.pick.ext.lsuccess , __ATOMIC_SEQ_CST ); proc->ready.pick.ext.lsuccess = 0; 64 __atomic_fetch_add( &cltr->ready.pick.pop .probe , proc->ready.pick.pop .probe , __ATOMIC_SEQ_CST ); proc->ready.pick.pop .probe = 0; 65 __atomic_fetch_add( &cltr->ready.pick.pop .attempt , proc->ready.pick.pop .attempt , __ATOMIC_SEQ_CST ); proc->ready.pick.pop .attempt = 0; 66 __atomic_fetch_add( &cltr->ready.pick.pop .success , proc->ready.pick.pop .success , __ATOMIC_SEQ_CST ); proc->ready.pick.pop .success = 0; 67 __atomic_fetch_add( &cltr->ready.pick.pop .local , proc->ready.pick.pop .local , __ATOMIC_SEQ_CST ); proc->ready.pick.pop .local = 0; 68 __atomic_fetch_add( &cltr->ready.pick.pop .lsuccess, proc->ready.pick.pop .lsuccess, __ATOMIC_SEQ_CST ); proc->ready.pick.pop .lsuccess = 0; 69 __atomic_fetch_add( &cltr->ready.push.local.attempt, proc->ready.push.local.attempt, __ATOMIC_SEQ_CST ); proc->ready.push.local.attempt = 0; 70 __atomic_fetch_add( &cltr->ready.push.local.success, proc->ready.push.local.success, __ATOMIC_SEQ_CST ); proc->ready.push.local.success = 0; 71 __atomic_fetch_add( &cltr->ready.push.share.attempt, proc->ready.push.share.attempt, __ATOMIC_SEQ_CST ); proc->ready.push.share.attempt = 0; 72 __atomic_fetch_add( &cltr->ready.push.share.success, proc->ready.push.share.success, __ATOMIC_SEQ_CST ); proc->ready.push.share.success = 0; 73 __atomic_fetch_add( &cltr->ready.push.extrn.attempt, proc->ready.push.extrn.attempt, __ATOMIC_SEQ_CST ); proc->ready.push.extrn.attempt = 0; 74 __atomic_fetch_add( &cltr->ready.push.extrn.success, proc->ready.push.extrn.success, __ATOMIC_SEQ_CST ); proc->ready.push.extrn.success = 0; 75 __atomic_fetch_add( &cltr->ready.pop.local .attempt, proc->ready.pop.local .attempt, __ATOMIC_SEQ_CST ); proc->ready.pop.local .attempt = 0; 76 __atomic_fetch_add( &cltr->ready.pop.local .success, proc->ready.pop.local .success, __ATOMIC_SEQ_CST ); proc->ready.pop.local .success = 0; 77 __atomic_fetch_add( &cltr->ready.pop.local .elock , proc->ready.pop.local .elock , __ATOMIC_SEQ_CST ); proc->ready.pop.local .elock = 0; 78 __atomic_fetch_add( &cltr->ready.pop.local .eempty , proc->ready.pop.local .eempty , __ATOMIC_SEQ_CST ); proc->ready.pop.local .eempty = 0; 79 __atomic_fetch_add( &cltr->ready.pop.local .espec , proc->ready.pop.local .espec , __ATOMIC_SEQ_CST ); proc->ready.pop.local .espec = 0; 80 __atomic_fetch_add( &cltr->ready.pop.help .attempt, proc->ready.pop.help .attempt, __ATOMIC_SEQ_CST ); proc->ready.pop.help .attempt = 0; 81 __atomic_fetch_add( &cltr->ready.pop.help .success, proc->ready.pop.help .success, __ATOMIC_SEQ_CST ); proc->ready.pop.help .success = 0; 82 __atomic_fetch_add( &cltr->ready.pop.help .elock , proc->ready.pop.help .elock , __ATOMIC_SEQ_CST ); proc->ready.pop.help .elock = 0; 83 __atomic_fetch_add( &cltr->ready.pop.help .eempty , proc->ready.pop.help .eempty , __ATOMIC_SEQ_CST ); proc->ready.pop.help .eempty = 0; 84 __atomic_fetch_add( &cltr->ready.pop.help .espec , proc->ready.pop.help .espec , __ATOMIC_SEQ_CST ); proc->ready.pop.help .espec = 0; 85 __atomic_fetch_add( &cltr->ready.pop.steal .attempt, proc->ready.pop.steal .attempt, __ATOMIC_SEQ_CST ); proc->ready.pop.steal .attempt = 0; 86 __atomic_fetch_add( &cltr->ready.pop.steal .success, proc->ready.pop.steal .success, __ATOMIC_SEQ_CST ); proc->ready.pop.steal .success = 0; 87 __atomic_fetch_add( &cltr->ready.pop.steal .elock , proc->ready.pop.steal .elock , __ATOMIC_SEQ_CST ); proc->ready.pop.steal .elock = 0; 88 __atomic_fetch_add( &cltr->ready.pop.steal .eempty , proc->ready.pop.steal .eempty , __ATOMIC_SEQ_CST ); proc->ready.pop.steal .eempty = 0; 89 __atomic_fetch_add( &cltr->ready.pop.steal .espec , proc->ready.pop.steal .espec , __ATOMIC_SEQ_CST ); proc->ready.pop.steal .espec = 0; 90 __atomic_fetch_add( &cltr->ready.pop.search.attempt, proc->ready.pop.search.attempt, __ATOMIC_SEQ_CST ); proc->ready.pop.search.attempt = 0; 91 __atomic_fetch_add( &cltr->ready.pop.search.success, proc->ready.pop.search.success, __ATOMIC_SEQ_CST ); proc->ready.pop.search.success = 0; 92 __atomic_fetch_add( &cltr->ready.pop.search.elock , proc->ready.pop.search.elock , __ATOMIC_SEQ_CST ); proc->ready.pop.search.elock = 0; 93 __atomic_fetch_add( &cltr->ready.pop.search.eempty , proc->ready.pop.search.eempty , __ATOMIC_SEQ_CST ); proc->ready.pop.search.eempty = 0; 94 __atomic_fetch_add( &cltr->ready.pop.search.espec , proc->ready.pop.search.espec , __ATOMIC_SEQ_CST ); proc->ready.pop.search.espec = 0; 69 95 __atomic_fetch_add( &cltr->ready.threads.migration , proc->ready.threads.migration , __ATOMIC_SEQ_CST ); proc->ready.threads.migration = 0; 70 96 __atomic_fetch_add( &cltr->ready.threads.threads , proc->ready.threads.threads , __ATOMIC_SEQ_CST ); proc->ready.threads.threads = 0; … … 95 121 96 122 if( flags & CFA_STATS_READY_Q ) { 97 double push_len = ((double)ready.pick.push.attempt) / ready.pick.push.success; 98 double ext_len = ((double)ready.pick.ext .attempt) / ready.pick.ext .success; 99 double pop_len = ((double)ready.pick.pop .attempt) / ready.pick.pop .success; 100 101 double lpush_len = ((double)ready.pick.push.local) / ready.pick.push.lsuccess; 102 double lext_len = ((double)ready.pick.ext .local) / ready.pick.ext .lsuccess; 103 double lpop_len = ((double)ready.pick.pop .local) / ready.pick.pop .lsuccess; 123 double push_len = ((double)ready.push.local.attempt + ready.push.share.attempt + ready.push.extrn.attempt) / (ready.push.local.success + ready.push.share.success + ready.push.extrn.success); 124 double sLcl_len = ready.push.local.success ? ((double)ready.push.local.attempt) / ready.push.local.success : 0; 125 double sOth_len = ready.push.share.success ? ((double)ready.push.share.attempt) / ready.push.share.success : 0; 126 double sExt_len = ready.push.extrn.success ? ((double)ready.push.extrn.attempt) / ready.push.extrn.success : 0; 127 128 double rLcl_len = ready.pop.local .success ? ((double)ready.pop.local .attempt) / ready.pop.local .success : 0; 129 double rHlp_len = ready.pop.help .success ? ((double)ready.pop.help .attempt) / ready.pop.help .success : 0; 130 double rStl_len = ready.pop.steal .success ? ((double)ready.pop.steal .attempt) / ready.pop.steal .success : 0; 131 double rSch_len = ready.pop.search.success ? ((double)ready.pop.search.attempt) / ready.pop.search.success : 0; 104 132 105 133 __cfaabi_bits_print_safe( STDOUT_FILENO, 106 134 "----- %s \"%s\" (%p) - Ready Q Stats -----\n" 107 "- total threads : %'15" PRIu64 "run, %'15" PRIu64 "schd (%'" PRIu64 "ext, %'" PRIu64 "mig, %'" PRId64 " )\n" 108 "- push avg probe : %'3.2lf, %'3.2lfl (%'15" PRIu64 " attempts, %'15" PRIu64 " locals)\n" 109 "- ext avg probe : %'3.2lf, %'3.2lfl (%'15" PRIu64 " attempts, %'15" PRIu64 " locals)\n" 110 "- pop avg probe : %'3.2lf, %'3.2lfl (%'15" PRIu64 " attempts, %'15" PRIu64 " locals)\n" 111 "- Idle Sleep : %'15" PRIu64 "h, %'15" PRIu64 "c, %'15" PRIu64 "w, %'15" PRIu64 "e\n" 135 "- totals : %'3" PRIu64 " run, %'3" PRIu64 " schd (%'" PRIu64 "ext, %'" PRIu64 "mig, %'" PRId64 " )\n" 136 "- push avg : %'3.2lf (l: %'3.2lf/%'" PRIu64 ", s: %'3.2lf/%'" PRIu64 ", e: %'3.2lf : %'" PRIu64 "e)\n" 137 "- local : %'3.2lf (%'3" PRIu64 " try, %'3" PRIu64 " spc, %'3" PRIu64 " lck, %'3" PRIu64 " ept)\n" 138 "- help : %'3.2lf (%'3" PRIu64 " try, %'3" PRIu64 " spc, %'3" PRIu64 " lck, %'3" PRIu64 " ept)\n" 139 "- steal : %'3.2lf (%'3" PRIu64 " try, %'3" PRIu64 " spc, %'3" PRIu64 " lck, %'3" PRIu64 " ept)\n" 140 "- search : %'3.2lf (%'3" PRIu64 " try, %'3" PRIu64 " spc, %'3" PRIu64 " lck, %'3" PRIu64 " ept)\n" 141 "- Idle Slp : %'3" PRIu64 "h, %'3" PRIu64 "c, %'3" PRIu64 "w, %'3" PRIu64 "e\n" 112 142 "\n" 113 143 , type, name, id 114 , ready.pick.pop.success 115 , ready.pick.push.success + ready.pick.ext.success 116 , ready.pick.ext.success, ready.threads.migration, ready.threads.threads 117 , push_len, lpush_len, ready.pick.push.attempt, ready.pick.push.local 118 , ext_len , lext_len , ready.pick.ext .attempt, ready.pick.ext .local 119 , pop_len , lpop_len , ready.pick.pop .attempt, ready.pick.pop .local 144 , ready.pop.local.success + ready.pop.help.success + ready.pop.steal.success + ready.pop.search.success 145 , ready.push.local.success + ready.push.share.success + ready.push.extrn.success 146 , ready.push.extrn.success, ready.threads.migration, ready.threads.threads 147 , push_len, sLcl_len, ready.push.local.attempt, sOth_len, ready.push.share.attempt, sExt_len, ready.push.extrn.attempt 148 , rLcl_len, ready.pop.local .attempt, ready.pop.local .espec, ready.pop.local .elock, ready.pop.local .eempty 149 , rHlp_len, ready.pop.help .attempt, ready.pop.help .espec, ready.pop.help .elock, ready.pop.help .eempty 150 , rStl_len, ready.pop.steal .attempt, ready.pop.steal .espec, ready.pop.steal .elock, ready.pop.steal .eempty 151 , rSch_len, ready.pop.search.attempt, ready.pop.search.espec, ready.pop.search.elock, ready.pop.search.eempty 120 152 , ready.sleep.halts, ready.sleep.cancels, ready.sleep.wakes, ready.sleep.exits 121 153 ); -
libcfa/src/concurrency/stats.hfa
r4aa495f rd2fadeb 16 16 static inline void __print_stats( struct __stats_t *, int, const char *, const char *, void * ) {} 17 17 #else 18 struct __stats_readyQ_pop_t { 19 // number of attemps at poping something 20 volatile uint64_t attempt; 18 21 19 struct __attribute__((aligned(64))) __stats_readQ_t { 22 // number of successes at poping 23 volatile uint64_t success; 24 25 // number of attempts failed due to the lock being held 26 volatile uint64_t elock; 27 28 // number of attempts failed due to the queue being empty (lock held) 29 volatile uint64_t eempty; 30 31 // number of attempts failed due to the queue looking empty (lock not held) 32 volatile uint64_t espec; 33 }; 34 35 struct __attribute__((aligned(64))) __stats_readyQ_t { 36 // Push statistic 20 37 struct { 21 // Push statistic22 38 struct { 23 // number of attemps at pushing something 39 // number of attemps at pushing something to preferred queues 24 40 volatile uint64_t attempt; 25 41 26 // number of successes at pushing 42 // number of successes at pushing to preferred queues 27 43 volatile uint64_t success; 44 } 45 // Stats for local queue within cluster 46 local, 28 47 29 // number of attemps at pushing something to preferred queues30 volatile uint64_t local;48 // Stats for non-local queues within cluster 49 share, 31 50 32 // number of successes at pushing to preferred queues33 volatile uint64_t lsuccess;34 51 // Stats from outside cluster 52 extrn; 53 } push; 35 54 36 struct { 37 // number of attemps at pushing something 38 volatile uint64_t attempt; 55 // Pop statistic 56 struct { 57 // pop from local queue 58 __stats_readyQ_pop_t local; 39 59 40 // number of successes at pushing41 volatile uint64_t success;60 // pop before looking at local queue 61 __stats_readyQ_pop_t help; 42 62 43 // number of attemps at pushing something to preferred queues44 volatile uint64_t local;63 // pop from some other queue 64 __stats_readyQ_pop_t steal; 45 65 46 // number of successes at pushing to preferred queues47 volatile uint64_t lsuccess;48 } ext;66 // pop when searching queues sequentially 67 __stats_readyQ_pop_t search; 68 } pop; 49 69 50 // Pop statistic51 struct {52 // number of reads of the mask53 // picking an empty __cfa_readyQ_mask_t counts here54 // but not as an attempt55 volatile uint64_t probe;56 57 // number of attemps at poping something58 volatile uint64_t attempt;59 60 // number of successes at poping61 volatile uint64_t success;62 63 // number of attemps at poping something to preferred queues64 volatile uint64_t local;65 66 // number of successes at poping to preferred queues67 volatile uint64_t lsuccess;68 } pop;69 } pick;70 70 struct { 71 71 volatile uint64_t migration; … … 119 119 120 120 struct __attribute__((aligned(128))) __stats_t { 121 __stats_read Q_t ready;121 __stats_readyQ_t ready; 122 122 #if defined(CFA_HAVE_LINUX_IO_URING_H) 123 123 __stats_io_t io;
Note: See TracChangeset
for help on using the changeset viewer.