Changeset 68f36f4
- Timestamp:
- Jun 19, 2020, 4:59:19 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:
- 0f89d4f
- Parents:
- 64a7146
- Location:
- libcfa/src/concurrency
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.cfa
r64a7146 r68f36f4 371 371 372 372 // Make sure we aren't on the idle queue 373 #if !defined(__CFA_NO_STATISTICS__) 374 bool removed = 375 #endif 373 376 unsafe_remove( this->cltr->idles, this ); 374 Link(processor) * link = &this->cltr->idles.stack; 375 for() { 376 processor * next = link->top; 377 if( next == this ) { 378 link->top = getNext(this)->top; 379 break; 380 } 381 if( next == 0p ) break; 382 link = getNext(next); 383 } 377 378 #if !defined(__CFA_NO_STATISTICS__) 379 if(removed) __tls_stats()->ready.sleep.exits++; 380 #endif 384 381 385 382 // Unlock the RWlock … … 672 669 push( thrd->curr_cluster, thrd ); 673 670 674 __wake_one(id, thrd->curr_cluster); 671 #if !defined(__CFA_NO_STATISTICS__) 672 bool woke = 673 #endif 674 __wake_one(id, thrd->curr_cluster); 675 676 #if !defined(__CFA_NO_STATISTICS__) 677 if(woke) __tls_stats()->ready.sleep.wakes++; 678 #endif 675 679 ready_schedule_unlock( id ); 676 680 … … 969 973 if( do_terminate ) return; 970 974 975 #if !defined(__CFA_NO_STATISTICS__) 976 __tls_stats()->ready.sleep.halts++; 977 #endif 971 978 // Push self to queue 972 979 push(cltr->idles, *this); … … 979 986 __wake_one( id, cltr ); 980 987 ready_schedule_unlock( id ); 988 #if !defined(__CFA_NO_STATISTICS__) 989 __tls_stats()->ready.sleep.cancels++; 990 #endif 981 991 } 982 992 -
libcfa/src/concurrency/stats.cfa
r64a7146 r68f36f4 13 13 stats->ready.pick.pop .attempt = 0; 14 14 stats->ready.pick.pop .success = 0; 15 stats->ready.sleep.halts = 0; 16 stats->ready.sleep.cancels = 0; 17 stats->ready.sleep.wakes = 0; 18 stats->ready.sleep.exits = 0; 15 19 16 20 #if defined(HAVE_LINUX_IO_URING_H) … … 37 41 __atomic_fetch_add( &cltr->ready.pick.pop .attempt, proc->ready.pick.pop .attempt, __ATOMIC_SEQ_CST ); 38 42 __atomic_fetch_add( &cltr->ready.pick.pop .success, proc->ready.pick.pop .success, __ATOMIC_SEQ_CST ); 43 __atomic_fetch_add( &cltr->ready.sleep.halts , proc->ready.sleep.halts , __ATOMIC_SEQ_CST ); 44 __atomic_fetch_add( &cltr->ready.sleep.cancels, proc->ready.sleep.cancels, __ATOMIC_SEQ_CST ); 45 __atomic_fetch_add( &cltr->ready.sleep.wakes , proc->ready.sleep.wakes , __ATOMIC_SEQ_CST ); 46 __atomic_fetch_add( &cltr->ready.sleep.exits , proc->ready.sleep.exits , __ATOMIC_SEQ_CST ); 39 47 40 48 #if defined(HAVE_LINUX_IO_URING_H) … … 89 97 "- push average probe len : %'18.2lf, %'18.2lf%% (%'15lu attempts)\n" 90 98 "- pop average probe len : %'18.2lf, %'18.2lf%% (%'15lu attempts)\n" 99 "- Idle Sleep -\n" 100 "-- halts : %'15lu\n" 101 "-- cancelled halts : %'15lu\n" 102 "-- schedule wake : %'15lu\n" 103 "-- wake on exit : %'15lu\n" 91 104 #if defined(HAVE_LINUX_IO_URING_H) 92 105 "\n" … … 109 122 , push_len, push_sur, stats->ready.pick.push.attempt 110 123 , pop_len , pop_sur , stats->ready.pick.pop .attempt 124 , stats->ready.sleep.halts, stats->ready.sleep.cancels, stats->ready.sleep.wakes, stats->ready.sleep.exits 111 125 #if defined(HAVE_LINUX_IO_URING_H) 112 126 , submit_avg.cnt -
libcfa/src/concurrency/stats.hfa
r64a7146 r68f36f4 34 34 } pop; 35 35 } pick; 36 struct { 37 volatile uint64_t halts; 38 volatile uint64_t cancels; 39 volatile uint64_t wakes; 40 volatile uint64_t exits; 41 } sleep; 36 42 }; 37 43
Note: See TracChangeset
for help on using the changeset viewer.