Changeset 23 for trunk/kernel/kern/cluster.h
- Timestamp:
- Jun 18, 2017, 10:06:41 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/kern/cluster.h
r19 r23 4 4 * authors Ghassan Almaless (2008,2009,2010,2011,2012) 5 5 * Mohamed Lamine Karaoui (2015) 6 * Alain Greiner (2016 )6 * Alain Greiner (2016,2017) 7 7 * 8 8 * Copyright (c) UPMC Sorbonne Universites … … 49 49 struct core_s; 50 50 struct process_s; 51 struct device_s;52 51 53 52 … … 56 55 * For any process P, the process descriptor is replicated in all clusters containing 57 56 * at least one thread of process P, but only the "reference" cluster descriptor contains 58 * the reference (complete) structures such as the GPT, the VSL, or the FDT. 59 * The "owner" cluster is in charge to allocate a lpid (local process index), 60 * for all process owned by a cluster K, and to register the "reference" cluster for 61 * all process owned by K. 57 * the reference (complete) GPT, VSL, and FDT structures. 58 * The "owner" cluster K is in charge to allocate a lpid (local process index), 59 * to the owned processes, and to register the "reference" cluster for these processes. 62 60 * 63 61 * Warning : the "owner" cluster, and the "reference" cluster can be different clusters. 64 62 * 65 63 * The process manager of a cluster K maintains three structures: 66 * 1) The pref_tbl[] is an array indexed by lpid , for all processes owned by cluster K.64 * 1) The pref_tbl[] is an array indexed by lpid. There is one entry per owned process. 67 65 * Each entry contains an extended pointer on the reference process descriptor. 66 * 68 67 * 2) The local_root is the root of the local list of process descriptors in cluster K. 69 68 * A process descriptor P is present in K, as soon as P has a thread in cluster K. 70 * 3) The copies_root[] array is indexed by lpid. Each entry contains the root of 71 * the xlist of copies for a given process owned by cluster K. 69 * 70 * 3) The copies_root[] array is indexed by lpid. There is one entry per owned process, 71 * and each each entry contains the root of the xlist of copies for this process. 72 72 ******************************************************************************************/ 73 73 … … 78 78 uint32_t pref_nr; /*! number of processes owned by cluster */ 79 79 80 list_entry_tlocal_root; /*! root of list of process in cluster */81 spinlock_tlocal_lock; /*! lock protecting access to local list */80 xlist_entry_t local_root; /*! root of list of process in cluster */ 81 remote_spinlock_t local_lock; /*! lock protecting access to local list */ 82 82 uint32_t local_nr; /*! number of process in cluster */ 83 83 … … 96 96 typedef struct cluster_s 97 97 { 98 spinlock_t kcm_lock; /*! local, protect creation of KCM allocators*/98 spinlock_t kcm_lock; /*! local, protect creation of KCM allocators */ 99 99 100 100 // global parameters 101 101 102 uint32_t paddr_width; /*! numer of bits in physical address*/103 uint32_t x_width; /*! number of bits to code x_size (can be 0)*/104 uint32_t y_width; /*! number of bits to code y_size (can be 0)*/105 uint32_t x_size; /*! number of clusters in a row (can be 1)*/106 uint32_t y_size; /*! number of clusters in a column (can be 1)*/107 cxy_t io_cxy; /*! io cluster identifier*/108 uint32_t dqdt_root_level; /*! index of root node in dqdt_tbl[]*/102 uint32_t paddr_width; /*! numer of bits in physical address */ 103 uint32_t x_width; /*! number of bits to code x_size (can be 0) */ 104 uint32_t y_width; /*! number of bits to code y_size (can be 0) */ 105 uint32_t x_size; /*! number of clusters in a row (can be 1) */ 106 uint32_t y_size; /*! number of clusters in a column (can be 1) */ 107 cxy_t io_cxy; /*! io cluster identifier */ 108 uint32_t dqdt_root_level; /*! index of root node in dqdt_tbl[] */ 109 109 110 110 // local parameters 111 111 112 uint32_t cores_nr; /*! number of cores in cluster*/113 uint32_t cores_in_kernel; /*! number of cores currently in kernel mode*/112 uint32_t cores_nr; /*! number of cores in cluster */ 113 uint32_t cores_in_kernel; /*! number of cores currently in kernel mode */ 114 114 115 115 core_t core_tbl[CONFIG_MAX_LOCAL_CORES]; /*! embedded cores */ 116 116 117 ppm_t ppm; /*! embedded kernel page manager*/118 khm_t khm; /*! embedded kernel heap manager*/119 kcm_t kcm; /*! embedded kernel cache manager (for KCMs)*/117 ppm_t ppm; /*! embedded kernel page manager */ 118 khm_t khm; /*! embedded kernel heap manager */ 119 kcm_t kcm; /*! embedded kernel cache manager (for KCMs) */ 120 120 121 121 kcm_t * kcm_tbl[KMEM_TYPES_NR]; /*! pointers on allocated KCMs */ 122 122 123 uint32_t ram_size; /*! physical memory size */ 124 uint32_t ram_base; /*! physical memory base (local address) */ 125 126 rpc_fifo_t rpc_fifo; /*! cluster RPC fifo (shared) */ 127 list_entry_t devlist; /*! root of list of devices in cluster */ 128 struct device_s * icu; /*! pointer on local XCU device */ 129 130 int32_t pages_var; /*! pages number increment from last update */ 131 int32_t threads_var; /*! threads number increment from last update */ 123 uint32_t ram_size; /*! physical memory size */ 124 uint32_t ram_base; /*! physical memory base (local address) */ 125 126 rpc_fifo_t rpc_fifo; /*! cluster RPC fifo (shared) */ 127 list_entry_t devlist; /*! root of list of devices in cluster */ 128 129 int32_t pages_var; /*! pages number increment from last DQQT update */ 130 int32_t threads_var; /*! threads number increment from last DQDT update */ 132 131 133 132 dqdt_node_t dqdt_tbl[CONFIG_MAX_DQDT_DEPTH]; /*! embedded DQDT nodes */ 134 133 135 pmgr_t pmgr; /*! embedded process manager*/134 pmgr_t pmgr; /*! embedded process manager */ 136 135 137 136 char name[CONFIG_SYSFS_NAME_LEN]; … … 192 191 /****************************************************************************************** 193 192 * This function returns an extended pointer on the reference process descriptor 194 * from the process PID. It can be called by any thread running in any cluster,195 * as it uses a RPC to the owner cluster if the current cluster is not the owner.193 * from the process PID. This PID can be be different from the calling thread process. 194 * It can be called by any thread running in any cluster, 196 195 ****************************************************************************************** 197 196 * @ pid : process identifier. 198 * @ return extended pointer on the reference process descriptor.197 * @ return extended pointer on reference process if success / return XPTR_NULL if error. 199 198 *****************************************************************************************/ 200 199 xptr_t cluster_get_reference_process_from_pid( pid_t pid );
Note: See TracChangeset
for help on using the changeset viewer.