Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel.cfa

    r69914cbc r57f70ab  
    182182                MAIN_LOOP:
    183183                for() {
    184                         #if 1
     184                        #define OLD_MAIN 1
     185                        #if OLD_MAIN
    185186                        // Check if there is pending io
    186187                        __maybe_io_drain( this );
     
    262263
    263264                        #else
    264 
     265                                #warning new kernel loop
    265266                        SEARCH: {
    266267                                /* paranoid */ verify( ! __preemption_enabled() );
    267                                 /* paranoid */ verify( kernelTLS().this_proc_id );
    268268
    269269                                // First, lock the scheduler since we are searching for a thread
     
    278278
    279279                                // Spin a little on I/O, just in case
    280                                 for(25) {
     280                                        for(5) {
    281281                                        __maybe_io_drain( this );
    282282                                        readyThread = pop_fast( this->cltr );
     
    285285
    286286                                // no luck, try stealing a few times
    287                                 for(25) {
     287                                        for(5) {
    288288                                        if( __maybe_io_drain( this ) ) {
    289289                                                readyThread = pop_fast( this->cltr );
     
    323323                                }
    324324
    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()); )
    326326                                __cfadbg_print_safe(runtime_core, "Kernel : core %p waiting on eventfd %d\n", this, this->idle);
    327327
     
    331331                                // __enable_interrupts_hard();
    332332
    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()); )
    334334
    335335                                // We were woken up, remove self from idle
     
    341341
    342342                RUN_THREAD:
    343                         /* paranoid */ verify( kernelTLS().this_proc_id );
    344343                        /* paranoid */ verify( ! __preemption_enabled() );
    345344                        /* paranoid */ verify( readyThread );
     
    353352                        // Are we done?
    354353                        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                         #endif
    363354
    364355                        if(this->io.pending && !this->io.dirty) {
     
    877868                unsigned tail = *ctx->cq.tail;
    878869                if(head == tail) return false;
     870                #if OLD_MAIN
    879871                ready_schedule_lock();
    880872                ret = __cfa_io_drain( proc );
    881873                ready_schedule_unlock();
     874                #else
     875                        ret = __cfa_io_drain( proc );
     876        #endif
    882877        #endif
    883878        return ret;
     
    908903        }
    909904
    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 ) {
    911906                /* paranoid */ verify( cltr->stats );
    912907
Note: See TracChangeset for help on using the changeset viewer.