Changes between Initial Version and Version 1 of file_system


Ignore:
Timestamp:
May 26, 2015, 7:59:25 PM (9 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • file_system

    v1 v1  
     1= GIET_VM / FAT32 File System =
     2
     3[[PageOutline]]
     4
     5This section describes  GIET_VM [wiki:library_stdio system calls] and [wiki:user_libraries user libraries]. The multi-threaded applications have been designed to analyse the TSAR manycore architecture scalability.
     6
     7== General Principles ==
     8
     9This implementation supports only block devices with block_size = 512 bytes.
     10
     11In the context of the FAT32, a cluster is the smallest storage allocation unit on the block device : any file  (or directory) occupies at least one cluster, and one cluster cannot be shared by 2 different files.
     12
     13This implementation supports only one cluster_size = 4 Kbytes (i.e. 8 blocks).
     14
     15The FAT region on the block device is an array of 32 bits words defining the linked list of clusters allocated to given file in the DATA region of the block device.
     16Each slot in this array contains a cluster_ptr, that is the index of cluster on the block device. The cluster_ptr value cannot be larger than 0x0FFFFFFF (i.e. 256 M). The max addressable storage capacity on the block device is therefore (256 M * 4 Kbytes) = 1 Tbytes.
     17
     18This implementation uses memory caches implemented in the distributed kernel heap.
     19There is actually one cache per file (called '''file_cache'''), and one cache for the FAT itself (called '''fat_cache''').
     20
     21== Cache Structure ==
     22
     23The fat_cache and the file_cache have the same organisation.
     24Each cache contains an integer number of clusters, as the cluster is the smallest unit of data that can be
     25loaded from the block device to the cache. To reduce the access time, this set of clusters is organized as 
     26a 64-Tree: each node has one single parent and (up to) 64 children. The leaf nodes are the cluster descriptors.
     27To access a given cluster in a given file, we use the cluster_id (index of cluster inside the file), that is different
     28from the cluster_ptr  index of cluster on the block device. This cluster_id must be split in pieces
     29of 6 bits, that are used to access the proper children at a given level in the 64-Tree.
     30The depth (number of levels) of the 64-Tree depends on the file size :
     31||  File Size                                  || levels  ||
     32|| up to 256 Kbytes                      ||  1        ||
     33|| from 256 Kbytes to 16 Mbytes  ||  2       ||
     34|| from 16 Mbytes to 1 Gbytes     ||  3       ||
     35|| larger than 1 Gbytes                 ||  4       ||
     36
     37== Cache Write Policy ==
     38
     39For a '''file_cache''', the GIET_VM implements a WRITE-BACK policy. The data are always modified in the cache. In case of miss, new clusters are allocated to the target file, the cache is updated from the block device, and the data are modified in the cache, but not in the block device. The modified clusters are written on the block device only when the file is closed, using the dirty flag implemented in each cluster descriptor.
     40
     41For the '''fat_cache''', the GIET_VM implements a WRITE-THROUGH policy. When the FAT content is modified
     42(i.e. when new clusters are allocated to an existing file, or when a new file (or directory) is created, the modifications are written in the fat_cache (that must be updated in case of miss), and are immediately reported to the block device,
     43for each modified block.
     44
     45== Block Device Drivers ==