- Timestamp:
- Feb 2, 2022, 9:25:43 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 2f52b18
- Parents:
- 6180274 (diff), 941e14a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- libcfa/src/concurrency
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/preemption.cfa
r6180274 r9dc0836 661 661 662 662 // Check if it is safe to preempt here 663 if( !preemption_ready( ip ) ) { return; } 663 if( !preemption_ready( ip ) ) { 664 #if !defined(__CFA_NO_STATISTICS__) 665 __cfaabi_tls.this_stats->ready.threads.preempt.rllfwd++; 666 #endif 667 return; 668 } 664 669 665 670 __cfaabi_dbg_print_buffer_decl( " KERNEL: preempting core %p (%p @ %p).\n", __cfaabi_tls.this_processor, __cfaabi_tls.this_thread, (void *)(cxt->uc_mcontext.CFA_REG_IP) ); … … 680 685 681 686 // Preemption can occur here 687 688 #if !defined(__CFA_NO_STATISTICS__) 689 __cfaabi_tls.this_stats->ready.threads.preempt.yield++; 690 #endif 682 691 683 692 force_yield( __ALARM_PREEMPTION ); // Do the actual __cfactx_switch -
libcfa/src/concurrency/stats.cfa
r6180274 r9dc0836 29 29 stats->ready.threads.threads = 0; 30 30 stats->ready.threads.cthreads = 0; 31 stats->ready.threads.preempt.yield = 0; 32 stats->ready.threads.preempt.rllfwd = 0; 31 33 stats->ready.sleep.halts = 0; 32 34 stats->ready.sleep.cancels = 0; … … 77 79 78 80 void __tally_stats( struct __stats_t * cltr, struct __stats_t * proc ) { 79 tally_one( &cltr->ready.push.local.attempt, &proc->ready.push.local.attempt ); 80 tally_one( &cltr->ready.push.local.success, &proc->ready.push.local.success ); 81 tally_one( &cltr->ready.push.share.attempt, &proc->ready.push.share.attempt ); 82 tally_one( &cltr->ready.push.share.success, &proc->ready.push.share.success ); 83 tally_one( &cltr->ready.push.extrn.attempt, &proc->ready.push.extrn.attempt ); 84 tally_one( &cltr->ready.push.extrn.success, &proc->ready.push.extrn.success ); 85 tally_one( &cltr->ready.pop.local .attempt, &proc->ready.pop.local .attempt ); 86 tally_one( &cltr->ready.pop.local .success, &proc->ready.pop.local .success ); 87 tally_one( &cltr->ready.pop.help .attempt, &proc->ready.pop.help .attempt ); 88 tally_one( &cltr->ready.pop.help .success, &proc->ready.pop.help .success ); 89 tally_one( &cltr->ready.pop.steal .attempt, &proc->ready.pop.steal .attempt ); 90 tally_one( &cltr->ready.pop.steal .success, &proc->ready.pop.steal .success ); 91 tally_one( &cltr->ready.pop.search.attempt, &proc->ready.pop.search.attempt ); 92 tally_one( &cltr->ready.pop.search.success, &proc->ready.pop.search.success ); 93 tally_one( &cltr->ready.threads.migration , &proc->ready.threads.migration ); 94 tally_one( &cltr->ready.threads.extunpark , &proc->ready.threads.extunpark ); 95 tally_one( &cltr->ready.threads.threads , &proc->ready.threads.threads ); 96 tally_one( &cltr->ready.threads.cthreads , &proc->ready.threads.cthreads ); 97 tally_one( &cltr->ready.sleep.halts , &proc->ready.sleep.halts ); 98 tally_one( &cltr->ready.sleep.cancels , &proc->ready.sleep.cancels ); 99 tally_one( &cltr->ready.sleep.early , &proc->ready.sleep.early ); 100 tally_one( &cltr->ready.sleep.wakes , &proc->ready.sleep.wakes ); 101 tally_one( &cltr->ready.sleep.seen , &proc->ready.sleep.wakes ); 102 tally_one( &cltr->ready.sleep.exits , &proc->ready.sleep.exits ); 81 tally_one( &cltr->ready.push.local.attempt , &proc->ready.push.local.attempt ); 82 tally_one( &cltr->ready.push.local.success , &proc->ready.push.local.success ); 83 tally_one( &cltr->ready.push.share.attempt , &proc->ready.push.share.attempt ); 84 tally_one( &cltr->ready.push.share.success , &proc->ready.push.share.success ); 85 tally_one( &cltr->ready.push.extrn.attempt , &proc->ready.push.extrn.attempt ); 86 tally_one( &cltr->ready.push.extrn.success , &proc->ready.push.extrn.success ); 87 tally_one( &cltr->ready.pop.local .attempt , &proc->ready.pop.local .attempt ); 88 tally_one( &cltr->ready.pop.local .success , &proc->ready.pop.local .success ); 89 tally_one( &cltr->ready.pop.help .attempt , &proc->ready.pop.help .attempt ); 90 tally_one( &cltr->ready.pop.help .success , &proc->ready.pop.help .success ); 91 tally_one( &cltr->ready.pop.steal .attempt , &proc->ready.pop.steal .attempt ); 92 tally_one( &cltr->ready.pop.steal .success , &proc->ready.pop.steal .success ); 93 tally_one( &cltr->ready.pop.search.attempt , &proc->ready.pop.search.attempt ); 94 tally_one( &cltr->ready.pop.search.success , &proc->ready.pop.search.success ); 95 tally_one( &cltr->ready.threads.migration , &proc->ready.threads.migration ); 96 tally_one( &cltr->ready.threads.extunpark , &proc->ready.threads.extunpark ); 97 tally_one( &cltr->ready.threads.threads , &proc->ready.threads.threads ); 98 tally_one( &cltr->ready.threads.cthreads , &proc->ready.threads.cthreads ); 99 tally_one( &cltr->ready.threads.preempt.yield , &proc->ready.threads.preempt.yield ); 100 tally_one( &cltr->ready.threads.preempt.rllfwd, &proc->ready.threads.preempt.rllfwd ); 101 tally_one( &cltr->ready.sleep.halts , &proc->ready.sleep.halts ); 102 tally_one( &cltr->ready.sleep.cancels , &proc->ready.sleep.cancels ); 103 tally_one( &cltr->ready.sleep.early , &proc->ready.sleep.early ); 104 tally_one( &cltr->ready.sleep.wakes , &proc->ready.sleep.wakes ); 105 tally_one( &cltr->ready.sleep.seen , &proc->ready.sleep.wakes ); 106 tally_one( &cltr->ready.sleep.exits , &proc->ready.sleep.exits ); 103 107 104 108 #if defined(CFA_HAVE_LINUX_IO_URING_H) … … 168 172 | eng3(ready.sleep.wakes + ready.sleep.early) | '(' | eng3(ready.sleep.early) | ',' | eng3(ready.sleep.seen) | ')' | " wake(early, seen)," 169 173 | eng3(ready.sleep.exits) | "exit"; 174 sstr | "- Preemption : " | eng3(ready.threads.preempt.yield) | "yields," | eng3(ready.threads.preempt.rllfwd) | "delayed"; 170 175 sstr | nl; 171 176 } -
libcfa/src/concurrency/stats.hfa
r6180274 r9dc0836 65 65 volatile int64_t threads; // number of threads in the system, includes only local change 66 66 volatile int64_t cthreads; // number of threads in the system, includes only local change 67 struct { 68 volatile uint64_t yield; 69 volatile uint64_t rllfwd; 70 } preempt; 67 71 } threads; 68 72 struct {
Note: See TracChangeset
for help on using the changeset viewer.