This application claims priority to Korean Patent Application No. 10-2007-0015089, filed on Feb. 13, 2007, in the Korean Intellectual Property Office, the disclosure of which is incorporated herein in its entirety by reference.
1. Technical Field
The present invention relates to a buffer cache, and more particularly, to a method of operating a buffer cache of a storage device including a flash memory.
2. Discussion of the Related Art
Application storage devices, including flash memory, are being developed to quickly operate semiconductor devices. Such application storage devices include Solid State Disks (SSDs), Hybrid Hard Disk Drives (HDDs), etc.
Referring to
The flash memory uses a read/write unit which is different from that used in other forms of memory or interfaces. Data is read from or written to a conventional hard disk in units of sectors; however, data is read from or written to a flash memory in units of pages. Flash memory requires an erase operation prior to a write operation. The flash memory performs the erase operation in units of blocks, each block consisting of a plurality of pages.
Due to the characteristics of flash memory, a storage system including a flash memory requires a software module for efficiently managing the flash memory. Hereinafter, a software module for managing a flash memory is called a Flash Translation Layer (FTL).
Referring to
However, again returning to
The storage device converts a logical block address LBA which is transmitted from the host through the FTL, into a physical block address. The logical block address LBA then represents a sector of an Advanced Technology Attachment (ATA) interface or a Serial Advanced Technology Attachment (ATAT) interface.
In order to perform an address conversion process, a conventional storage device (or a conventional FTL) determines whether a page including a sector corresponding to a logical block address requested by a host is located in a DRAM buffer cache. In order to recognize where the page is located, the conventional storage device searches the DRAM buffer cache.
However, a long time is required to search the DRAM buffer cache and this delay can reduce the performance of the storage device. As the number of pages of the flash memory increases and the capacity of the DRAM buffer cache increases, time required to search the DRAM buffer cache further increases. Accordingly, a method of efficiently operating a DRAM buffer cache of a storage device including a flash memory is needed.
Exemplary embodiments of the present invention provide a method of efficiently operating a DRAM buffer cache of a storage device including a flash memory.
According to an aspect of the present invention, a buffer cache operating method is provided for a storage device including a flash memory. The method includes converting a logical block address requested from a host into a logical page number, searching for a region in which a page corresponding to the logical page number is located, and generating a physical block address corresponding to the logical block address, with reference to a mapping table of the region in which the page corresponding to the logical page number is located. Searching the region in which the page corresponding to the logical page number is located includes searching for a look-up table having information about a region in which a plurality of pages of the flash memory are located.
The region in which the page corresponding to the logical page number may be located is the flash memory or a buffer cache.
The look-up table may have a plurality of entries, the number of the plurality of entries corresponds to the number of the plurality of pages of the flash memory.
Each entry of the look-up table may have at least one bit of residence information indicating a region in which a page corresponding to the each entry is located.
The residence information may have a 1-bit value indicating where the page corresponding to the each entry is located in either the flash memory or the buffer cache.
The residence information may have a 2-bit value indicating where the page corresponding to the each entry is located in a log block or a data block of the flash memory, or in the buffer cache.
The residence information may further include information indicating whether the page corresponding to the each entry is located in both the buffer cache and the log block.
The searching for the region, in which the page corresponding to the logical page number is located, may include searching an index of a look-up table corresponding to the logical page number, determining the region in which the page corresponding to the logical page number is located, on the basis of residence information stored in corresponding index, and when the page corresponding to the logical page number is located in the buffer cache, generating the physical block address with reference to a mapping table of the buffer cache.
The generating of the physical block address with reference to the mapping table of the buffer cache, may include searching an index of the buffer cache in which the page corresponding to the logical page number is located, with reference to a cache logical page number table having a list of a plurality of logical page numbers for a plurality of pages which are located in the buffer cache, and associating a sector offset of the logical block address with the searched index, thereby generating the physical block address.
The searching for of the index of the buffer cache may include setting the requested logical page number, performing bit masking on the set logical page number, comparing the logical page number subjected to bit masking with the plurality of logical page numbers of the cache logical page number table, and searching an index having the same logical page number as the logical page number subjected to bit masking, from the cache logical page number table, and searching for the physical block address of the buffer cache corresponding to the index of the cache logical page number table.
Each entry of the cache logical page number table may correspond to each entry of the buffer cache.
Each entry of the cache logical page number table may include a first field storing a logical page number of a page located in an entry of the buffer cache corresponding to the each entry, and a second field storing page status information for the page corresponding to the logical page number of the first field.
The page status information may indicate whether data stored in the page corresponding to the logical page number is equal to the contents of the flash memory.
The generating of the physical block address with reference to the mapping table of the buffer cache may further include determining a region in which a sector corresponding to a sector offset of the logical block address is located.
The searching for of the region in which the page corresponding to the logical page number is located may further include generating the physical block address with reference to the mapping table of the flash memory if the page corresponding to the logical page number is located in the flash memory.
The generating of the physical block address with reference to the mapping table of the flash memory may further include generating the physical block address with reference to a data block mapping table, when the page corresponding to the logical page number is located in a data block of the flash memory.
The generating of the physical block address with reference to the mapping table of the flash memory may further include generating the physical block address with reference to a log block mapping table, when the page corresponding to the logical page number is located in a log block of the flash memory.
The logical block address may include a logical block number, a page offset, and a sector offset.
The logical page number may include the logical block number and the page offset.
The host may transmit the logical block address through an Advanced Technology Attachment (ATA) interface or a Serial Advanced Technology Attachment (SATA) interface.
The buffer cache may be a DRAM.
The flash memory may be a NAND flash memory.
The above and other features of the exemplary embodiments of the present invention will be described in detail with reference to the attached drawings, in which:
The above and other features and aspects of the exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings, in which:
Referring to
If the storage device receives a logical block address LBA, the storage device converts the logical block address LBA into a logical page number (step S320). Then, the storage device generates a physical block address corresponding to the logical block address LBA, with reference to a mapping table which is stored in a region in which a page corresponding to the logical page number is located (step S330). Here, the region in which the page corresponding to the requested logical page number is located may be a flash memory or a DRAM buffer cache.
Then, a read/write operation is performed on the physical block address (step S340). Hereinafter, a buffer cache operating method in which the storage device including the flash memory efficiently searches for a DRAM buffer cache, using information about the region in which the page corresponding to the logical page number is located, will described in detail.
Referring to
The logical block number LBN is a logical address indicating a block of a flash memory, the page offset PageOffset is page identification information of the corresponding block, and the sector offset SecOffset is sector identification information of the corresponding page. Accordingly, a logical page number LPN is represented by the logical block number LBN and the page offset PageOffset.
In the buffer cache operation method S330, in order to search for the region in which the page is located, a logical page number LPN is searched from a lookup table 410 ((1) of
The lookup table 410 has a plurality of entries, wherein the number of entries is equal to the number of pages of the flash memory. The lookup table 410 stores location information of each page. Each index of the lookup table 410 corresponds to a logical page number LPN of each page. Accordingly, the corresponding index of the lookup table 410 can be searched for using the logical block address LBA. For example, if the logical page number LPN of
The lookup table 410 stores information about a region in which the corresponding page is located, as residence information Rbits. The residence information Rbits can have a 1-bit value indicating that the corresponding page is located in a flash memory (not shown) or a DRAM buffer cache 440. For example, the 1 bit of residence information Rbits can be stored as “1” if the page is located in the flash memory, and stored as “0” when the page is located in the DRAM buffer cache 440.
Also, the residence information Rbits can represent a block location of the page in the flash memory. That is, the residence information Rbits can have a 2-bit value indicating that the page is located in a log block, a data block of the flash memory or the DRAM buffer cache 440.
For example, the 2 bits of residence information Rbits can be stored as “01” if the corresponding page is located in a log block of the flash memory, stored as “11” if the corresponding page is located in a data block of the flash memory, and stored “00” if the corresponding page is located in the DRAM buffer cache 440.
Furthermore, the 2 bits of residence information Rbits can represent whether the page is located in both the DRAM buffer cache 440 and the log block of the flash memory. For example, the 2 bits of residence information Rbits can be stored as “10” if the page is located in both the DRAM buffer cache and the log block of the flash memory. A flowchart of a buffer cache operating method using residence information, according to an embodiment of the present invention, is shown in
Hereinafter, a case where a page corresponding to a requested logical page number is located only in the DRAM buffer cache 440 is described. A case where a page corresponding to a requested logical page number is located in a different place except for the DRAM buffer cache 440, for example, a case where the corresponding page is located in the log block or the data block of the flash memory will be described later. Additionally, a case where the corresponding page is located in both the DRAM cache buffer 440 and the flash memory, will be described later.
Again returning to
Referring to
The cache logical page number table 420 has a list of logical page numbers for pages located in the DRAM buffer cache 440. Each entry of the cache logical page number table 420 corresponds to each entry of the DRAM buffer cache 440.
For example, a logical page number LPN corresponding to a first entry of the DRAM buffer cache 440 is stored in a first index of the cache logical page number table 420. Likewise, a logical page number LPN corresponding to a second entry of the DRAM buffer cache 440 is stored in a second index of the cache logical page number table 420.
Referring to
A hardware search engine (for example, a comparator) can be used to search for the index of the DRAM buffer cache 440 (step S333-1).
Referring to
The logical page number LPN subjected to bit masking is sequentially compared with logical page numbers located at respective entries of the cache logical page number table 420, by a comparison logical device (not shown) of the comparator comp (step S333-1c). Then, an address of the buffer cache 440 at which a page corresponding to the requested logical page number LPN is located, is searched for from an index of the cache logical page number table 420 at which a logical page number equal to the logical page number LPN subjected to bit masking is located (step 333-1d).
In the comparator comp, a pointer register PTR stores an index of a first entry of the DRAM buffer cache 440, and a count register stores the number of entries of the DRAM buffer cache 440. A table region that is to be searched for is set by the pointer register PTR and the count register.
In this way, an index of the cache logical page number table 420 is obtained. An address corresponding to a sector offset of a physical address of a DRAM corresponding to the index of the DRAM buffer cache 420 is a physical block address (a sector address) of the request logical block address ((3) of
Referring to
The buffer cache operating method 300 can further include determining a region in which a sector corresponding to the sector offset SecOffset of the logical block address LBA is located, using a sector bit map table of
Again referring to
The page status information may be information regarding whether data stored in the corresponding page is equal to the contents of the flash memory. That is, when a write operation is performed on the DRAM buffer cache according to a write request to the storage device, the page status information indicates whether data stored in the corresponding page must be transmitted later to the flash memory. The page status information is stored as “1” when data stored in the corresponding page is equal to the contents of the flash memory, and stored as “0” when the data stored in the corresponding page is different from the contents of the flash memory.
A case where the page corresponding to the requested logical block number is located in the DRAM buffer cache 440 has been described above. Hereinafter, a case where the page corresponding to the requested logical block number is located in the log block or the data block of the flash memory, or in both the DRAM cache buffer 440 and the flash memory, will be described.
Again referring to
In the current embodiment, if residence information is “11,” for example, if the page corresponding to the logical page number is located in the data block of the flash memory, the physical block address is generated with reference to a data block mapping table (step S330b-5 of
If the residence information is “10,” for example, if the page corresponding to the logical page number is located in both the DRAM buffer cache and the log block of the flash memory, the physical page address is generated with reference to a page mapping table of the flash memory (step S330b-8 of
Again referring to
As describe above, since a buffer cache operating method which is performed by a storage device including a flash memory, according to at least one embodiment of the present invention, uses a lookup table having location information regarding a region in which a page is located, and includes an efficient DRAM buffer cache search algorithm for the flash memory, it is possible to significantly improve the operating characteristic of the storage device including the flash memory.
While exemplary embodiments of the present invention have been particularly shown and described, it will be understood by those of ordinary skill in the art that various changes in form and details may be made therein without departing from the spirit and scope of the present invention.
Number | Date | Country | Kind |
---|---|---|---|
10-2007-0015089 | Feb 2007 | KR | national |