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/libk/remote_rwlock.c

    r627 r629  
    5555#if DEBUG_RWLOCK_TYPE
    5656thread_t * this = CURRENT_THREAD;
    57 if( DEBUG_RWLOCK_TYPE == type )
     57if( (type               == DEBUG_RWLOCK_TYPE) &&
     58    ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) &&
     59    (lock_cxy           == DEBUG_RWLOCK_CXY ) )
    5860printk("\n[%s] thread[%x,%x] initialise lock %s [%x,%x]\n",
    5961__FUNCTION__, this->process->pid, this->trdid,
     
    9395
    9496#if DEBUG_RWLOCK_TYPE
    95 if( (DEBUG_RWLOCK_TYPE == lock_type) || (DEBUG_RWLOCK_TYPE == 1000) )
     97if( (lock_type          == DEBUG_RWLOCK_TYPE) &&
     98    ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) &&
     99    (lock_cxy           == DEBUG_RWLOCK_CXY ) )
    96100printk("\n[%s] thread[%x,%x] READ BLOCK on rwlock %s [%x,%x] / taken %d / count %d\n",
    97101__FUNCTION__, this->process->pid, this->trdid,
     
    124128
    125129#if DEBUG_RWLOCK_TYPE
    126 if( (DEBUG_RWLOCK_TYPE == lock_type) || (DEBUG_RWLOCK_TYPE == 1000) )
    127 printk("\n[%s] thread[%x,%x] READ ACQUIRE rwlock %s [%x,%x] / taken = %d / count = %d\n",
     130if( (lock_type          == DEBUG_RWLOCK_TYPE) &&
     131    ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) &&
     132    (lock_cxy           == DEBUG_RWLOCK_CXY ) )
     133printk("\n[%s] thread[%x,%x] READ ACQUIRE rwlock %s [%x,%x] / taken %d / count %d\n",
    128134__FUNCTION__, this->process->pid, this->trdid,
    129135lock_type_str[lock_type], lock_cxy, lock_ptr,
     
    166172
    167173#if DEBUG_RWLOCK_TYPE
    168 if( (DEBUG_RWLOCK_TYPE == lock_type) || (DEBUG_RWLOCK_TYPE == 1000) )
     174if( (lock_type          == DEBUG_RWLOCK_TYPE) &&
     175    ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) &&
     176    (lock_cxy           == DEBUG_RWLOCK_CXY ) )
    169177printk("\n[%s] thread[%x,%x] WRITE BLOCK on rwlock %s [%x,%x] / taken %d / count %d\n",
    170178__FUNCTION__, this->process->pid, this->trdid,
     
    196204
    197205#if DEBUG_RWLOCK_TYPE
    198 if( (DEBUG_RWLOCK_TYPE == lock_type) || (DEBUG_RWLOCK_TYPE == 1000) )
     206if( (lock_type          == DEBUG_RWLOCK_TYPE) &&
     207    ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) &&
     208    (lock_cxy           == DEBUG_RWLOCK_CXY ) )
    199209printk("\n[%s] thread[%x,%x] WRITE ACQUIRE rwlock %s [%x,%x] / taken %d / count %d\n",
    200210__FUNCTION__, this->process->pid, this->trdid,
     
    235245uint32_t   lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
    236246xptr_t     taken_xp  = XPTR( lock_cxy , &lock_ptr->taken );
    237 if( (DEBUG_RWLOCK_TYPE == lock_type) || (DEBUG_RWLOCK_TYPE == 1000) )
     247if( (lock_type          == DEBUG_RWLOCK_TYPE) &&
     248    ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) &&
     249    (lock_cxy           == DEBUG_RWLOCK_CXY ) )
    238250printk("\n[%s] thread[%x,%x] READ RELEASE rwlock %s [%x,%x] / taken %d / count %d\n",
    239251__FUNCTION__, this->process->pid, this->trdid,
     
    258270
    259271#if DEBUG_RWLOCK_TYPE
    260 if( (DEBUG_RWLOCK_TYPE == lock_type) || (DEBUG_RWLOCK_TYPE == 1000) )
     272if( (lock_type          == DEBUG_RWLOCK_TYPE) &&
     273    ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) &&
     274    (lock_cxy           == DEBUG_RWLOCK_CXY ) )
    261275{
    262276    trdid_t     trdid     = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
     
    289303
    290304#if DEBUG_RWLOCK_TYPE
    291 if( (DEBUG_RWLOCK_TYPE == lock_type) || (DEBUG_RWLOCK_TYPE == 1000) )
     305if( (lock_type          == DEBUG_RWLOCK_TYPE) &&
     306    ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) &&
     307    (lock_cxy           == DEBUG_RWLOCK_CXY ) )
    292308{
    293309    trdid_t     trdid     = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
     
    334350uint32_t   lock_type = hal_remote_l32( XPTR( lock_cxy , &lock_ptr->lock.type ) );
    335351xptr_t     count_xp  = XPTR( lock_cxy , &lock_ptr->count );
    336 if( (DEBUG_RWLOCK_TYPE == lock_type) || (DEBUG_RWLOCK_TYPE == 1000) )
     352if( (lock_type          == DEBUG_RWLOCK_TYPE) &&
     353    ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) &&
     354    (lock_cxy           == DEBUG_RWLOCK_CXY ) )
    337355printk("\n[%s] thread[%x,%x] WRITE RELEASE rwlock %s [%x,%x] / taken %d / count %d\n",
    338356__FUNCTION__, this->process->pid, this->trdid,
     
    356374
    357375#if DEBUG_RWLOCK_TYPE
    358 if( (DEBUG_RWLOCK_TYPE == lock_type) || (DEBUG_RWLOCK_TYPE == 1000) )
     376if( (lock_type          == DEBUG_RWLOCK_TYPE) &&
     377    ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) &&
     378    (lock_cxy           == DEBUG_RWLOCK_CXY ) )
    359379{
    360380    trdid_t     trdid     = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
     
    386406
    387407#if DEBUG_RWLOCK_TYPE
    388 if( (DEBUG_RWLOCK_TYPE == lock_type) || (DEBUG_RWLOCK_TYPE == 1000) )
     408if( (lock_type          == DEBUG_RWLOCK_TYPE) &&
     409    ((intptr_t)lock_ptr == DEBUG_RWLOCK_PTR ) &&
     410    (lock_cxy           == DEBUG_RWLOCK_CXY ) )
    389411{
    390412    trdid_t     trdid     = hal_remote_l32( XPTR( thread_cxy , &thread_ptr->trdid ) );
Note: See TracChangeset for help on using the changeset viewer.