Ignore:
Timestamp:
Oct 11, 2018, 5:04:28 PM (6 years ago)
Author:
alain
Message:

New DQDT implementation supporting missing clusters
thanks to the cluster_info[x][y] array.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kernel/kern/dqdt.h

    r564 r582  
    3131/****************************************************************************************
    3232 * This DQDT infrastructure maintains a topological description of ressources usage
    33  * (number of threads, and number of physical pages allocated) in each cluster.
     33 * in each cluster: number of threads, and number of physical pages allocated.
    3434 *
    3535 * - If X_SIZE or Y_SIZE are equal to 1, it makes the assumption that the cluster
     
    4242 * - If both Y_SIZE and Y_SIZE are larger than 1, it makes the assumption that
    4343 *   the clusters topology is a 2D mesh. The [X,Y] coordinates of a cluster are
    44  *   obtained from the CXY identifier using the following rules :
     44 *   obtained from the CXY identifier using the Rrelevant macros.
    4545 *      X = CXY >> Y_WIDTH   /  Y = CXY & ((1<<Y_WIDTH)-1)
    46  *   If the mesh X_SIZE and Y_SIZE dimensions are not equal, or are not power of 2,
     46 * - If the mesh X_SIZE and Y_SIZE dimensions are not equal, or are not power of 2,
     47 *   or the mesh contains "holes" reported in the cluster_info[x][y] array,
    4748 *   we build the smallest two dimensionnal quad-tree covering all clusters,
    4849 *   and this tree is truncated as required.
    49  *   The root node is always implemented in cluster [0,0]
    50  *   The mesh size is supposed to contain at most 32 * 32 clusters.
    51  *   There are at most 6 DQDT nodes in a cluster
     50 * - The mesh size is supposed to contain at most 32 * 32 clusters.
     51 *   Therefore, it can exist at most 6 DQDT nodes in a given cluster:
    5252 *   . Level 0 nodes exist on all clusters and have no children.
    5353 *   . Level 1 nodes exist when both X and Y coordinates are multiple of 2
     
    5656 *   . Level 4 nodes exist when both X and Y coordinates are multiple of 16
    5757 *   . Level 5 nodes exist when both X and Y coordinates are multiple of 32
    58  *
    59  *   TODO : the cluster_info[x][y] array is not taken into account [AG].
     58 * - For nodes other than level 0, the placement is defined as follow:
     59 *   . The root node is placed in the cluster containing the core executing
     60 *     the dqdt_init() function.
     61 *   . An intermediate node (representing a given sub-tree) is placed in one
     62 *     cluster covered by the subtree, pseudo-randomly selected.
    6063 ***************************************************************************************/
    6164
     
    6467 * The max number of children is 4, but it can be smaller for some nodes.
    6568 * Level 0 nodes are the clusters, and have no children.
    66  * The root node has no parent, and is always stored in cluster[0,0].
     69 * The root node has no parent.
    6770 ***************************************************************************************/
     71
    6872typedef struct dqdt_node_s
    6973{
     
    7377    uint32_t            pages;               // current number of pages in subtree
    7478        xptr_t              parent;              // extended pointer on parent node
    75         xptr_t              children[4];         // extended pointers on children nodes
     79        xptr_t              children[2][2];      // extended pointers on children nodes
    7680}
    7781dqdt_node_t;
     
    7983
    8084/****************************************************************************************
    81  * This local function initializes the local DQDT structures.
    82  * The information describing the hardware platform topology and the cluster
    83  * indexing policy is defined by the three arguments below.
    84  * This initialisation is done in parallel, locally in each cluster, because the DQDT
    85  * is allocated as a global variable in the cluster_manager, and the local addresses
     85 * This function recursively initializes the DQDT structure from informations
     86 * stored in cluster manager (x_size, y_size and cluster_info[x][y].
     87 * It is executed in all clusters by the local CP0, to compute level_max and register
     88 * the DQDT root node in each cluster manager, but only CPO in cluster 0 build actually
     89 * the quad-tree covering all active clusters.
     90 * This initialisation can use remote_accesses, because the DQDT nodes are
     91 * allocated as global variables in the cluster_manager, and the local addresses
    8692 * are identical in all clusters.
    87  ****************************************************************************************
    88  * @ x_size   : number of clusters (containing memory and CPUs) in a row
    89  * @ y_size   : number of clusters (containing memory and CPUs) in a column
    90  * @ return the number of levels in quad-tree.
    9193 ***************************************************************************************/
    92 uint32_t dqdt_init( uint32_t x_size,
    93                     uint32_t y_size );
     94void dqdt_init( void );
    9495
    9596/****************************************************************************************
Note: See TracChangeset for help on using the changeset viewer.