Ignore:
Timestamp:
Jun 26, 2019, 11:42:37 AM (5 years ago)
Author:
alain
Message:

This version is a major evolution: The physical memory allocators,
defined in the kmem.c, ppm.c, and kcm.c files have been modified
to support remote accesses. The RPCs that were previously user
to allocate physical memory in a remote cluster have been removed.
This has been done to cure a dead-lock in case of concurrent page-faults.

This version 2.2 has been tested on a (4 clusters / 2 cores per cluster)
TSAR architecture, for both the "sort" and the "fft" applications.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/libk/remote_condvar.c

    r581 r635  
    22 * remote_condvar.c - remote kernel condition variable implementation.
    33 *
    4  * Authors     Alain Greiner (2016,2017,2018)
     4 * Authors     Alain Greiner (2016,2017,2018,2019)
    55 *
    66 * Copyright (c) UPMC Sorbonne Universites
     
    8686{
    8787    remote_condvar_t * condvar_ptr;
    88     xptr_t             condvar_xp;
     88    kmem_req_t         req;   
    8989
    9090    // get pointer on local process descriptor
     
    9898    process_t * ref_ptr = (process_t *)GET_PTR( ref_xp );
    9999
    100     // allocate memory for new condvar in reference cluster
    101     if( ref_cxy == local_cxy )                              // local cluster is the reference
    102     {
    103         kmem_req_t req;   
    104         req.type    = KMEM_CONDVAR;
    105         req.flags   = AF_ZERO;
    106         condvar_ptr = kmem_alloc( &req );
    107         condvar_xp  = XPTR( local_cxy , condvar_ptr );
    108     }
    109     else                                                   // reference cluster is remote
    110     {
    111         rpc_kcm_alloc_client( ref_cxy , KMEM_CONDVAR , &condvar_xp );
    112         condvar_ptr = GET_PTR( condvar_xp );
    113     }
    114 
    115     if( condvar_xp == XPTR_NULL ) return 0xFFFFFFFF;
     100    req.type    = KMEM_KCM;
     101    req.order   = bits_log2( sizeof(remote_condvar_t) );
     102    req.flags   = AF_ZERO | AF_KERNEL;
     103    condvar_ptr = kmem_alloc( &req );
     104
     105    if( condvar_ptr == NULL )
     106    {
     107        printk("\n[ERROR] in %s : cannot create condvar\n", __FUNCTION__ );
     108        return -1;
     109    }
    116110
    117111    // initialise condvar
     
    136130void remote_condvar_destroy( xptr_t condvar_xp )
    137131{
     132    kmem_req_t  req;
     133
    138134    // get pointer on local process descriptor
    139135    process_t * process = CURRENT_THREAD->process;
     
    166162
    167163    // release memory allocated for condvar descriptor
    168     if( condvar_cxy == local_cxy )                            // reference is local
    169     {
    170         kmem_req_t  req;
    171         req.type = KMEM_SEM;
    172         req.ptr  = condvar_ptr;
    173         kmem_free( &req );
    174     }
    175     else                                                  // reference is remote
    176     {
    177         rpc_kcm_free_client( condvar_cxy , condvar_ptr , KMEM_CONDVAR );
    178     }
     164    req.type = KMEM_KCM;
     165    req.ptr  = condvar_ptr;
     166    kmem_remote_free( ref_cxy , &req );
    179167
    180168}  // end remote_convar_destroy()
Note: See TracChangeset for help on using the changeset viewer.