Ignore:
Timestamp:
May 17, 2019, 9:27:04 AM (5 years ago)
Author:
alain
Message:

Remove the "giant" rwlock protecting the GPT, and
use the GPT_LOCKED attribute in each PTE to prevent
concurrent modifications of one GPT entry.
The version number has been incremented to 2.1.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/scheduler.c

    r625 r629  
    6363// @ returns pointer on selected thread descriptor
    6464////////////////////////////////////////////////////////////////////////////////////////////
    65 thread_t * sched_select( scheduler_t * sched )
     65static thread_t * sched_select( scheduler_t * sched )
    6666{
    6767    thread_t     * thread;
     
    248248uint32_t cycle = (uint32_t)hal_get_cycles();
    249249if( DEBUG_SCHED_HANDLE_SIGNALS < cycle )
    250 printk("\n[%s] thread[%x,%x] on core[%x,%d] deleted / %d threads / cycle %d\n",
     250printk("\n[%s] thread[%x,%x] on core[%x,%d] deleted (still %d threads) / cycle %d\n",
    251251__FUNCTION__, process->pid, thread->trdid, local_cxy, thread->core->lid, count, cycle );
     252#endif
     253
     254#if CONFIG_INSTRUMENTATION_PGFAULTS
     255uint32_t local_nr    = thread->info.local_pgfault_nr;
     256uint32_t local_cost  = (local_nr == 0)  ? 0 : (thread->info.local_pgfault_cost / local_nr);
     257uint32_t global_nr   = thread->info.global_pgfault_nr;
     258uint32_t global_cost = (global_nr == 0) ? 0 : (thread->info.global_pgfault_cost / global_nr);
     259uint32_t false_nr    = thread->info.false_pgfault_nr;
     260uint32_t false_cost  = (false_nr == 0)  ? 0 : (thread->info.false_pgfault_cost / false_nr);
     261printk("***** page faults for thread[%x,%x]\n"
     262       "  - %d local  : %d cycles\n"
     263       "  - %d global : %d cycles\n"
     264       "  - %d false  : %d cycles\n",
     265       process->pid, thread->trdid,
     266       local_nr,  local_cost,
     267       global_nr, global_cost,
     268       false_nr,  false_cost );
    252269#endif
    253270            // destroy process descriptor if last thread
     
    481498 
    482499#if (DEBUG_SCHED_YIELD & 0x1)
    483 // if( sched->trace )
    484 if( (uint32_t)hal_get_cycles() > DEBUG_SCHED_YIELD )
     500if( sched->trace )
    485501sched_display( lid );
    486502#endif
     
    535551
    536552#if DEBUG_SCHED_YIELD
    537 // if( sched->trace )
    538 if( (uint32_t)hal_get_cycles() > DEBUG_SCHED_YIELD )
     553if( sched->trace )
    539554printk("\n[%s] core[%x,%d] / cause = %s\n"
    540555"      thread %x (%s) (%x,%x) => thread %x (%s) (%x,%x) / cycle %d\n",
     
    553568
    554569#if (DEBUG_SCHED_YIELD & 1)
    555 // if( sched->trace )
    556 if( (uint32_t)hal_get_cycles() > DEBUG_SCHED_YIELD )
     570if( sched->trace )
    557571printk("\n[%s] core[%x,%d] / cause = %s\n"
    558572"      thread %x (%s) (%x,%x) continue / cycle %d\n",
Note: See TracChangeset for help on using the changeset viewer.