1. Field of the Invention
The present invention is related to a caching device, and more particularly related to the caching device for file systems used in storage systems.
2. Related Art
As a device for speeding accesses of memories or disks, a cache can copy the data from lower-speed storage devices (ex. disks) to higher-speed storage devices (ex. memories) to perform writing or reading commands so as to speed up the responses of systems.
The caching operation is basically deployed by using higher-speed storage devices in which retains a copy of data copied from lower-speed storage devices to allow readings or writings performed first on the higher-speed storage devices when it is required to read or write data from the lower-speed storage devices, and thus to speed up the responses of systems.
For example, a random access memory (RAM), which constitutes the main memory of a computer system, is running much faster than a disk so that the RAM memory can be partly used to be a cache of the disk. While reading the data of the disk, a copy of the read data will be stored in the cache. If the system repeats requests to read or write the same data or sectors which are already stored on the cache, the system can directly execute reading or writing actions on the cache memory instead. This method can improve the accessing speed of the system.
Regarding a storage system, a cache is also able to be used to its file systems to improve the overall performance of the system. The relationship between a storage system and a file system will be described in advance. A storage system can contain multiple physical storage devices, such as hard disk drives. The multiple physical storage devices can constitute one or more logical drives, and each logical drive can be further partitioned into multiple partitioned logical drives. Every logical drive has one file system in case of no further partition happened thereon. Oppositely, when the logical drive is partitioned into multiple partitioned ones, every partitioned logical drives also has its own file system. Therefore, a single storage system may include one or more file systems.
However, the cache arrangement in
For the forging reasons, it is a significant issue to design a new cache arrangement applied for file systems without the negative influence on the performance thereof.
The main object of the present invention is to provide a cache device for a storage system and its file system to improve the accessing performance of the systems.
The cache device provided according to a feature of the present invention is used in a file system, and the cache device comprises a data cache unit used to temporarily store regular data, and a plurality of dedicated cache units that are used to store various types of special data whereby an influence of the renewing of the data cache unit on the special data in the dedicated cache units is reduced.
The cache device provided according to another feature of the present invention is used in a file system, and the cache device comprises a first cache unit used to temporarily store the regular data, a second cache unit used to temporarily store first special data, and a third cache unit used to temporarily store second special data whereby an influence of the renewing of the first cache unit on the special data is reduced. Wherein the first cache unit has a size larger than the sum of the second cache unit and the third cache unit.
The storage system provided according to a further feature of the present invention comprises a plurality of storage devices, in which each has at least one file system using a data cache unit to temporarily store regular data, and a plurality of dedicated cache units, which are used to respectively temporarily store a plurality of special data, whereby an influence of the renewing of the data cache unit on the special data in the dedicated cache units is reduced.
The storage system provided according to a further feature of the present invention comprises a plurality of storage devices, in which each has at least one file system using a first cache unit to temporarily store regular data, a second cache unit, which is used to temporarily store first special data, and a third cache unit, which is used to temporarily store second special data, whereby an influence of the renewing of the first cache unit on the special data is reduced. Wherein the first cache unit has a size larger than the sum of the second cache unit and the third cache unit.
The storage system provided according to a further feature of the present invention comprises at least one low-speed storage device, at least one high-speed storage device and a host. Wherein, the low-speed storage device stores a plurality of file data and each the file data has regular data and a variety of metadata; the high-speed storage device has a data cache unit used to temporarily store regular data, and a plurality of dedicated cache units corresponding to different metadata, are respectively used to temporarily store the metadata; and, the host is used to execute the storing operations of the storage devices. When the host reads a file data from the low-speed storage device, the regular data of the file data will be stored in the data cache unit and the metadata will be temporarily stored in the corresponding dedicated cache units.
The storage system provided according to a further feature of the present invention comprises at least one low-speed storage device, at least one high-speed storage device and a host. Wherein, the low-speed storage device has at least one file system and stores a plurality of file data and each the file data has regular data and a variety of metadata; the high-speed storage device comprises a first data cache unit used to temporarily store regular data, and a second cache unit and a third cache unit respectively used to temporarily store first special data and second special data; and, the host is used to execute the storing operations of the storage devices. When the host reads a file data from the low-speed storage device, the regular data of the file data will be stored in the first data cache unit and the first special data and the second special data will be temporarily stored in the corresponding second cache unit and third cache unit. The first cache unit has a size larger than the sum of the second cache unit and the third cache unit.
The present invention partitions a disk cache in a file system into a plurality of cache units including a data cache unit used to temporarily store regular data and a plurality of dedicated cache units used to temporarily store special data, and the data cache unit and the dedicated cache units support a write-back caching function; it is for the sake of avoiding the loss of the special data owing to accessing the regular data when a storage system frequently accesses the data of the file system or accesses large files thereof, in order to increase the accessing performance of the system.
Regarding the preferred embodiment of the present invention, please refer to
A file system comprises one or more regular data and a plurality of metadata. Parts of the metadata are used to describe the file system, termed “file-system metadata”, and the other parts of the metadata are used to describe file data, termed “file-data metadata”. Each of the file data is composed of the file-data metadata and the regular data so that it is possible to access both the file-system metadata and the regular data while accessing the file data.
The metadata mentioned above can be the metadata of, for example, a super block, an AG (allocation group) header, an Inode (index node), a free space map list header, a file tree meta-page, a directory tree meta-page, and a directory index. The super block and the AG header are used to describe the file system retaining them, and the rest, namely the Inode, the free space map list header, the file tree meta-page, the directory tree meta-page, and the directory index, are used to describe the file data of the file system. Of course, the names and types of metadata in different file systems may differ from each other. For example, metadata in UNIX systems further comprises a direct block, a double indirect block, and an Inode file block etc.
The super block is used to record the integral data about the logical disks 231, 232, such as the data of the size and the amount of data blocks in the logical disks 231, 232. Usually, logical disks 231, 232 can be further partitioned into a plurality of group areas in order to store files having low correlation to each other in different group areas; each group area has a corresponding AG header. Inode is used to record the properties of the file data and locations of data blocks that the file data is distributed. The free space map list header is a header used to indicate the free space map list of the free data blocks in a file system. The file tree meta-page has a plurality of block indexes to index the data blocks storing regular data.
The regular data and the metadata in the file system are stored in the logical disk corresponding to the file system. Referring to
Therefore, when the regular data and the metadata have been stored in the corresponding cache units, the host 21 can directly find and access certain metadata, for example, the AG header from the AG header cache 2222 rather then from the disk drives with slower running speed. As the host 21 reads a large file, the regular data cache 221 in the controller 20 could be frequently updated for temporarily storing the coming regular data, but the dedicated cache unit 42 may not be renewed or just partially updated, so as to reduce the situations of losing metadata that originally exists in the dedicated cache unit 42.
If the host 21 intends to modify files in the file system, the regular data and parts of the metadata stored in the file system could be modified. Therefore, the host 21 will temporarily store the regular data and the parts of metadata being modified in the disk cache 2 in order to update the regular data cache 221 and parts of the dedicated cache 222 and then write the modified data into the disk drive by way of the disk cache 2. In this embodiment, the disk cache 2 supports a write-back caching function, which is, when the host 21 writes updated data, the data to be modified will be temporarily stored in the regular data cache 221 and the dedicated cache 222 of the disk cache 2 rather than directly written into the disk drive and then, marking the updated data as “Dirty.”. The updated data will be really written into the disk drive when the storage system 2 is available or certain duration is due. Therefore, the performance of the system will be improved.
The dedicated cache mentioned above is sorted by types. The dedicated cache could be turned into at least two types of dedicated cache units in light of different file systems and system requirements. Of course, while applying to different file systems, the names of the dedicated cache units and the objects to be temporarily stored may change, but the nature of the dedicated cache units remains, storing metadata, not the regular data.
Therefore, when the host 21 reads the regular data and the metadata of the file system 2311, the regular data will be temporarily stored in the regular data cache 41 and the other relative metadata will be temporarily stored in the corresponding dedicated cache units according to its size. For example, the super block and the AG header will be temporarily stored in the first dedicated cache unit 421 because their sizes are 512 bytes; Inode will be temporarily stored in the second dedicated cache unit 422 because its sizes is 1 K bytes; the free space map list header will be temporarily stored in the third dedicated cache unit 423 because its sizes is 2 K bytes; the file tree meta-page will be temporarily stored in the fourth dedicated cache unit 424 because its sizes is 4 K bytes; the directory tree meta-page will be temporarily stored in the fifth dedicated cache unit 425 because its sizes is 6 K bytes; and the directory index will be temporarily stored in the sixth dedicated cache unit 426 because its sizes is 8 K bytes.
Therefore, in this preferred embodiment, when the regular data and the metadata have been temporarily stored in the corresponding cache units, in case that the host 21 intends to read certain metadata (for example, the AG header) of the file system by way of the controller 20 again, the certain metadata can be directly found and read in the dedicated data cache 42 (for example, the first dedicated cache unit 421) of the controller 20, rather than by the disk drive of slower speed. Thus, when the host 21 reads a larger file by way of the controller 20, the regular data cache 221 could be frequently renewed to temporarily store the read regular data, but the dedicated data cache 42 may not or just partially be renewed so as to reduce the situation of losing metadata that is originally existed in the dedicated data cache 42. Similarly, when the host 21 intends to modify file data, only a part of relative dedicated data cache 42 will be renewed. Consequently, the embodiment can reduce the coupling between the regular data cache 41 and the dedicated data cache 42 so that the performance of the system is improved.
Of course, in other embodiments, the sizes of the dedicated cache units 421, 422, 423, 424, 425, 426 can be configured according to the metadata of different file systems, and the quantities thereof can be changed as well according to different file systems.
Generally, the total volume of the cache units provided in a data storage system is restricted by the physical arrangement of hardware. Therefore, the increase of the deployed volume of the dedicated cache units may result in the decrease of the deployed volume of the data cache unit. However, the dedicated cache units only occupy a small part of the total volume and, oppositely, the data cache unit is in the majority (for example, the dedicated cache units have less than 5% and the data cache unit is 95% stronger), so the increase of the dedicated cache units will not influence the volume deployment of the data cache unit a lot. To be concluded, the present invention provides a plurality of dedicated cache units in the storage system for respectively storing specific metadata so that the metadata frequently used will not be lost owing to the update of the regular data, and it greatly reduces the possibilities of accessing the slow storage devices, such as hard disk drives so as to effectively improve the performance of the system.
It will be apparent to those skilled in the art that various modifications and variations can be made to the structure of the present invention. In view of the forgoing, it is intended that the present invention covers modifications and variations of this invention provided they fall within the scope of the following claims and their equivalents.
Number | Date | Country | |
---|---|---|---|
60521838 | Jul 2004 | US |