Description of the Related Art
The use of a cache in a computer reduces memory access time and increases the overall speed of a device. Typically, a cache is an area of memory which serves as a temporary storage area for a device and has a shorter access time than the device it is caching. Data frequently accessed by the processor remain in the cache after an initial access. Subsequent accesses to the same data may be made to the cache.
Two types of caching are commonly used, memory caching and disk caching. A memory cache, sometimes known as cache store, is typically a high-speed memory device such as a static random access memory (SRAM). Memory caching is effective because most programs access the same data or instructions repeatedly.
Disk caching works under the same principle as memory caching but uses a conventional memory device such as a dynamic random access memory (DRAM). The most recently accessed data from the disk is stored in the disk cache. When a program needs to access the data from the disk, the disk cache is first checked to see if the data is in the disk cache. Disk caching can significantly improve the performance of applications because accessing a byte of data in RAM can be thousands of times faster than accessing a byte on a disk.
Both the SRAM and DRAM are volatile memories. Therefore, in systems using a volatile memory as the cache memory, data stored in the cache memory would be lost when the power is shut off to the system. Accordingly, some devices may utilize non-volatile memory.
Certain non-volatile memories, such as polymer memory, are destructive read memories. Data stored in a memory location of destructive read memories are erased by the process of reading the memory location. In normal operation it is necessary to perform a write back after every read to preserve data. Some memories have a raw soft error rate and include an error correction code (ECC) with data. Upon reading data, the ECC is checked and data is corrected as needed. For destructive read memories with a soft error rate, the read process is long due to the need to check and correct data prior to performing a write back.
The present invention may be better understood, and its numerous features and advantages made apparent to those skilled in the art by referencing the accompanying drawings.
The use of the same reference symbols in different drawings indicates similar or identical items.
In the following description, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In other instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
References to “one embodiment,” “an embodiment,” “example embodiment,” “various embodiments,” etc., indicate that the embodiment(s) of the invention so described may include a particular feature, structure, or characteristic, but not every embodiment necessarily includes the particular feature, structure, or characteristic. Further, repeated use of the phrase “in one embodiment” does not necessarily refer to the same embodiment, although it may.
As used herein, unless otherwise specified the use of the ordinal adjectives “first,” “second,” “third,” etc., to describe a common object, merely indicate that different instances of like objects are being referred to, and are not intended to imply that the objects so described must be in a given sequence, either temporally, spatially, in ranking, or in any other manner.
As disclosed herein, a “cache” refers to a temporary storage area and can be either a memory cache or a disk cache. The term “system boot” refers to initialization of a computer both when the power is first turned on, known as cold booting, and when a computer is restarted, known as warm booting. The term “computer readable medium” includes, but is not limited to portable or fixed storage devices, optical storage devices, and any other memory devices capable of storing computer instructions and/or data. The term “computer instructions” are software or firmware including data, codes, and programs that can be read and/or executed to perform certain tasks.
According to an embodiment of the present invention, row interface 102 and column interface 104 interact to read a row of data, for example row M 110 from memory array 106. The read data is latched by data latch 108. According to an embodiment of the present invention, the read data is speculatively written back to row 110 in memory array 106. The write back is a speculative write back because it is made prior to error checking and on the speculation that no corrections are required. During the speculative write back, data checking and correction (if needed) is performed. Data checking and correction may be performed in software or alternatively by circuitry within column interface 104 or row interface 102. The invention is not limited in this respect. If correction is needed, row M 110 is erased and the corrected data written back. These accesses are illustrated in
Although system 400 is illustrated as a system with a single processor, other embodiments may be implemented with multiple processors, in which additional processors may be coupled to the bus 430. In such cases, each additional processor may share the non-volatile storage cache device 450 and main memory 420 for writing data and/or instructions to and reading data and/or instructions from the same. Also, although non-volatile storage cache device 450 is shown external to mass storage device 460, in other embodiments non-volatile storage cache device 450 may be internally implemented into any non-volatile media in a system. For example, in one embodiment, non-volatile storage cache device 450 may be a portion of mass storage device 460.
Because retrieving data from mass storage device 460 can be slow, caching may be achieved by storing data recently accessed from the mass storage device 460 in a non-volatile storage media such as non-volatile storage cache device 450. The next time the data is needed, it may be available in non-volatile storage cache device 450, thereby avoiding a time-consuming search and fetch in mass storage device 460. Non-volatile storage cache device 450 may also be used for writing. In particular, data may be written to non-volatile storage cache device 450 at high speed and then stored until the data is written to mass storage device 460, for example, during idle machine cycles or idle cycles in a mass storage subsystem.
According to one embodiment of the present invention, memory control hub 440 may control the processes of flow 300 including initiating a read, a speculative write back, error checking and correcting, erasing and corrective write backs. In another embodiment of the present invention, one or more of these processes are controlled within non-volatile storage cache device 450. The present invention is not limited in this respect.
By performing a speculative write back prior to checking the data for errors, only those memory operations where the data has errors are long. If the error rate for memory is low, performance can be significantly improved because the average cycle time is shorter. Speculative write back also reduces the amount of time that the memory system is exposed to unexpected power failure. When the system has a requirement to have sufficient energy reserve to complete the write back, delaying the write back for error checking and correction widens the window, increasing the amount of energy storage required.
Realizations in accordance with the present invention have been described in the context of particular embodiments. These embodiments are meant to be illustrative and not limiting. Many variations, modifications, additions, and improvements are possible. Accordingly, plural instances may be provided for components described herein as a single instance. Boundaries between various components, operations and data stores are somewhat arbitrary, and particular operations are illustrated in the context of specific illustrative configurations. Other allocations of functionality are envisioned and may fall within the scope of claims that follow. Finally, structures and functionality presented as discrete components in the various configurations may be implemented as a combined structure or component. These and other variations, modifications, additions, and improvements may fall within the scope of the invention as defined in the claims that follow.