Changeset 629 for trunk/kernel/mm/vmm.h
- Timestamp:
- May 17, 2019, 9:27:04 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/vmm.h
r625 r629 106 106 * 3. The GPT in the reference cluster can be directly accessed by remote threads to handle 107 107 * false page-fault (page is mapped in the reference GPT, but the PTE copy is missing 108 * in the local GPT). It is also protected by a remote_rwlock. 108 * in the local GPT). As each PTE can be protected by a specific GPT_LOCKED attribute 109 * for exclusive access, it is NOT protected by a global lock. 109 110 ********************************************************************************************/ 110 111 … … 115 116 uint32_t vsegs_nr; /*! total number of local vsegs */ 116 117 117 remote_rwlock_t gpt_lock; /*! lock protecting the local GPT */118 118 gpt_t gpt; /*! Generic Page Table (complete in reference) */ 119 119 … … 165 165 * This function is called by the process_make_fork() function. It partially copies 166 166 * the content of a remote parent process VMM to the local child process VMM: 167 * - AllDATA, ANON, REMOTE vsegs registered in the parent VSL are registered in the167 * - The DATA, ANON, REMOTE vsegs registered in the parent VSL are registered in the 168 168 * child VSL. All valid PTEs in parent GPT are copied to the child GPT, but the 169 169 * WRITABLE flag is reset and the COW flag is set. 170 * - AllCODE vsegs registered in the parent VSL are registered in the child VSL, but the170 * - The CODE vsegs registered in the parent VSL are registered in the child VSL, but the 171 171 * GPT entries are not copied in the child GPT, and will be dynamically updated from 172 172 * the .elf file when a page fault is reported. 173 * - AllFILE vsegs registered in the parent VSL are registered in the child VSL, and all173 * - The FILE vsegs registered in the parent VSL are registered in the child VSL, and all 174 174 * valid GPT entries in parent GPT are copied to the child GPT. The COW flag is not set. 175 175 * - No STACK vseg is copied from parent VMM to child VMM, because the child stack vseg … … 186 186 187 187 /********************************************************************************************* 188 * This function is called by the process_make_fork() function executing the fork syscall.189 * It set the COW flag, and reset the WRITABLE flag of all GPT entries of the DATA, MMAP,190 * a nd REMOTE vsegs of a process identified bythe <process> argument.188 * This function is called by the process_make_fork() function to update the COW attribute 189 * in the parent parent process vsegs. It set the COW flag, and reset the WRITABLE flag of 190 * all GPT entries of the DATA, MMAP, and REMOTE vsegs of the <process> argument. 191 191 * It must be called by a thread running in the reference cluster, that contains the complete 192 192 * VSL and GPT (use the rpc_vmm_set_cow_client() when the calling thread client is remote). … … 201 201 202 202 /********************************************************************************************* 203 * This function modifies aGPT entry identified by the <process> and <vpn> arguments203 * This function modifies one GPT entry identified by the <process> and <vpn> arguments 204 204 * in all clusters containing a process copy. 205 * It must be called by a thread running in the referencecluster.206 * It updates all copies of the process in all clusters, to maintain coherence in GPT copies,207 * using the list of copies stored in the owner process, and using remote_write accesses to208 * update the remote GPTs. It cannot fail, as only mapped entriesin GPT copies are updated.205 * It must be called by a thread running in the process owner cluster. 206 * It is used to update to maintain coherence in GPT copies, using the list of copies 207 * stored in the owner process, and uses remote_write accesses. 208 * It cannot fail, as only mapped PTE2 in GPT copies are updated. 209 209 ********************************************************************************************* 210 210 * @ process : local pointer on local process descriptor. … … 373 373 * is mapped in the reference GPT, but not in the local GPT. For this false page-fault, 374 374 * the local GPT is simply updated from the reference GPT. 375 * 3) if the missing VPN is public, and unmapped in the ref erence GPT, it's a true page fault.375 * 3) if the missing VPN is public, and unmapped in the ref GPT, it is a true page fault. 376 376 * The calling thread allocates a new physical page, computes the attributes, depending 377 377 * on vseg type, and updates directly (without RPC) the local GPT and the reference GPT. 378 378 * Other GPT copies will updated on demand. 379 * Concurrent accesses to the GPT are handled, thanks to the380 * remote_rwlock protecting each GPT copy.379 * Concurrent accesses to the GPT(s) are handled, by locking the target PTE before accessing 380 * the local and/or reference GPT(s). 381 381 ********************************************************************************************* 382 382 * @ process : local pointer on local process. … … 392 392 * It returns a kernel panic if VPN is not in a registered vseg or is not mapped. 393 393 * For a legal mapped vseg there is two cases: 394 * 1) If the missing VPN belongs to a private vseg (STACK or CODE segment types, non 395 * replicated in all clusters), it access the local GPT to get the current PPN and ATTR. 394 * 1) If the missing VPN belongs to a private vseg (STACK), it access only the local GPT. 396 395 * It access the forks counter in the current physical page descriptor. 397 396 * If there is a pending fork, it allocates a new physical page from the cluster defined … … 399 398 * and decrements the pending_fork counter in old physical page descriptor. 400 399 * Finally, it reset the COW flag and set the WRITE flag in local GPT. 401 * 2) If the missing VPN is public, it access the reference GPT to get the current PPN and402 * ATTR.It access the forks counter in the current physical page descriptor.400 * 2) If the missing VPN is public, it access only the reference GPT. 401 * It access the forks counter in the current physical page descriptor. 403 402 * If there is a pending fork, it allocates a new physical page from the cluster defined 404 403 * by the vseg type, copies the old physical page content to the new physical page, … … 406 405 * Finally it calls the vmm_global_update_pte() function to reset the COW flag and set 407 406 * the WRITE flag in all the GPT copies, using a RPC if the reference cluster is remote. 408 * In both cases, concurrent accesses to the GPT are protected by the remote_rwlock409 * atached to the GPT copy in VMM.407 * In both cases, concurrent accesses to the GPT are handled by locking the target PTE 408 * before accessing the GPT. 410 409 ********************************************************************************************* 411 410 * @ process : pointer on local process descriptor copy.
Note: See TracChangeset
for help on using the changeset viewer.