Changeset 582 for trunk/kernel/kern/dqdt.h
- Timestamp:
- Oct 11, 2018, 5:04:28 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/dqdt.h
r564 r582 31 31 /**************************************************************************************** 32 32 * 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. 34 34 * 35 35 * - If X_SIZE or Y_SIZE are equal to 1, it makes the assumption that the cluster … … 42 42 * - If both Y_SIZE and Y_SIZE are larger than 1, it makes the assumption that 43 43 * 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. 45 45 * 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, 47 48 * we build the smallest two dimensionnal quad-tree covering all clusters, 48 49 * 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: 52 52 * . Level 0 nodes exist on all clusters and have no children. 53 53 * . Level 1 nodes exist when both X and Y coordinates are multiple of 2 … … 56 56 * . Level 4 nodes exist when both X and Y coordinates are multiple of 16 57 57 * . 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. 60 63 ***************************************************************************************/ 61 64 … … 64 67 * The max number of children is 4, but it can be smaller for some nodes. 65 68 * 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. 67 70 ***************************************************************************************/ 71 68 72 typedef struct dqdt_node_s 69 73 { … … 73 77 uint32_t pages; // current number of pages in subtree 74 78 xptr_t parent; // extended pointer on parent node 75 xptr_t children[ 4];// extended pointers on children nodes79 xptr_t children[2][2]; // extended pointers on children nodes 76 80 } 77 81 dqdt_node_t; … … 79 83 80 84 /**************************************************************************************** 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 86 92 * are identical in all clusters. 87 ****************************************************************************************88 * @ x_size : number of clusters (containing memory and CPUs) in a row89 * @ y_size : number of clusters (containing memory and CPUs) in a column90 * @ return the number of levels in quad-tree.91 93 ***************************************************************************************/ 92 uint32_t dqdt_init( uint32_t x_size, 93 uint32_t y_size ); 94 void dqdt_init( void ); 94 95 95 96 /****************************************************************************************
Note: See TracChangeset
for help on using the changeset viewer.