- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.cfa
r69914cbc r57f70ab 182 182 MAIN_LOOP: 183 183 for() { 184 #if 1 184 #define OLD_MAIN 1 185 #if OLD_MAIN 185 186 // Check if there is pending io 186 187 __maybe_io_drain( this ); … … 262 263 263 264 #else 264 265 #warning new kernel loop 265 266 SEARCH: { 266 267 /* paranoid */ verify( ! __preemption_enabled() ); 267 /* paranoid */ verify( kernelTLS().this_proc_id );268 268 269 269 // First, lock the scheduler since we are searching for a thread … … 278 278 279 279 // Spin a little on I/O, just in case 280 for(25) {280 for(5) { 281 281 __maybe_io_drain( this ); 282 282 readyThread = pop_fast( this->cltr ); … … 285 285 286 286 // no luck, try stealing a few times 287 for(25) {287 for(5) { 288 288 if( __maybe_io_drain( this ) ) { 289 289 readyThread = pop_fast( this->cltr ); … … 323 323 } 324 324 325 __STATS( if(this->print_halts) __cfaabi_bits_print_safe( STDOUT_FILENO, "PH:%d - %lld 0\n", this->id, rdtscl()); )325 __STATS( if(this->print_halts) __cfaabi_bits_print_safe( STDOUT_FILENO, "PH:%d - %lld 0\n", this->unique_id, rdtscl()); ) 326 326 __cfadbg_print_safe(runtime_core, "Kernel : core %p waiting on eventfd %d\n", this, this->idle); 327 327 … … 331 331 // __enable_interrupts_hard(); 332 332 333 __STATS( if(this->print_halts) __cfaabi_bits_print_safe( STDOUT_FILENO, "PH:%d - %lld 1\n", this->id, rdtscl()); )333 __STATS( if(this->print_halts) __cfaabi_bits_print_safe( STDOUT_FILENO, "PH:%d - %lld 1\n", this->unique_id, rdtscl()); ) 334 334 335 335 // We were woken up, remove self from idle … … 341 341 342 342 RUN_THREAD: 343 /* paranoid */ verify( kernelTLS().this_proc_id );344 343 /* paranoid */ verify( ! __preemption_enabled() ); 345 344 /* paranoid */ verify( readyThread ); … … 353 352 // Are we done? 354 353 if( __atomic_load_n(&this->do_terminate, __ATOMIC_SEQ_CST) ) break MAIN_LOOP; 355 356 #if !defined(__CFA_NO_STATISTICS__)357 unsigned long long curr = rdtscl();358 if(curr > (last_tally + 500000000)) {359 __tally_stats(this->cltr->stats, __cfaabi_tls.this_stats);360 last_tally = curr;361 }362 #endif363 354 364 355 if(this->io.pending && !this->io.dirty) { … … 877 868 unsigned tail = *ctx->cq.tail; 878 869 if(head == tail) return false; 870 #if OLD_MAIN 879 871 ready_schedule_lock(); 880 872 ret = __cfa_io_drain( proc ); 881 873 ready_schedule_unlock(); 874 #else 875 ret = __cfa_io_drain( proc ); 876 #endif 882 877 #endif 883 878 return ret; … … 908 903 } 909 904 910 static void crawl_list( cluster * cltr, dlist(processor ) & list, unsigned count ) {905 static void crawl_list( cluster * cltr, dlist(processor, processor) & list, unsigned count ) { 911 906 /* paranoid */ verify( cltr->stats ); 912 907
Note: See TracChangeset
for help on using the changeset viewer.