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/grdxt.h

    r626 r635  
    3636 * Memory for the second and third levels arrays is dynamically allocated by the
    3737 * grdxt_insert() function and is only released by grdxt_destroy().
    38  * - This structure is entirely contained in one single cluster.
    39  * - All modifications (insert / remove) must be done by a thread running in local cluster.
    40  * - Lookup can be done by a thread running in any cluster (local or remote).
     38 * This structure is entirely contained in one single cluster, but to allow any thread
     39 * to access it, two sets of access functions are defined:
     40 * - local threads can use access function using local pointers.
     41 * - remote threads must use the access functions using extended pointers.
    4142 ******************************************************************************************
    4243 * When it is used by the mapper implementing the file cache:
     
    5455grdxt_t;
    5556
     57////////////////////////////////////////////////////////////////////////////////////////////
     58//                       Local access functions
     59////////////////////////////////////////////////////////////////////////////////////////////
     60
    5661/*******************************************************************************************
    5762 * This function initialises the radix-tree descriptor,
     63 * It must be called by a local thread.
    5864 * and allocates memory for the first level array of pointers.
    5965 *******************************************************************************************
     
    7177/*******************************************************************************************
    7278 * This function releases all memory allocated to the radix-tree infrastructure.
    73  * The radix-tree is supposed to be empty, but this is NOT checked by this function.
     79 * It must be called by a local thread.
     80 * A warning message is printed on the kernel TXT0 if the radix tree is not empty.
    7481 *******************************************************************************************
    7582 * @ rt      : pointer on the radix-tree descriptor.
     
    7986/*******************************************************************************************
    8087 * This function insert a new item in the radix-tree.
     88 * It must be called by a local thread.
    8189 * It dynamically allocates memory for new second and third level arrays if required.
    8290 *******************************************************************************************
     
    8492 * @ key     : key value.
    8593 * @ value   : pointer on item to be registered in radix-tree.
    86  * @ returns 0 if success / returns ENOMEM if no memory, or EINVAL if illegal key.
     94 * @ returns 0 if success / returns -1 if no memory, or illegal key.
    8795 ******************************************************************************************/
    8896error_t grdxt_insert( grdxt_t  * rt,
     
    9199
    92100/*******************************************************************************************
    93  * This function removes an item identified by its key, and returns a pointer
    94  * on the removed item. No memory is released.
     101 * This function removes an item identified by its key from the radix tree,
     102 * It must be called by a local thread.
     103 * and returns a pointer on the removed item. No memory is released.
    95104 *******************************************************************************************
    96105 * @ rt      : pointer on the radix-tree descriptor.
     
    103112/*******************************************************************************************
    104113 * This function returns to a local client, a local pointer on the item identified
     114 * It must be called by a local thread.
    105115 * by the <key> argument, from the radix tree identified by the <rt> local pointer.
    106116 *******************************************************************************************
     
    113123
    114124/*******************************************************************************************
    115  * This function returns to a - possibly remote - remote client, an extended pointer
    116  * on the item identified by the <key> argument, from the radix tree identified by
    117  * the <rt_xp> remote pointer.
    118  *******************************************************************************************
    119  * @ rt_xp   : extended pointer on the radix-tree descriptor.
    120  * @ key     : key value.
    121  * @ returns an extended pointer on found item if success / returns XPTR_NULL if failure.
    122  ******************************************************************************************/
    123 xptr_t grdxt_remote_lookup( xptr_t     rt_xp,
    124                             uint32_t   key );
    125 
    126 /*******************************************************************************************
    127125 * This function scan all radix-tree entries in increasing key order, starting from
     126 * It must be called by a local thread.
    128127 * the value defined by the <key> argument, and return a pointer on the first valid
    129128 * registered item, and the found item key value.
     
    138137                        uint32_t * found_key );
    139138
     139////////////////////////////////////////////////////////////////////////////////////////////
     140//                       Remote access functions
     141////////////////////////////////////////////////////////////////////////////////////////////
     142
     143/*******************************************************************************************
     144 * This function insert a new item in a - possibly remote - radix tree.
     145 * It dynamically allocates memory for new second and third level arrays if required.
     146 *******************************************************************************************
     147 * @ rt_xp   : extended pointer on the radix-tree descriptor.
     148 * @ key     : key value.
     149 * @ value   : pointer on item to be registered in radix-tree.
     150 * @ returns 0 if success / returns -1 if no memory, or illegal key.
     151 ******************************************************************************************/
     152error_t grdxt_remote_insert( xptr_t     rt_xp,
     153                             uint32_t   key,
     154                             void     * value );
     155
     156/*******************************************************************************************
     157 * This function removes an item identified by its key from a - possibly remote - radix
     158 * tree, and returns a local pointer on the removed item. No memory is released.
     159 *******************************************************************************************
     160 * @ rt_xp   : pointer on the radix-tree descriptor.
     161 * @ key     : key value.
     162 * @ returns local pointer on removed item if success / returns NULL if failure.
     163 ******************************************************************************************/
     164void * grdxt_remote_remove( xptr_t    rt_xp,
     165                            uint32_t  key );
     166
     167/*******************************************************************************************
     168 * This function returns to a - possibly remote - client, an extended pointer
     169 * on the item identified by the <key> argument, from the radix tree identified by
     170 * the <rt_xp> remote pointer.
     171 *******************************************************************************************
     172 * @ rt_xp   : extended pointer on the radix-tree descriptor.
     173 * @ key     : key value.
     174 * @ returns an extended pointer on found item if success / returns XPTR_NULL if failure.
     175 ******************************************************************************************/
     176xptr_t grdxt_remote_lookup( xptr_t     rt_xp,
     177                            uint32_t   key );
     178
    140179/*******************************************************************************************
    141180 * This function displays the current content of a possibly remote radix_tree.
     
    144183 * @ string  : radix tree identifier.
    145184 ******************************************************************************************/
    146 void grdxt_display( xptr_t    rt_xp,
    147                     char    * string );
    148 
     185void grdxt_remote_display( xptr_t    rt_xp,
     186                           char    * string );
    149187
    150188#endif  /* _GRDXT_H_ */
Note: See TracChangeset for help on using the changeset viewer.