Changeset b035046 for libcfa/src/concurrency
- Timestamp:
- May 25, 2022, 3:18:21 PM (3 years ago)
- Branches:
- ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
- Children:
- 5024df4
- Parents:
- 6dc7011a
- Location:
- libcfa/src/concurrency
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/io.cfa
r6dc7011a rb035046 221 221 const unsigned long long ctsc = rdtscl(); 222 222 223 if(proc->io.target == MAX) {223 if(proc->io.target == UINT_MAX) { 224 224 uint64_t chaos = __tls_rand(); 225 225 unsigned ext = chaos & 0xff; … … 232 232 else { 233 233 const unsigned target = proc->io.target; 234 /* paranoid */ verify( io.tscs[target].tv != MAX );234 /* paranoid */ verify( io.tscs[target].tv != ULLONG_MAX ); 235 235 HELP: if(target < ctxs_count) { 236 236 const unsigned long long cutoff = calc_cutoff(ctsc, ctx->cq.id, ctxs_count, io.data, io.tscs, __shard_factor.io); … … 246 246 __STATS__( true, io.calls.helped++; ) 247 247 } 248 proc->io.target = MAX;248 proc->io.target = UINT_MAX; 249 249 } 250 250 } -
libcfa/src/concurrency/io/types.hfa
r6dc7011a rb035046 17 17 #pragma once 18 18 19 #include <limits.h> 20 19 21 extern "C" { 20 22 #include <linux/types.h> … … 25 27 #include "iofwd.hfa" 26 28 #include "kernel/fwd.hfa" 27 #include "limits.hfa"28 29 29 30 #if defined(CFA_HAVE_LINUX_IO_URING_H) … … 140 141 const __u32 tail = *this->cq.tail; 141 142 142 if(head == tail) return MAX;143 if(head == tail) return ULLONG_MAX; 143 144 144 145 return this->cq.ts; -
libcfa/src/concurrency/kernel/cluster.cfa
r6dc7011a rb035046 233 233 if(is_empty(sl)) { 234 234 assert( sl.anchor.next == 0p ); 235 assert( sl.anchor.ts == -1llu);235 assert( sl.anchor.ts == MAX ); 236 236 assert( mock_head(sl) == sl.prev ); 237 237 } else { 238 238 assert( sl.anchor.next != 0p ); 239 assert( sl.anchor.ts != -1llu);239 assert( sl.anchor.ts != MAX ); 240 240 assert( mock_head(sl) != sl.prev ); 241 241 } … … 259 259 /* paranoid */ verifyf( it, "Unexpected null iterator, at index %u of %u\n", i, count); 260 260 it->rdq.id = valrq; 261 it->rdq.target = MAX;261 it->rdq.target = UINT_MAX; 262 262 valrq += __shard_factor.readyq; 263 263 #if defined(CFA_HAVE_LINUX_IO_URING_H) 264 264 it->io.ctx->cq.id = valio; 265 it->io.target = MAX;265 it->io.target = UINT_MAX; 266 266 valio += __shard_factor.io; 267 267 #endif … … 472 472 this.prev = mock_head(this); 473 473 this.anchor.next = 0p; 474 this.anchor.ts = -1llu;474 this.anchor.ts = MAX; 475 475 #if !defined(__CFA_NO_STATISTICS__) 476 476 this.cnt = 0; … … 484 484 /* paranoid */ verify( &mock_head(this)->link.ts == &this.anchor.ts ); 485 485 /* paranoid */ verify( mock_head(this)->link.next == 0p ); 486 /* paranoid */ verify( mock_head(this)->link.ts == -1llu);486 /* paranoid */ verify( mock_head(this)->link.ts == MAX ); 487 487 /* paranoid */ verify( mock_head(this) == this.prev ); 488 488 /* paranoid */ verify( __alignof__(__intrusive_lane_t) == 128 ); … … 495 495 // Make sure the list is empty 496 496 /* paranoid */ verify( this.anchor.next == 0p ); 497 /* paranoid */ verify( this.anchor.ts == -1llu);497 /* paranoid */ verify( this.anchor.ts == MAX ); 498 498 /* paranoid */ verify( mock_head(this) == this.prev ); 499 499 } -
libcfa/src/concurrency/kernel/cluster.hfa
r6dc7011a rb035046 19 19 #include "kernel/private.hfa" 20 20 21 #include "limits.hfa"21 #include <limits.h> 22 22 23 23 //----------------------------------------------------------------------- … … 37 37 38 38 static inline void touch_tsc(__timestamp_t * tscs, size_t idx, unsigned long long ts_prev, unsigned long long ts_next) { 39 if (ts_next == MAX) return;39 if (ts_next == ULLONG_MAX) return; 40 40 unsigned long long now = rdtscl(); 41 41 unsigned long long pma = __atomic_load_n(&tscs[ idx ].ma, __ATOMIC_RELAXED); … … 59 59 for(i; shard_factor) { 60 60 unsigned long long ptsc = ts(data[start + i]); 61 if(ptsc != -1ull) {61 if(ptsc != ULLONG_MAX) { 62 62 /* paranoid */ verify( start + i < count ); 63 63 unsigned long long tsc = moving_average(ctsc, ptsc, tscs[start + i].ma); -
libcfa/src/concurrency/kernel/startup.cfa
r6dc7011a rb035046 507 507 self_mon_p = &self_mon; 508 508 link.next = 0p; 509 link.ts = -1llu;509 link.ts = MAX; 510 510 preferred = ready_queue_new_preferred(); 511 511 last_proc = 0p; -
libcfa/src/concurrency/ready_queue.cfa
r6dc7011a rb035046 125 125 const unsigned long long ctsc = rdtscl(); 126 126 127 if(proc->rdq.target == MAX) {127 if(proc->rdq.target == UINT_MAX) { 128 128 uint64_t chaos = __tls_rand(); 129 129 unsigned ext = chaos & 0xff; … … 137 137 const unsigned target = proc->rdq.target; 138 138 __cfadbg_print_safe(ready_queue, "Kernel : %u considering helping %u, tcsc %llu\n", this, target, readyQ.tscs[target].tv); 139 /* paranoid */ verify( readyQ.tscs[target].tv != MAX );139 /* paranoid */ verify( readyQ.tscs[target].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); … … 147 147 } 148 148 } 149 proc->rdq.target = MAX;149 proc->rdq.target = UINT_MAX; 150 150 } 151 151 … … 245 245 // get preferred ready for new thread 246 246 unsigned ready_queue_new_preferred() { 247 unsigned pref = MAX;247 unsigned pref = UINT_MAX; 248 248 if(struct thread$ * thrd = publicTLS_get( this_thread )) { 249 249 pref = thrd->preferred; -
libcfa/src/concurrency/ready_subqueue.hfa
r6dc7011a rb035046 71 71 bool is_empty = this.anchor.next == 0p; 72 72 node->link.next = 0p; 73 node->link.ts = MAX;73 node->link.ts = ULLONG_MAX; 74 74 #if !defined(__CFA_NO_STATISTICS__) 75 75 this.cnt--; -
libcfa/src/concurrency/thread.cfa
r6dc7011a rb035046 19 19 #include "thread.hfa" 20 20 21 #include "exception.hfa" 21 22 #include "kernel/private.hfa" 22 #include " exception.hfa"23 #include "limits.hfa" 23 24 24 25 #define __CFA_INVOKE_PRIVATE__ … … 44 45 curr_cluster = &cl; 45 46 link.next = 0p; 46 link.ts = -1llu;47 link.ts = MAX; 47 48 preferred = ready_queue_new_preferred(); 48 49 last_proc = 0p;
Note: See TracChangeset
for help on using the changeset viewer.