Changeset 610 for trunk/kernel/mm/mapper.h
- Timestamp:
- Dec 27, 2018, 7:38:58 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/kernel/mm/mapper.h
r606 r610 45 45 * - The leaves are pointers on physical page descriptors, dynamically allocated 46 46 * in the local cluster. 47 * - In a given cluster, a mapper is a "private" structure: a thread accessing the mapper48 * must be running in the cluster containing it (can be a local thread or a RPC thread).49 * - The mapper is protected by a blocking "rwlock", to support several simultaneous50 * readers, and only one writer. This lock implement a busy waiting policy.51 * - The mapper_get_page() function that return a page descriptor pointer from a page52 * index in file is in charge of handling the miss on the mapper cache.47 * - The mapper is protected by a "remote_rwlock", to support several simultaneous 48 * "readers", and only one "writer". 49 * - A "reader" thread, calling the mapper_remote_get_page() function to get a page 50 * descriptor pointer from the page index in file, can be remote (running in any cluster). 51 * - A "writer" thread, calling the mapper_handle_miss() function to handle a page miss 52 * must be local (running in the mapper cluster). 53 53 * - The vfs_mapper_move_page() function access the file system to handle a mapper miss, 54 54 * or update a dirty page on device. 55 * - The vfs_mapper_load_all() functions is used to load all pages of a given file56 * or directory into the mapper.55 * - The vfs_mapper_load_all() functions is used to load all pages of a directory 56 * into the mapper (prefetch). 57 57 * - the mapper_move_user() function is used to move data to or from an user buffer. 58 58 * This user space buffer can be physically distributed in several clusters. … … 137 137 138 138 /******************************************************************************************* 139 * This function move data between a local mapper, and a distributed user buffer.140 * It must be called by a thread running in cluster containing the mapper.139 * This function move data between a remote mapper, dentified by the <mapper_xp> argument, 140 * and a distributed user buffer. It can be called by a thread running in any cluster. 141 141 * It is called by the vfs_user_move() to implement sys_read() and sys_write() syscalls. 142 142 * If required, the data transfer is split in "fragments", where one fragment contains … … 144 144 * It uses "hal_uspace" accesses to move a fragment to/from the user buffer. 145 145 * In case of write, the dirty bit is set for all pages written in the mapper. 146 * The mapper being an extendable cache, it is automatically extended when required 147 * for both read and write accesses. 146 * The mapper being an extendable cache, it is automatically extended when required. 148 147 * The "offset" field in the file descriptor, and the "size" field in inode descriptor 149 148 * are not modified by this function. 150 149 ******************************************************************************************* 151 * @ mapper : localpointer on mapper.150 * @ mapper_xp : extended pointer on mapper. 152 151 * @ to_buffer : mapper -> buffer if true / buffer -> mapper if false. 153 152 * @ file_offset : first byte to move in file. … … 156 155 * returns O if success / returns -1 if error. 157 156 ******************************************************************************************/ 158 error_t mapper_move_user( mapper_t * mapper,157 error_t mapper_move_user( xptr_t mappe_xp, 159 158 bool_t to_buffer, 160 159 uint32_t file_offset,
Note: See TracChangeset
for help on using the changeset viewer.