Ignore:
Timestamp:
Apr 1, 2021, 8:02:19 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
a344425
Parents:
b580bcc
Message:

Stats now keep track of external pushes separately

File:
1 edited

Legend:

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

    rb580bcc rfd1f65e  
    244244        __cfadbg_print_safe(ready_queue, "Kernel : Pushing %p on cluster %p\n", thrd, cltr);
    245245
     246        #if !defined(__CFA_NO_STATISTICS__)
     247                const bool external = cltr == kernelTLS().this_processor->cltr;
     248        #endif
     249
    246250        // write timestamp
    247251        thrd->link.ts = rdtscl();
     
    266270                [i, local] = idx_from_r(r, preferred);
    267271
     272                i %= __atomic_load_n( &lanes.count, __ATOMIC_RELAXED );
     273
    268274                #if !defined(__CFA_NO_STATISTICS__)
    269                         if(local) {
    270                                 __tls_stats()->ready.pick.push.local++;
    271                         }
    272                 #endif
    273 
    274                 i %= __atomic_load_n( &lanes.count, __ATOMIC_RELAXED );
    275 
    276                 #if !defined(__CFA_NO_STATISTICS__)
    277                         __tls_stats()->ready.pick.push.attempt++;
     275                        if(external) {
     276                                if(local) __atomic_fetch_add(&cltr->stats->ready.pick.ext.local, 1, __ATOMIC_RELAXED);
     277                                __atomic_fetch_add(&cltr->stats->ready.pick.ext.attempt, 1, __ATOMIC_RELAXED);
     278                        }
     279                        else {
     280                                if(local) __tls_stats()->ready.pick.push.local++;
     281                                __tls_stats()->ready.pick.push.attempt++;
     282                        }
    278283                #endif
    279284
     
    310315        // Update statistics
    311316        #if !defined(__CFA_NO_STATISTICS__)
    312                 #if defined(BIAS)
    313                         if( local ) __tls_stats()->ready.pick.push.lsuccess++;
    314                 #endif
    315                 __tls_stats()->ready.pick.push.success++;
     317                if(external) {
     318                        if(local) __atomic_fetch_add(&cltr->stats->ready.pick.ext.lsuccess, 1, __ATOMIC_RELAXED);
     319                        __atomic_fetch_add(&cltr->stats->ready.pick.ext.success, 1, __ATOMIC_RELAXED);
     320                }
     321                else {
     322                        if(local) __tls_stats()->ready.pick.push.lsuccess++;
     323                        __tls_stats()->ready.pick.push.success++;
     324                }
    316325        #endif
    317326
Note: See TracChangeset for help on using the changeset viewer.