This application claims the benefit of Korean Application No. 2006-114788 filed Nov. 20, 2006, in the Korean Intellectual Property Office, the disclosure of which is incorporated herein by reference.
1. Field of the Invention
Aspects of the present invention relate to a nonvolatile memory, and more particularly to an apparatus and method of managing a nonvolatile memory to improve performance of the nonvolatile memory, and to determine an offset of a physical page in which a requested logical page is recorded without referring to mapping information of the logical page and the physical page.
2. Description of the Related Art
Nonvolatile memory is now widely used as a storage medium of portable electric devices such as digital cameras, personal digital assistants (PDAs), and MP3 players due to the fact that the nonvolatile memory has advantages of both a random access memory (RAM) in which data is freely writable and erasable, and a read only memory (ROM) in which stored data is preserved even when no power is supplied.
The nonvolatile memory can arbitrarily access data stored in a specified position thereof from the point of view of hardware in the same manner as existing memory devices such as RAM, nonvolatile storage device, and magnetic memory. However, when correcting or erasing the stored data, the nonvolatile memory accesses the data in units of an erase block (hereinafter, referred to as “block”), unlike the existing memory devices. In other words, when a previously written data is to be corrected or erased, a block that includes the previously written data must be erased before the data is again written (hereinafter referred to as “erasing before writing”). To analogize, the operation is akin to erasing an entire word using an “erase” key and then rewriting the word in order to correct a letter in the word.
Hereinafter, bytes having physically successive addresses are referred to as a sector. The sector refers to a basic unit to perform a data read/write operation in the nonvolatile memory and a block composed of a plurality of sectors refers to a basic unit to perform a data erase operation during an erase operation.
The nonvolatile memory supports a logical-physical mapping method that accesses data written in the nonvolatile memory through one logical address even if a physical address is changed due to the erasing before writing operation referenced above. In other words, the mapping method manages mapping data between the logical address and the physical address regarding a predetermined data through a predetermined mapping table. The mapping method includes a sector-mapping method and a block-mapping method.
The sector-mapping method has a problem in its difficulty in application to the nonvolatile memory because of excessive mapping data that is maintained in a sector unit. In this respect, recent technology is based on the block-mapping method that requires use of less mapping data.
Korean Unexamined Patent No. 2002-0092487 discloses “A Method of Managing Nonvolatile Memory” that matches a logical page offset and a physical page offset by providing mapping information for only a portion of the blocks and performing a merge operation of the remaining blocks, which can indicate an offset of a physical page, in which a logical page is recorded, without mapping information. In Korean Unexamined Patent No. 2002-0092487, a full merge operation is more frequently requested than a copy-merge operation. To perform the full merge operation, an erase operation of one block and a write operation of several pages are required. However, the frequent erase/write operations deteriorate the performance of the nonvolatile memory.
Accordingly, a nonvolatile-memory-managing apparatus and method, to improve the performance of a nonvolatile memory system by reducing the number of full merge operations is required.
An object of the present invention to provide an apparatus and method of managing a nonvolatile memory, which can improve performance of a nonvolatile memory system by reducing the number of full merge operations, and/or other advantages.
According to an aspect of the present invention, a nonvolatile memory managing apparatus includes a nonvolatile memory that has a first block and a second block having one or more physical pages, and an operation unit that a merge operation to perform for the first block and second block according whether logical page offsets recorded in consecutive physical pages in the first block increase in steps and in repeating order.
According to another aspect of the present invention, a nonvolatile-memory-managing apparatus includes a nonvolatile memory that has at least one block wherein one or more logical page offsets recorded in consecutive physical pages of the block increase in steps and in repeating order, an input unit that receives a request to perform a read operation with a first logical page offset, and an operation unit that obtains an offset of a second physical page wherein the first logical page offset is recorded, based on a second logical page offset obtained using a first physical page after accessing the first physical page having the same offset as a first logical page offset.
According to still another aspect of the present invention, provided is a nonvolatile-memory-managing method of a nonvolatile memory that has a first block and second block having one or more physical pages, where the method includes determining whether logical page offsets recorded in consecutive physical pages of the first block increases in steps and in repeating order, and deciding a merge operation to perform for the first block and second block according to a result of the determination.
According to another aspect of the present invention, provided is a nonvolatile memory managing method of a nonvolatile memory that has at least one block wherein one or more logical page offsets recorded in consecutive physical pages of the first block increase in steps and in repeating order, where the method includes receiving a request to perform a read operation with a first logical page offset, accessing a first physical page having the same offset as the first logical page offset and obtaining an offset of a second physical page wherein the first logical page offset is recorded, based on an offset of the second logical page offset obtained from the first physical page.
A method of managing a non-volatile memory having a plurality of logic pages and a plurality of physical pages of a block includes determining whether to perform a switch merge, a copy merge, or a full merge based on at least one of whether offsets of the plurality of the logic pages are sequentially looped and whether a number of valid logical pages of the block is the same as a total number of the physical pages included in the block, and performing an erase operation on the one or more blocks on which of the switch merge, the copy merge, or the full merge was performed.
An apparatus to manage a non-volatile memory having a plurality of logic pages and a plurality of physical pages of a block including the non-volatile memory; and a controller to determine whether to perform a switch merge, a copy merge, or a full merge based on at least one of whether offsets of the plurality of the logic pages are sequentially looped and whether a number of valid logical pages of the block is the same as a total number of the physical pages included in the block, and to perform an erase operation on the one or more blocks on which of the switch merge, the copy merge, or the full merge was performed.
Additional aspects and/or advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
These and/or other aspects and advantages of the invention will become apparent and more readily appreciated from the following description of the aspects, taken in conjunction with the accompanying drawings of which:
Reference will now be made in detail to aspects of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the like elements throughout. The aspects are described below in order to explain the present invention by referring to the figures.
Aspects of the present invention are described hereinafter with reference to flowchart illustrations of user interfaces, methods, and computer program products. It will be understood that each block of the flowchart illustrations, and combinations of blocks in the flowchart illustrations, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create an apparatus and/or method of implementing the functions specified in the flowchart block or blocks.
These computer program instructions may also be stored in a computer usable or computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer usable or computer-readable memory produce an article of manufacture including instruction apparatus and/or method that implement the function specified in the flowchart block or blocks.
The computer program instructions may also be loaded into a computer or other programmable data processing apparatus to cause a series of operations to be performed in the computer or other programmable apparatus to produce a computer implemented process such that the instructions that execute in the computer or other programmable apparatus provide operations to implement the functions specified in the flowchart block or blocks.
And each block of the flowchart illustrations may represent a module, segment, or portion of code, which includes one or more executable instructions to implement the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the blocks may occur out of order. For example, two blocks shown in succession may in fact be executed substantially concurrently or the blocks may sometimes be executed in reverse order, depending upon the functionality involved.
The input unit 100 receives a request to read/write to a predetermined logical page from a user. The operation unit 400 converts the write/read request of a logical address into a write/read request for a physical address. That is, the operation unit 400 converts the logical page requested by the user into a physical address of the nonvolatile memory 300, and performs a write/read operation.
The storage unit 200 stores an access code needed when the operation unit 400 is to access the nonvolatile memory 300. For example, the storage unit 200 stores a mapping table (not shown) that shows a mapping relation between the logical address requested by the user and the physical address of the nonvolatile memory 300. The storage unit 200 may be an exterior memory, including a random access memory (RAM) or a nonvolatile memory.
The nonvolatile memory 300 stores data to be recorded according to a user request. The structure of the nonvolatile memory 300 will be described with reference to
A page, as a basic unit of a read/write operation, can include a data area 330 and a spare area 340, as shown in
A block, as a basic unit of an erase operation, can be distinguished as a data block, log block, and free block. In this aspect, the free block refers to a block wherein data is not recorded, i.e., an empty block. The data block refers to a block that stores normal data. The log block refers to a block that is allocated when a special part of data recorded in the data block is to be modified, in order to record the modified part. Accordingly, the log block corresponds to only a single data block, as shown in
Hereinafter, the page that is preferentially referenced to in the log block will be referred to as a “valid page” and a page that is ignored even if physically valid data is recorded in the page will be referred to as an “invalid page”.
As shown in
According to an aspect of the present invention, a “block merge” can be performed in order to manage the nonvolatile memory 300. The block merge collects valid pages of the data blocks and/or log blocks, generates new data blocks, and performs an erase operation of an existing log block and/or data block in order to generate free blocks. The block merge can be performed when a free page for use as the log block no longer exists or is available. The block merge is distinguishable as a switch merge, a copy merge, and a full merge. When the block merge is performed, one of the three merges can be performed according to the status of the block to be merged.
As shown in
As shown in
As shown in
A method of managing the nonvolatile memory will be described with reference to
If a user requests a write operation using an offset of a first logical page, the operation unit 400 searches for a physical page offset corresponding to the first logical page offset with reference to mapping information. Then, it is determined whether a found physical page is available for writing in operation S810.
After operation S810, if the corresponding physical page is available (“YES” in operation S810), the operation unit 400 records data in the physical page in operation S860. In operation S860, data can be recorded in the data area of the corresponding physical page. When the data is recorded in the data area, the first logical page offset is recorded in the spare area of the physical page. When the data has been written, the operation unit 400 updates the mapping information of the map area.
After operation S810, if the corresponding physical page is not available (“NO” in operation S810), i.e., data has been already recorded in the physical page, the operation unit 400 determines whether the free page is allocatable in operation S820.
After operation S820, if the free is allocatable (“YES” in operation S820), the operation unit 400 allocates the free page, and records data in the data area of the allocated free page in operation S865. In operation S865, the operation unit 400 records the first logical page offset in the spare area of the free page.
After operation S820, if the corresponding physical page is not allocatable (“NO” in operation S820), the operation unit 400 determines whether the log block is allocatable in operation S830, i.e., the operation unit 400 determines whether the number of remaining free blocks is sufficient.
If the number of the remaining free blocks is sufficient to allocate a new log block (“YES” in operation S830), the operation unit 400 allocates one or more predetermined free blocks to the log block in operation S850, and records data in the physical page of the allocated log block in operation S860. In operation S860, the operation unit 400 records data in the data area of the physical page, and records the first logical page offset in the spare area of the physical page. When the data has been written, the operation unit 400 updates the mapping information of the map area in operation S870.
However, if the number of the remaining free blocks is not enough to allocate a new log block (“NO” in operation S830), the operation unit 400 generates a new free block by performing a merge operation in operation S840, allocates the free block to the log block in operation S850, and performs a write operation in the physical page of the allocated new log block. Then, the operation unit 400 updates the mapping information of the map area in operation S870.
In the above description with reference to
As shown in
On the other hand, if offset of the logical page recorded in the consecutive physical pages in the log block increases in steps or in repeating order (“YES” in operation S901), the operation unit 400 determines whether the number of valid logical pages in the corresponding log block is the same as the total number of physical pages included in the log block in operation S902.
As shown in
As shown in
The operation unit 400 obtains the offset of the second physical page X′ wherein the first logical page is recorded based on the second offset Y in operation S30. Specifically, the first offset and the second offset are represented by “X” and “Y”, respectively. If the difference of the first offset X and second offset Y is represented by “Z”, and the total number of physical pages included in the block is N, then the operation unit 400 obtains the offset X′ of the second physical page, based on equation 1:
X′=(X+Z+N) mod N (1)
That is, the operation unit 400 obtains the offset X′ that is the remainder obtained as a result of adding Z, X, and N, then dividing by N (that is, the modulo operation). When the offset X′ is obtained through equation 1, the operation unit 400 reads the second physical page in operation S40.
In this aspect, the read operation can be understood by referring to
If a request to read the first logical page having the offset 7 is input, the operation accesses the first physical page having the same offset as the first logical page. In detail, because the first logical page offset is 7, the operation unit 400 accesses the first physical page having the offset 7, i.e., page 7. Then, the operation unit 400 checks the spare area of the page 7, and obtains the second logical page offset Y, which is 2.
The operation obtains the offset X′ of the second physical page wherein the first logical page is recorded based on the second logical page offset Y recorded in the spare area of the first physical page (page 7) of block 1200. Specifically, the operation unit 400 obtains the offset X′ of the second physical page based on equation 1. In the aspect shown in
When the offset X′ of the second physical page is obtained, the operation unit 400 reads the physical page having the offset 4 in the corresponding block, i.e., the fifth page. In the spare area of the fifth page, i.e., page 4, the number 7 is recorded as the address of the logical page.
In aspects of the present invention, if the logical page included in the block is sorted, it is possible that the logical page offset increases in steps and in repeating order in order to reduce the number of full merge operations, to thereby improve a speed of a write operation in the nonvolatile memory.
In aspects of the present invention, the logical page offset recorded in the physical page is recorded in the spare area of the physical page, to thereby indicate the offset of the physical page wherein the requested logical page is recorded, without referring to mapping information of the physical page and logical page.
In various aspects, the nonvolatile memory may be a flash memory. Also, in various aspects, the increase in the offsets of the logical and/or physical pages may be referred to as ascending, and the repeating thereof may be referred to as circulating. In various aspects, increasing in steps and in repeating order may be referred to as sequential looping or sequentially looped. In various aspects, at least one of refers to any combination of one or more elements. Also, the use of and/or refers to any combination of one or more elements.
Although a few aspects of the present invention have been shown and described, it would be appreciated by those skilled in the art that changes may be made in the aspects without departing from the principles and spirit of the invention, the scope of which is defined in the claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
2006-114788 | Nov 2006 | KR | national |