Changeset 29cb302


Ignore:
Timestamp:
Jun 24, 2020, 3:37:32 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
d72c074
Parents:
7bfc849
Message:

cfa stats now count number of migrations

Location:
libcfa/src/concurrency
Files:
3 edited

Legend:

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

    r7bfc849 r29cb302  
    490490        $thread * thrd_src = kernelTLS.this_thread;
    491491
     492        #if !defined(__CFA_NO_STATISTICS__)
     493                struct processor * last_proc = kernelTLS.this_processor;
     494        #endif
     495
    492496        // Run the thread on this processor
    493497        {
     
    504508        }
    505509
     510        #if !defined(__CFA_NO_STATISTICS__)
     511                if(last_proc != kernelTLS.this_processor) {
     512                        __tls_stats()->ready.threads.migration++;
     513                }
     514        #endif
     515
    506516        /* paranoid */ verify( ! kernelTLS.preemption_state.enabled );
    507517        /* paranoid */ verifyf( ((uintptr_t)thrd_src->context.SP) < ((uintptr_t)__get_stack(thrd_src->curr_cor)->base ), "ERROR : Returning $thread %p has been corrupted.\n StackPointer too small.\n", thrd_src );
  • libcfa/src/concurrency/stats.cfa

    r7bfc849 r29cb302  
    1717                stats->ready.pick.pop .local    = 0;
    1818                stats->ready.pick.pop .lsuccess = 0;
     19                stats->ready.threads.migration = 0;
    1920                stats->ready.sleep.halts   = 0;
    2021                stats->ready.sleep.cancels = 0;
     
    4950                __atomic_fetch_add( &cltr->ready.pick.pop .local   , proc->ready.pick.pop .local   , __ATOMIC_SEQ_CST );
    5051                __atomic_fetch_add( &cltr->ready.pick.pop .lsuccess, proc->ready.pick.pop .lsuccess, __ATOMIC_SEQ_CST );
     52                __atomic_fetch_add( &cltr->ready.threads.migration, proc->ready.threads.migration, __ATOMIC_SEQ_CST );
    5153                __atomic_fetch_add( &cltr->ready.sleep.halts  , proc->ready.sleep.halts  , __ATOMIC_SEQ_CST );
    5254                __atomic_fetch_add( &cltr->ready.sleep.cancels, proc->ready.sleep.cancels, __ATOMIC_SEQ_CST );
     
    113115                        "- local push avg prb len : %'18.2lf, %'18.2lf%% (%'15lu attempts)\n"
    114116                        "- local pop  avg prb len : %'18.2lf, %'18.2lf%% (%'15lu attempts)\n"
     117                        "- thread migrations      : %'15lu\n"
    115118                        "- Idle Sleep -\n"
    116119                        "-- halts                 : %'15lu\n"
     
    140143                        , lpush_len, lpush_sur, ready.pick.push.local
    141144                        , lpop_len , lpop_sur , ready.pick.pop .local
     145                        , ready.threads.migration
    142146                        , ready.sleep.halts, ready.sleep.cancels, ready.sleep.wakes, ready.sleep.exits
    143147                        #if defined(HAVE_LINUX_IO_URING_H)
  • libcfa/src/concurrency/stats.hfa

    r7bfc849 r29cb302  
    4646                        } pop;
    4747                } pick;
     48                struct {
     49                        volatile uint64_t migration;
     50                } threads;
    4851                struct {
    4952                        volatile uint64_t halts;
Note: See TracChangeset for help on using the changeset viewer.