Changeset c4c8571 for libcfa/src/concurrency/ready_queue.cfa
- Timestamp:
- Jul 28, 2022, 12:04:25 PM (2 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation
- Children:
- 32d1383, d0fcc82
- Parents:
- 3f95dab (diff), 2af1943 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/ready_queue.cfa
r3f95dab rc4c8571 81 81 /* paranoid */ verify( i < lanes_count ); 82 82 // If we can't lock it retry 83 } while( !__atomic_try_acquire( &readyQ.data[i].l ock ) );83 } while( !__atomic_try_acquire( &readyQ.data[i].l.lock ) ); 84 84 } else { 85 85 do { 86 86 i = __tls_rand() % lanes_count; 87 } while( !__atomic_try_acquire( &readyQ.data[i].l ock ) );87 } while( !__atomic_try_acquire( &readyQ.data[i].l.lock ) ); 88 88 } 89 89 } else { … … 93 93 /* paranoid */ verify( i < lanes_count ); 94 94 // If we can't lock it retry 95 } while( !__atomic_try_acquire( &readyQ.data[i].l ock ) );95 } while( !__atomic_try_acquire( &readyQ.data[i].l.lock ) ); 96 96 } 97 97 … … 100 100 101 101 // Unlock and return 102 __atomic_unlock( &readyQ.data[i].l ock );102 __atomic_unlock( &readyQ.data[i].l.lock ); 103 103 104 104 #if !defined(__CFA_NO_STATISTICS__) … … 136 136 else { 137 137 const unsigned target = proc->rdq.target; 138 __cfadbg_print_safe(ready_queue, "Kernel : %u considering helping %u, tcsc %llu\n", this, target, readyQ.tscs[target].t v);139 /* paranoid */ verify( readyQ.tscs[target].t v != ULLONG_MAX );138 __cfadbg_print_safe(ready_queue, "Kernel : %u considering helping %u, tcsc %llu\n", this, target, readyQ.tscs[target].t.tv); 139 /* paranoid */ verify( readyQ.tscs[target].t.tv != ULLONG_MAX ); 140 140 if(target < lanes_count) { 141 141 const unsigned long long cutoff = calc_cutoff(ctsc, proc->rdq.id, lanes_count, cltr->sched.readyQ.data, cltr->sched.readyQ.tscs, __shard_factor.readyq); 142 const unsigned long long age = moving_average(ctsc, readyQ.tscs[target].t v, readyQ.tscs[target].ma);142 const unsigned long long age = moving_average(ctsc, readyQ.tscs[target].t.tv, readyQ.tscs[target].t.ma); 143 143 __cfadbg_print_safe(ready_queue, "Kernel : Help attempt on %u from %u, age %'llu vs cutoff %'llu, %s\n", target, this, age, cutoff, age > cutoff ? "yes" : "no"); 144 144 if(age > cutoff) { … … 188 188 189 189 // If we can't get the lock retry 190 if( !__atomic_try_acquire(&lane.l ock) ) {190 if( !__atomic_try_acquire(&lane.l.lock) ) { 191 191 return 0p; 192 192 } … … 194 194 // If list is empty, unlock and retry 195 195 if( is_empty(lane) ) { 196 __atomic_unlock(&lane.l ock);196 __atomic_unlock(&lane.l.lock); 197 197 return 0p; 198 198 } … … 206 206 /* paranoid */ verify(thrd); 207 207 /* paranoid */ verify(ts_next); 208 /* paranoid */ verify(lane.l ock);208 /* paranoid */ verify(lane.l.lock); 209 209 210 210 // Unlock and return 211 __atomic_unlock(&lane.l ock);211 __atomic_unlock(&lane.l.lock); 212 212 213 213 // Update statistics
Note: See TracChangeset
for help on using the changeset viewer.