This application claims priority to Korean Patent Application No. 10-2012-0117373 filed on Oct. 22, 2012 in the Korean Intellectual Property Office, the disclosure of which is herein incorporated by reference in its entirety.
The present inventive concept relates to a memory device, and more particularly, to a method of managing data in a nonvolatile memory device.
Nonvolatile memory devices are widely used in embedded systems such as home electronic appliances, communications devices and set-top boxes.
Nonvolatile memory devices can be used as both random access memory (RAM), which can be freely erased and written to, and read only memory (ROM), which can retain stored data even when a power supply is not present.
Flash memory is a common form of nonvolatile memory. A flash memory is a nonvolatile memory device in which memory cells may be electrically deleted and rewritten to. As compared to a storage medium based on a magnetic disk, flash memory tends to utilize less power and have an at least comparable access time. Further, since flash memory is compact in size, it is suitable for portable devices.
Data may only be rewritten to a flash memory in whole-page increments. When data recorded in a page of a nonvolatile memory is updated, the page becomes invalid. Thus, a new page is allocated, and the updated data is recorded in the new page along with all of the data of the old page that was not updated. Here, if there is not enough available space in the nonvolatile memory, garbage collection is performed to reclaim pages that were deemed to be invalid and to thereby increase the available space.
The time required to perform garbage collection acts as a load on the performance of the nonvolatile memory. Therefore, as the time required to perform garbage collection during the operation of the nonvolatile memory is reduced, the overall performance of the nonvolatile memory increases.
Aspects of the present inventive concept provide a method of managing data in a nonvolatile memory device, in which the time required to perform garbage collection is reduced, and wear leveling is unnecessary.
However, aspects of the present inventive concept are not restricted to the particular examples set forth herein. The above and other aspects of the present inventive concept will become more apparent to one of ordinary skill in the art to which the present inventive concept pertains by referencing the detailed description of the present inventive concept given below.
According to an aspect of the present inventive concept, there is provided a method of managing data in a nonvolatile memory device, the method includes providing a nonvolatile memory device. The nonvolatile memory device includes a hot region which has first through n-th blocks and a cold region. Input pages having metadata from a host are received. The input pages are sequentially written to the first through n-th blocks. Valid pages are identified from the input pages written to the first block after the n-th block is written. The valid pages are written to the cold region. Here n is a positive integer.
According to an aspect of the present inventive concept, there is provided a method of managing data in a nonvolatile memory device. The method includes providing a nonvolatile memory device including a hot region which has first through n-th blocks and a cold region. An input stream is received. The input stream includes a plurality of input pages from a host. The input stream is sequentially written to the first through n-th blocks. Moreover, p first threshold pages of the first block are sequentially written to the second through n-th blocks after the receiving of the input stream from the host is completed. Valid pages are identified from the input pages written to the first block after the n-th block is written. The valid pages are written to the cold region, wherein n is a positive integer, and p is a positive integer.
The above and other aspects and features of the present inventive concept will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings, in which:
The present inventive concept will now be described more fully hereinafter with reference to the accompanying drawings, in which preferred embodiments of the inventive concept are shown. This inventive concept may, however, be embodied in different forms and should not be construed as limited to the embodiments set forth herein. The same reference numbers may indicate the same components throughout the specification. In the attached figures, the thickness of layers and regions may be exaggerated for clarity.
It will also be understood that when a layer is referred to as being “on” another layer or substrate, it can be directly on the other layer or substrate, or intervening layers may also be present.
A hot region, a cold region, a block, and a page to be described below refer to logical spaces of a nonvolatile memory device, not particular physical regions of the nonvolatile memory device. Since the hot region, the cold region, the block, and the page refer to the logical spaces, corresponding physical spaces may vary whenever a write operation, an erase operation or the like is performed on them.
Referring to
Hereinafter, a case where one block of the nonvolatile memory device includes four logical pages as shown in
A free block (e.g., a first block L1) is a block that does not include a logical page. The number of such free blocks is largest when the nonvolatile memory device is first driven and is gradually reduced as the time in which the nonvolatile memory device is in use increases. When the number of free blocks is reduced to a predetermined number or less, as the time in which the nonvolatile memory device is in use increases further, the nonvolatile memory device generates a new free block through garbage collection.
An open block (e.g., a second or third block L2 or L3) is a block that stores a certain number of logical pages but does not yet store a maximum number of logical pages that it can store. For example, although each of the second block L2 and the third block L3 can store a maximum of four pages, three logical pages are stored in the second block L2, and two logical pages are stored in the third block L3.
When a logical page is input from a host to the nonvolatile memory device, it is generally stored in an open block (L2 or L3). When a logical page stored in a block is updated by the host, it is invalidated. For example, if a logical page identical to a logical page stored in a block (e.g., L3) is input from the host, the logical page stored in the block (e.g., L3) becomes an invalid page, and the input logical page is stored in a new block (e.g., a free block or another open block). For example, an invalid page in the third block L3 of
A full block (e.g., a fourth or fifth block L4 or L5) is a block that stores a maximum number of logical pages it can store. In
A method of managing data in a nonvolatile memory device according to an exemplary embodiment of the present inventive concept will now be described with reference to
Referring to
The hot region is a region that is frequently updated by the host. For example, the hot region is a region to which pages input from the host are written. Blocks included in the hot region undergo frequent page updates and garbage collection. The cold region is a region to which pages that are not updated frequently from among the pages input from the host are written. Pages written to the cold region are not updated frequently. Therefore, compared with the hot region, the cold region includes a relatively small number of invalid pages.
Where the nonvolatile memory device is divided into the hot region and the cold region, garbage collection can be performed only on pages that are updated frequently. Therefore, the time required to perform garbage collection and the number of blocks on which garbage collection is performed can be reduced. Accordingly, efficient data management may be achieved.
Pages input from the host may include metadata. The metadata is updated more frequently than the primary data that the metadata describes. Therefore, after the metadata is written to blocks of the nonvolatile memory device, it often becomes invalid data within a relatively short period of time. Thus, the metadata exists as valid data for only a limited time. For this reason, if the metadata and the primary data are managed separately within the hot region and the cold region, respectively, according to an exemplary embodiment of the present inventive concept, more efficient data management is possible compared with when the primary data and the metadata are not separately managed.
The number of blocks included in the hot region may be greater than or equal to the number of blocks included in the cold region. For example, n≧m. Pages in the hot region are updated frequently, and data input from the host is continuously written to the hot region. Therefore, the greater the number of blocks in the hot region, the more efficiently the data management may be performed. On the other hand, pages selected from input pages written to the hot region are written to the cold region. Therefore, the cold region may have a smaller number of blocks than the number of blocks included in the hot region. For example, the number of blocks included in the hot region may be three or four times the number of blocks included in the cold region.
Referring back to
After the nth block Bn is written, valid pages are identified from the input pages written to the first block B1. For example, after the input pages are written to the nth block Bn, the hot region is written again, starting from the first block B1. Here, valid pages are identified from the input pages written to the first block B1. Referring to
Referring back to
Like writing input pages to the hot region, writing valid pages to the cold region may be performed in a round-robin fashion. For example, since the cold region includes the first through mth blocks C1 through Cm, valid pages may be written to the cold region sequentially from the first block C1 to the mth block Cm. Then, valid pages may be written again to the cold region sequentially from the first block C1.
Since the hot region includes a sufficient number of blocks, if valid pages do not change to invalid pages while the first through nth blocks B1 through Bn of the hot region are written sequentially, they can be determined to be pages that are not updated frequently. Therefore, valid pages included in the first block B1 of the hot region may be written to the cold region, such that the valid pages which are not updated frequently are collected in the cold region. Ultimately, garbage collection can be performed only on the hot region which includes a large number of invalid pages due to frequent updates. Thus, the frequency of garbage collection can be reduced.
After the valid pages of the first block B1 are written to the cold region, no valid pages exist in the first block B1. Accordingly, referring to
The second block B2 can also be changed to a free block in the way described above, and then input pages can be written to the second block B2. Referring to
A method of managing data in a nonvolatile memory device according to an exemplary embodiment of the present inventive concept will now be described with reference to
Pages of a cold region may be updated, albeit not as frequently as those of a hot region. Therefore, not only are valid pages of the hot region written to the cold region, but also garbage collection is performed on the cold region. The garbage collection may be performed as follows.
Referring to
Referring to
The first threshold value is not limited to a particular value and may be determined by a user according to the use and characteristics of the nonvolatile memory device.
The identifying of the number of the invalid pages in the cold region may be performed when a valid page of the hot region is written to the cold region. However, the present inventive concept is not limited thereto. For example, the identifying of the number of the invalid pages in the cold region can also be performed whenever an input page is written to the hot region.
A method of managing data in a nonvolatile memory device according to an exemplary embodiment of the present inventive concept will now be described with reference to
The data management method described above with respect to
Referring to
In
Referring to
Referring to
An input stream is written to pages b31 and b32 of the third block B3, the page b12 of the first block B1 is written to a page b33 of the third block B3, and the page b13 of the first block B1 is written to a page b34 of the third block B3. For example, the remaining pages b12 and b13 of the first block B1 are written to the third block B3 on a first threshold page-by-first threshold page basis until the third block B3 is filled.
Referring to
Thus, the first block B1 includes the p first threshold pages (where p is shown as being equal to three in
If the first threshold page refers to the number of valid pages, only the valid pages, not invalid pages, are written to other blocks, thus contributing to an increase in efficiency.
In
Writing a second block of a hot region to other blocks will now be described with reference to
After p first threshold pages of a first block B1 are all written to other blocks, first threshold page of a second block B2 is written to other blocks. For example, q (where q is a positive integer) first threshold pages of the second block B2 are written to at least one of the blocks to which the p first threshold pages are not written from among first through nth blocks B1 through Bn. For example, referring to
As described above, if pages included in one block of the hot region are distributed (written) to other blocks on a first threshold page-by-first threshold page basis, the time required to change the block of the hot region to a free block can be reduced. For example, as exemplified in
In addition, to write input pages received from the host, the blocks of the hot region are sequentially changed to free blocks in a round-robin fashion. Accordingly, the time required to scan appropriate blocks to be changed to free blocks may be saved.
Furthermore, the first threshold page of the first block B1 is not written to a particular free block. Instead, the first threshold page is written to unused pages of a block to which input pages are written. Therefore, the number of write and erase operations performed on blocks can be reduced.
A method of managing data in a nonvolatile memory device according to an exemplary embodiment of the present inventive concept will now be described with reference to
Referring to
For example, referring to
However, if the number of invalid data of the cold region is equal to or greater than the second threshold value, the first threshold page is changed to a second threshold page. In
The second threshold value may be equal to the first threshold value. When the first threshold value and the second threshold value are equal, merging valid pages of the cold region may be performed at the same time as changing first threshold page to a second threshold page. Alternatively, the first threshold page may be changed to the second threshold page when the number of the invalid pages is greater than or equal to the second threshold value, and the second threshold page may be changed to the first threshold page when the number of the invalid pages is greater than or equal to the first threshold value.
When valid pages written to the cold region are provided to the hot region as input pages, they may become invalid pages. Therefore, an increase in the number of the invalid pages in the cold region indicates an increase in the number of the input pages provided to the hot region. When the number of the input pages provided to the hot region increases, if the first threshold page is maintained, time might be taken to distribute the first threshold page of the first block B1 to other blocks. This is because the first threshold page is not written to a target block if the number of pages input from the host is equal to or greater than the number of pages in the target block (see
A memory system according to exemplary embodiments of the present inventive concept will now be described with reference to
Referring to
The nonvolatile memory device 1100 may implement one or more of the data management methods described above.
The controller 1200 is connected to a host and the nonvolatile memory device 1100. The controller 1200 is configured to access the nonvolatile memory device 1100 in response to a request from the host. For example, the controller 1200 may be configured to control read, write, erase and background operations of the nonvolatile memory device 1100. The controller 1200 may be configured to provide an interface between the nonvolatile memory device 1100 and the host. The controller 1200 may be configured to drive firmware for controlling the nonvolatile memory device 1100.
The controller 1200 further includes well-known components such as a random access memory (RAM), a processing unit, a host interface, and a memory interface. The RAM is used as at least one of an operation memory of the processing unit, a cache memory between the nonvolatile memory device 1100 and the host, and a buffer memory between the nonvolatile memory device 1100 and the host. The processing unit controls the overall operation of the controller 1200.
The host interface includes a protocol for data exchange between the host and the controller 1200. For example, the controller 1200 may be configured to communicate with an external device (e.g., the host) using at least one of various interface protocols such as a universal serial bus (USB) protocol, a multimedia card (MMC) protocol, a peripheral component interconnection (PCI) protocol, a PCI-express (PCI-E) protocol, an advanced technology attachment (ATA) protocol, a serial-ATA protocol, a parallel-ATA protocol, a small computer small interface (SCSI) protocol, an enhanced small disk interface (ESDI) protocol, and an integrated drive electronics (IDE) protocol. The memory interface may interface with the nonvolatile memory device 1100. For example, the memory interface includes a NAND interface or a NOR interface.
The memory system 1000 may further include an error correction block. The error correction block may be configured to detect errors of data read from the nonvolatile memory device 1100 and correct the detected errors using error correcting codes (ECC). For example, the error correction block may be provided as an element of the controller 1200. The error correction block can also be provided as an element of the nonvolatile memory device 1100.
The controller 1200 and the nonvolatile memory device 1100 may be integrated into one semiconductor device. For example, the controller 1200 and the nonvolatile memory device 1100 may be integrated into one semiconductor device to form a memory card. For example, the controller 1200 and the nonvolatile memory device 1100 may be integrated into one semiconductor device to form a personal computer (PC) card (e.g., Personal Computer Memory Card International Association (PCMCIA)), a compact flash card (CF), a smart media card (SM, SMC), a memory stick, a multimedia card (e.g., MMC, RS-MMC, MMCmicro), a SD card (e.g., SD, miniSD, microSD, SDHC), or a universal flash storage (UFS).
Alternatively, the controller 1200 and the nonvolatile memory device 1100 may be integrated into one semiconductor device to form a solid state drive (SSD). The SSD includes a storage device which stores data in a semiconductor memory. When the memory system 1000 is used as an SSD, the operation speed of the host connected to the memory system 1000 may increase significantly.
The memory system 1000 may be implemented in a computer, an ultra-mobile PC (UMPC), a workstation, a net-book, a personal digital assistant (PDA), a portable computer, a web tablet, a wireless phone, a mobile phone, a smart phone, a dedicated e-book reading device, a portable multimedia player (PMP), a portable game device, a navigation device, a black box, a digital camera, a three-dimensional television, a digital audio recorder, a digital audio player, a digital picture recorder, a digital picture player, a digital video recorder, a digital video player, a device capable of transmitting/receiving information in wireless environments, one of various electronic devices constituting a home network, one of various electronic devices constituting a computer network, one of various electronic devices constituting a telematics network, a radio frequency identification (RFID) device, or one of various components constituting a computing system.
The nonvolatile memory device 1100 or the memory system 1000 may be mounted using various forms of packages. The nonvolatile memory device or the memory system 1000 may be mounted using packages such as package on package (PoP), ball grid arrays (BGAs), chip scale packages (CSPs), plastic leaded chip carrier (PLCC), plastic dual in-line package (PDIP), die in waffle pack, die in wafer form, chip on board (COB), ceramic dual in-line package (CERDIP), plastic metric quad flat pack (MQFP), thin quad flat pack (TQFP), small outline integrated circuit (SOIC), shrink small outline package (SSOP), thin small outline package (TSOP), thin quad flat pack (TQFP), system in package (SIP), multi chip package (MCP), wafer-level fabricated package (WFP), and wafer-level processed stack package (WSP).
Referring to
In
Referring to
The memory system 2000 is electrically connected to the CPU 3100, the RAM 3200, the user interface 3300, and the power supply 3400 through a system bus 3500. Data provided through the user interface 3300 or processed by the CPU 3100 is stored in the memory system 2000.
In
In
Alternatively, the computing system 3000 may include all of the memory systems 1000 and 2000 described above with reference to
Those skilled in the art will appreciate that many variations and modifications can be made to the described exemplary embodiments without substantially departing from the principles of the present invention.
Number | Date | Country | Kind |
---|---|---|---|
10-2012-0117373 | Oct 2012 | KR | national |