Error correction code data matching to reduce memory operations
By using a memory controller with a cache for error correction code data matching to avoid unnecessary erase cycles and mark valid pages, the memory's useful lifetime and performance are enhanced, addressing inefficiencies in non-volatile memory due to erase cycles.
Patent Information
- Application Number
- US19/309524
- Authority / Receiving Office
- US · United States
- Patent Type
- Applications(United States)
- Current Assignee / Owner
- Priority Date
- 2025-05-20
- Filing Date
- 2025-08-25
- Publication Date
- 2026-11-26
AI Technical Summary
Non-volatile memory, such as flash memory, experiences reduced useful lifetime due to erase cycles, leading to inefficiencies and potential unreliability from operations like garbage collection.
Implementing a memory controller with a cache that stores error correction code data, allowing it to match and compare data across pages to avoid writing to stale pages, thereby reducing unnecessary erase cycles and marking valid pages as programmed to prevent garbage collection.
Extends the useful lifetime of non-volatile memory by minimizing erase cycles and improving performance through reduced operations, thus enhancing reliability and resource conservation.
Smart Images

Figure US20260377265A1-D00000_ABST
Abstract
Description
RELATED APPLICATION DATA
[0001] This application claims the benefit of U.S. Provisional Patent Application Ser. No. 63 / 809,328, filed May 20, 2025, which is incorporated by reference herein for all purposes.FIELD
[0002] The disclosure relates generally to non-volatile memory, and more particularly to error correction code data matching to reduce memory operations.BACKGROUND
[0003] In one example, a block of memory can be erased a particular number of times before the functionality of the block of memory begins to degrade. Once the functionality of the block of memory begins to degrade, the block of memory should be removed / replaced.BRIEF DESCRIPTION OF THE DRAWINGS
[0004] The drawings described below are examples of how embodiments of the disclosure may be implemented, and are not intended to limit embodiments of the disclosure. Individual embodiments of the disclosure may include elements not shown in particular figures and / or may omit elements shown in particular figures. The drawings are intended to provide illustration and may not be to scale.
[0005] FIG. 1 illustrates a system including a storage device, according to embodiments of the disclosure.
[0006] FIGS. 2A, 2B, and 2C illustrate examples of memory operations, according to embodiments of the disclosure.
[0007] FIGS. 3A and 3B illustrate an example of a request to write data, according to embodiments of the disclosure.
[0008] FIGS. 4A and 4B illustrate an example of a request to read data, according to embodiments of the disclosure.
[0009] FIG. 5 illustrates example logic for receiving a write request, according to embodiments of the disclosure.
[0010] FIG. 6 illustrates example logic for receiving a read request, according to embodiments of the disclosure.
[0011] FIG. 7 illustrates example logic for writing error correction code data for data in invalidated pages to a cache memory, according to embodiments of the disclosure.
[0012] FIG. 8 shows a flowchart of a first example procedure for receiving a write request, according to embodiments of the disclosure.
[0013] FIG. 9 shows a flowchart of a second example procedure for receiving a write request, according to embodiments of the disclosure.
[0014] FIG. 10 shows a flowchart of a third example procedure for receiving a write request, according to embodiments of the disclosure.SUMMARY
[0015] A first request to write user data to a first page of a first block of memory may be received. First error correction code data may be generated for the user data. The first error correction code data may be matched with second error correction code data of a second page of the first block of memory. The second page may be marked as programmed.
[0016] A request to write user data to a first page of a first block of memory may be received. First error correction code data may be generated for the user data. The first error correction code data may be compared to instances of error correction code data included in a cache of a memory controller. A second page of a second block of memory may be identified based on comparing the first error correction code data to the instances of error correction code data. The second page may be marked as stale. The second page may become marked as programmed.
[0017] A first request to write first data to a first page of a first block of memory may be received. First error correction code data may be generated for the first data. The first error correction code data may be compared with error correction code data of pages of the first block of memory. The first data may be written to a page of a second block of memory.DETAILED DESCRIPTION
[0018] Reference will now be made in detail to embodiments of the disclosure, examples of which are illustrated in the accompanying drawings. In the following detailed description, numerous specific details are set forth to enable a thorough understanding of the disclosure. It should be understood, however, that persons having ordinary skill in the art may practice the disclosure without these specific details. In other instances, well-known methods, procedures, components, circuits, and networks have not been described in detail so as not to unnecessarily obscure aspects of the embodiments.
[0019] It will be understood that, although the terms first, second, etc. may be used herein to describe various elements, these elements should not be limited by these terms. These terms are only used to distinguish one element from another. For example, a first module could be termed a second module, and, similarly, a second module could be termed a first module, without departing from the scope of the disclosure.
[0020] The terminology used in the description of the disclosure herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in the description of the disclosure and the appended claims, the singular forms “a,”“an,” and “the” are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term “and / or” as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. It will be further understood that the terms “comprises” and / or “comprising,” when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and / or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. The components and features of the drawings are not necessarily drawn to scale.
[0021] Some non-volatile memory such as flash memory has a finite useful lifetime. This useful lifetime is reduced by each erase cycle (also referred to as a “program / erase cycle”) for a block of memory. Since pages of the block of memory may not be overwritten, a variety of operations (e.g., “garbage collections”) are performed for storage management that can result in additional erase cycles for the block of memory which decrease its useful lifetime.
[0022] In order to avoid decreasing a useful lifetime for a block of memory, error correction code data matching may be leveraged to avoid or reduce memory operations which would be performed based on writing user data to a first page marked as “free” that is already written to a second page marked as “stale” (e.g., marked as invalid). In some embodiments, a memory controller may include a cache and the cache can include error correction code data for data stored in pages of the block of memory. In order to include the error correction code data in the cache, in some embodiments, the memory controller retains instances of error correction code data corresponding to the data stored in the pages as part of read operations performed relative to the block of memory.
[0023] The memory controller may receive a request to write the user data to the first page of the block of memory. Upon receiving the request, the memory controller generates error correction code data for the user data. The error correction code data corresponds to and approximately matches the user data. For instance, if error correction code data for particular data matches the error correction code data for the user data, then the particular data may also match the user data but the particular data does not necessarily match the user data.
[0024] In some embodiments, the memory controller determines that a number of erase cycles for the block of memory is relatively high (e.g., greater than a threshold number of erase cycles). Since the number of erase cycles for the block of memory is relatively high, additional erase cycles for the block of memory may cause the block of memory to become unreliable and unusable. In order to reduce additional erase cycles, the memory controller may be configured to avoid performance of a “garbage collection” procedure with respect to the block of memory.
[0025] In some embodiments, the memory controller may utilize the cache to compare the error correction code data for the data stored in the pages of the block of memory with the error correction code data generated for the user data. Consider an example in which the memory controller matches the error correction code data for the user data with the error correction code data for the data stored in the second page of the block of memory which is marked as “stale.” Since the error correction code data for the user data matches the error correction code data for the data stored in the second page, the user data may also match the data stored in the second page. In some embodiments, the memory controller may perform an additional comparison such as by comparing the user data to the data stored in the second page after reading the second page from the block of memory to confirm that the user data matches the data stored in the second page. In some embodiments, the memory controller may compare an entirety of the user data to an entirety of the data stored in the second page or the memory controller may compare partial segments or sectors of the user data and the data stored in the second page in order to confirm that the user data matches the data stored in the second page.
[0026] In some embodiments, the memory controller does not write the user data to a page of the block of memory as requested. In these embodiments, the memory controller may cause the second page of the block of memory to be marked as “programmed” (e.g., marked as valid). In some embodiments, the memory controller may update a memory management unit based on reclaiming the data stored in the second page as valid data. In some embodiments, the memory management unit is updated to associate a logical block address (LBA) of the user data with a physical block address (PBA) of the second page of the block of memory. By marking the second page of the block of memory as “programmed,” one or more operations that can decrease the useful lifetime of the block of memory may be avoided which improves overall performance and reliability of a non-volatile memory that includes the block of memory. This also conserves some system resources which would have been consumed by performing the avoided operations.
[0027] FIG. 1 illustrates a system including a storage device 120, according to embodiments of the disclosure. As shown in FIG. 1, a machine 105 (e.g., a host) includes a processor 110, a storage device 120, and a device driver 130. The processor 110 is representative of a variety of types of processors such as central processing units (CPUs), accelerators, graphics processing units (GPUs), processors implemented using field-programmable gate arrays (FPGAs) (e.g., soft processors), neural processing units (NPUs), tensor processing units (TPUs), etc. The processor 110 is shown to be communicatively coupled to the storage device 120 via the device driver 130. The device driver 130 can control the storage device 120 and the device driver 130 may be implemented using software, hardware, or a combination of software and hardware.
[0028] The storage device 120 is illustrated to include a memory 140, a memory controller 150 coupled to the memory 140, a cache 152 of the memory controller 150, an erase counter 155, and a memory management unit 160. In general, the memory 140 includes non-volatile memory such as flash memory (e.g., NAND flash or NOR flash), read-only memory (ROM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), resistive random access memory (ReRAM), phase change memory (PCM), etc. In some embodiments, the memory 140 can include volatile memory such as random access memory (RAM), static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), etc. In some embodiments, the memory 140 may be configured for reads at a first level (e.g., a page) and writes at a second level (e.g., a block). In other embodiments, the memory 140 may be configured for reads and writes at the same level. In some embodiments, the memory 140 may be subject to wear-out due to erase cycles. In some embodiments, the memory 140 may be subject to wear-out due to one or more events which can be reduced or avoided (e.g., a probability of an event occurring may be decreased). Read / write operations performed relative to the memory 140 may be managed by the memory controller 150. In some embodiments, the processor 110 is communicatively coupled to the memory controller 150 via a wired or wireless connection.
[0029] The memory controller 150 is illustrated to include the erase counter 155 and the memory management unit 160. It is to be appreciated that, in some embodiments, the memory management unit 160 may be separate from the memory controller 150 or the memory management unit 160 can be included in memory controller 150. In some embodiments, the cache 152 may be a tightly coupled memory (TCM) of the memory controller 150 or the cache 152 can include another type of memory in relatively close proximity to the memory controller 150 such that data stored in the cache 152 is accessible to the memory controller 150 with minimal latency. For instance, the cache 152 generally includes volatile memory such as RAM; however, in some embodiments, the cache 152 may include non-volatile memory.
[0030] In some embodiments, the memory 140 may have a greater total capacity than the cache 152 (e.g., the memory 140 may have non-volatile memory capacity and the cache 152 may have volatile memory capacity). In these embodiments, the memory controller 150 may be configured to access data included in the cache 152 in a first amount of time and the memory controller 150 may be configured to access data included in the memory 140 in a second amount of time that is greater than the first amount of time. It is to be appreciated that, in some embodiments, the storage device 120 can include an additional memory 140 and / or an additional cache 152.
[0031] The memory management unit 160 of the storage device 120 may be configured to translate between virtual addresses and physical addresses, and as such, the memory management unit 160 may be implemented using hardware, software, or combinations of hardware and software. In an example in which the memory 140 includes flash memory, the memory management unit 160 may be configured to translate between logical block addresses and physical addresses. In this example, a user of the machine 105 interacts with an input device (e.g., mouse, keyboard, microphone, etc.) in an application and requests to read from a file. For instance, data corresponding to the file is included in the memory 140 of the storage device 120.
[0032] Continuing the example, the processor 110 issues a request to read from a logical address corresponding to the file. The memory management unit 160 receives the request and maps the logical address to a physical address. For instance, the memory controller 150 of the storage device 120 or an operating system of the machine 105 maps the physical address to a page of a block of the memory 140. The memory controller 150 issues a command to read from the page of the block of the memory 140. In some embodiments, the memory controller 150 direct memory access (DMA) transfers data read from the page to the application of the user that requested to read from the file.
[0033] As outlined above, in some embodiments, the memory 140 is non-volatile memory (e.g., flash memory) such that the memory 140 includes blocks of memory and pages within the blocks of memory. In some embodiments, the erase counter 155 may be configured to count / track erase cycles (also referred to as “program / erase cycles”) for the blocks of memory included in the memory 140 of the storage device 120. Since a useful lifetime of a particular block of memory includes a finite number of erase cycles, the erase counter 155 for the particular block of memory may be incremented each time the particular block of memory is erased.
[0034] Because the erase counter 155 for the particular block of memory is incremented each time the particular block of memory is erased, the memory controller 150 may determine that a number of erase cycles for the particular block of memory is relatively high based on a value of the erase counter 155 for the particular block of memory. In some embodiments, the memory controller 150 may determine that the number of erase cycles for the particular block of memory is greater than a threshold number of erase cycles. Since the number of erase cycles for the particular block of memory is relatively high, additional erase cycles for the particular block of memory may cause of the particular block of memory to become increasingly unreliable. In order to reduce additional erase cycles, the memory controller 150 may be configured to avoid performance of a “garbage collection” procedure with respect to the particular block of memory.
[0035] In an example, the processor 110 issues a request to write user data to a first page (that is marked “free”) of any block of memory that is included in the memory 140. For instance, the first page may or may not be in the particular block of memory included in the memory 140. However, the user data is already written to a second page of the particular block of memory and the second page is marked as “stale” (e.g., invalid). In this example, the memory controller 150 receives the request to write the user data to the first page and the memory controller 150 generates error correction code data for the user data. This error correction code data approximately matches the user data. If the error correction code data for the user data matches error correction code data for other data, then the user data may match the other data and additional comparisons can be performed to confirm whether or not the user data matches the other data.
[0036] In some embodiments, the cache 152 may include error correction code data for data in pages of the particular block of memory as well as error correction code data for data in pages of other blocks of memory included in the memory 140. In some embodiments, the memory controller 150 may retain error correction code data for corresponding instances of data in pages of the particular block of memory as part of performing read operations relative to the particular block of memory. Similarly, the memory controller 150 may retain error correction code data for corresponding instances of data in pages of the other blocks of memory as part of performing read operations relative to the other blocks of memory. After generating the error correction code data for the user data, the memory controller 150 may compare the error correction code data for the user data to the error correction code data included in the cache 152 that corresponds to the data in the pages of the particular block of memory and the other blocks of memory.
[0037] The memory controller 150 matches the error correction code data for the user data with the error correction code data for the data in the second page of the particular block of memory. In some embodiments, memory controller 150 compares the user data and the data in the second page (or sectors / segments of the user data and sectors / segments of the data in the second page) in order to determine that the user data matches the data in the second page of the particular block of memory that is marked as “stale.” Since the user data is already written to the second page of the particular block of memory, the memory controller 150 does not write the user data to the first page (marked “free”) as requested from the processor 110. Instead, the memory controller 150 marks the second page of the particular block of memory as “programmed” (e.g., valid). In some embodiments, the memory controller 150 updates the memory management unit 160 such that the memory management unit 160 associates a physical block address (PBA) of the second page with a logical block address (LBA) of the user data.
[0038] By marking the second page of the particular block of memory as “programmed” rather than writing the user data to the first page of the particular block of memory, a “garbage collection” procedure for the particular block of memory may be avoided. For example, the particular block of memory is less likely to have a number of invalid pages exceed a threshold number of invalid pages for performing the “garbage collection” procedure. Avoiding the “garbage collection” procedure also avoids an erase cycle for the particular block of memory which has a relatively high number of erase cycles. This improves overall performance of the memory 140 and may extend the useful lifetime of the particular block of memory.
[0039] FIGS. 2A, 2B, and 2C illustrate examples of memory operations, according to embodiments of the disclosure. FIG. 2A illustrates a representation of a first block 202 of memory and a second block 204 of memory. As shown in FIG. 2A, the first block 202 of memory includes pages 211-222 and the second block 204 of memory includes pages 231-242. It is to be appreciated that, in some embodiments, the pages 211-222 of the first block 202 of memory and the pages 231-242 of the second block 204 of memory can be written to and read from (e.g., at a page level). It is also to be appreciated that erasing data written to the pages 211-222 or the pages 231-242 is performed at a block level by erasing the first block 202 of memory or the second block 204 of memory, respectively. Accordingly, in order to erase data included in page 211 of the first block 202 of memory, data included in each of the pages 211-222 (if any) is erased (e.g., at the block level).
[0040] In the illustrated example, pages 215-222 of the first block 202 of memory are marked as “free” indicating that data can be written to the pages 215-222 while pages 211-214 of the first block 202 of memory include data that may not be overwritten. For instance, the page 211 includes data “A,” the page 212 includes data “B,” the page 213 includes data “C,” and the page 214 includes data “D.” As shown, the pages 231-242 of the second block 204 of memory are each marked as “free” such that data can be written to the pages 231-242.
[0041] FIG. 2B illustrates a representation of the first block 202 of memory and the second block 204 of memory with additional data written to the first block 202 of memory relative to (e.g., at a later time than) the example shown in FIG. 2A. The pages 215-222 previously marked as “free” now include data such that the page 215 includes data “E,” the page 216 includes data “F,” the page 217 includes data “G,” and the page 218 includes data “H.” As shown, the page 219 includes data “A'” which supersedes data “A” included in the page 211. Since data “A” has been replaced by data “A'” in the first block 202 of memory, the page 211 is marked as “stale” to indicate that data “A” is invalid.
[0042] Similarly, the page 220 includes data “B'” which supersedes data “B” included in the page 212; the page 221 includes data “C'” which supersedes data “C” included in the page 213; and the page 222 includes data “D'” which supersedes data “D” included in the page 214. Accordingly, the page 212 is marked as “stale” to indicate that data “B” is invalid; the page 213 is marked as “stale” to indicate that data “C” is invalid; and the page 214 is marked as “stale” to indicate that data “D” is invalid. As illustrated in FIG. 2B, the pages 231-242 of the second block 204 of memory are each marked as “free” such that data may be written to the pages 231-242.
[0043] It is to be appreciated that, in some embodiments, although the pages 211-214 are marked as “stale” in the first block 202 of data, the pages 211-214 are not usable (e.g., data in the pages 211-214 may not be overwritten) without erasing the first block 202 of memory. However, the first block 202 of memory also includes the pages 215-222 with valid data that may be lost by erasing the first block 202 of memory. In some embodiments, in order to retain the data in the pages 215-222 and enable use of the pages 211-214, the memory controller 125 may perform a “garbage collection” procedure in which the memory controller 125 writes the valid data in the pages 215-222 to pages of the second block 204 of memory and then erases the first block 202 of memory.
[0044] It should be appreciated that performing the “garbage collection” procedure results in an erase cycle for the first block 202 of memory and a corresponding decrease in the useful lifetime of the first block 202 of memory. It should also be appreciated that performing the “garbage collection” procedure causes a “garbage collection” event by reading the data in the pages 215-222 and then writing that data to the pages of the second block 204 of memory. These additional reads / writes are referred to as a “garbage collection” event or a “write amplification” because they are additive to the intended write operation.
[0045] FIG. 2C illustrates a representation of the first block 202 of memory and the second block 204 of memory after the “garbage collection” procedure has been performed. As shown, since the first block 202 of memory has been erased, the pages 211-222 are marked as “free” indicating that data can be written to the pages 211-222. In the second block 204 of memory, the pages 231-234 are also marked as “free” and data is included in the pages 235-242. For instance, the page 235 includes data “E,” the page 236 includes data “F,” the page 237 includes data “G,” the page 238 includes data “H,” the page 239 includes data “A',” the page 240 includes data “B',” the page 241 includes data “C',” and the page 242 includes data “D'.”
[0046] FIGS. 3A and 3B illustrate an example of a request to write data, according to embodiments of the disclosure. FIG. 3A illustrates a representation depicting the first block 202 of memory included in the memory 140. The first block 202 of memory is illustrated to include the pages 211-213 that are marked as “free” and the pages 214-222 that are marked as “stale” which indicates that data in the pages 214-222 is invalid. As described above, the first block 202 of memory has a finite useful lifetime and this useful lifetime is reduced by each erase cycle for the first block 202 of memory. In some embodiments, the memory controller 150 accesses the erase counter 155 for the first block 202 of memory and determines that a number of erase cycles for the first block 202 of memory is relatively high.
[0047] In some embodiments, the memory controller 150 optionally determines that the number of erase cycles for the first block 202 of memory is greater than a threshold number of erase cycles. It should be appreciated that, in some embodiments, the threshold number of erase cycles may or may not be a fixed number of erase cycles. For instance, the threshold number may vary for different scenarios involving blocks of the memory 140 having useful lifetimes with different finite numbers of erase cycles. It is also to be appreciated that, in some embodiments, the memory controller 150 does not necessarily determine that the number of erase cycles for the first block 202 of memory is greater than the threshold number of erase cycles. Rather, in some embodiments, the memory controller 150 may be configured to reduce erase cycles for the first block 202 of memory regardless of the number of erase cycles for the first block 202 of memory or without first determining that the number of erase cycles for the first block 202 of memory is greater than the threshold number of erase cycles.
[0048] Consider an example in which the number of erase cycles for the first block 202 of memory is relatively high. In this example, since the number of erase cycles for the first block 202 of memory is relatively high, additional erase cycles for the first block 202 of memory should be avoided because the additional erase cycles may cause the first block 202 of memory to become unreliable and unusable. As described above, the memory controller 150 may be configured to reduce the additional erase cycles by avoiding a “garbage collection” procedure for the first block 202 of memory. In an example, the memory controller 150 may reduce a likelihood of the “garbage collection” procedure by marking one of the pages 214-222 (marked as “stale”) as “programmed.”
[0049] In addition or alternative to determining the number of erase cycles for the first block 202 of memory, the memory controller 150 may determine whether or not a majority of the pages 211-222 are marked as “stale.” If the memory controller 150 determines that the majority of the pages 211-222 are marked as “stale,” then marking one of the pages 214-222 (marked as “stale”) as “programmed” may cause less than the majority of the pages 211-222 to be marked as “stale.” For instance, causing less than the majority of the pages 211-222 to be marked as “stale” reduces the likelihood of the “garbage collection” procedure for the first block 202 of memory.
[0050] As shown in FIG. 3A, the memory controller 150 receives a request to write user data 302 to a first page (e.g., the page 213) of the first block 202 of memory. For instance, the pages 211-213 are marked as “free” indicating that data can be written to the pages 211-213. In the illustrated example, the pages 214-222 are marked as “stale” indicating that the pages 214-222 are invalid (e.g., data included in the pages 214-222 may have been superseded). As described above, data included in the pages 214-222 may not be overwritten yet, as this data is erasable at a block level (e.g., by erasing the first block 202 of memory).
[0051] In some embodiments, upon receiving the request to write the user data 302 to the first page (e.g., the page 213) of the first block 202 of memory, the memory controller 150 generates error correction code data 310 for the user data 302. For instance, the error correction code data 310 may correspond to the user data 302 such that if the error correction code data 310 matches error correction code data of other data, then the user data 302 may match the other data but the user data 302 does not necessarily match the other data. In some embodiments, if the error correction code data 310 matches the error correction code data of the other data, then the user data 302 is compared to the other data to confirm whether or not the user data 302 matches the other data. It is to be appreciated that, in some embodiments, a size of the error correction code data 310 is a fraction of a size of the user data 302 (e.g., the size of the error correction code data 310 is significantly smaller than the size of the user data 302). Accordingly, in some embodiments, error correction code data for particular data is stored in a page of a block of the memory 140 along with the particular data.
[0052] In the example shown in FIG. 3A, the page 214 includes error correction code data 312 for data stored in the page 214 which is marked as “stale.” Similarly, the pages 215-222 include error correction code data 313-320, respectively, for corresponding data stored in the pages 215-222. In some embodiments, the memory controller 150 generates the error correction code data 312-320 for the corresponding data before storing both the error correction code data 312-320 and the corresponding data in the pages 214-222, respectively.
[0053] The cache 152 is illustrated to include the error correction code data 312-320. In some embodiments, the error correction code data 312-320 may be efficiently written to the cache 152 (e.g. by the memory controller 150) during read operations performed relative to the first block 202 of memory included in the memory 140. While the cache 152 includes the error correction code data 312-320 in the illustrated example, it is to be appreciated that, in some embodiments, the cache 152 may include only a portion or a subset of the error correction code data 312-320 or the cache 152 may not include the error correction code data 312-320.
[0054] Consider an example in which the memory controller 150 receives the request to write the user data 302 to the first page (e.g., the page 213) of the first block 202 of memory. Based on receiving the request, the memory controller 150 determines that the number of erase cycles for the first block 202 of memory is greater than the threshold number of erase cycles or that the majority of the pages 211-222 of the first block 202 of memory are marked as “stale” as described above. In this example, reducing erase cycles for the first block 202 of memory may increase / extend the useful lifetime of the first block 202 of memory and / or the memory 140.
[0055] Continuing the example, before the memory controller 150 writes the user data 302 and the error correction code data 310 to the first page (e.g., the page 213) of the first block 202 of memory, the memory controller 150 determines whether the user data 302 is included in any of the pages 214-222 marked as “stale” in the first block 202 of memory. To do so in this example, the memory controller 150 compares the error correction code data 310 for the user data 302 with the error correction code data 312-320 included in the cache 152. It is to be appreciated that, in some embodiments, the error correction code data 312-320 approximately matches the corresponding data stored in the pages 214-222, respectively. Accordingly, the memory controller 150 may identify particular data included in one of the pages 214-222 that may match the user data 302 by matching the error correction code data 310 for the user data 302 with error correction code data for the particular data.
[0056] In the example depicted in FIG. 3A, the memory controller 150 matches the error correction code data 310 for the user data 302 with the error correction code data 314 for the data included in the page 216. Thus, the user data 302 may match the data included in the page 216 that is marked as “stale.” To confirm whether the user data 302 does match the data included in the page 216, the memory controller 150 may be configured to compare the user data 302 and the data included in the page 216. If the user data 302 and the data included in the page 216 match one another in this comparison, then the memory controller 150 may determine that the user data 302 matches the data included in the page 216 that is marked as “stale.” It should be appreciated that, in some embodiments, the memory controller 150 may compare portions of the user data 302 with corresponding portions of the data included in the page 216 or the memory controller 150 may compare an entirety of the user data 302 with an entirety of the data included in the page 216 to confirm that the user data 302 matches the data included in the page 216. In some embodiments, the memory controller 150 leverage one or more existing systems for comparing the user data 302 with the data included in the page 216 such as systems for identifying error correction code data collisions in which the same error correction code data corresponds to multiple different data instances.
[0057] FIG. 3B illustrates a representation depicting the first block 202 of memory included in the memory 140. As shown, the memory controller 150 has determined that the error correction code data 310 matches the error correction code data 314. Based on determining that the error correction code data 310 matches the error correction code data 314, the memory controller 150 compares the user data 302 to the data included in page 216 by comparing the user data 302 and the data included in the page 216. In FIG. 3B, the memory controller 150 has determined that the data included in the page 216 matches the user data 302.
[0058] In some embodiments, the memory controller 150 does not write the user data 302 or the error correction code data 310 to the first page (e.g., the page 213) of the first block 202 of memory as requested. For instance, writing the user data 302 to one of the pages 211-213 of the first block 202 of memory marked as “free” would duplicate the user data 302 within the first block 202 of memory because this data is included in the page 216. In the illustrated example, instead of writing the user data 302 (and the error correction code data 310) to the first page (e.g., the page 213) of the first block 202 of memory, the memory controller 150 causes the page 216 to be marked as “programmed” which indicates that the data included in the page 216 is valid. Additionally, the memory controller 150 updates the memory management unit 160 based on marking the page 216 as “programmed” and the memory management unit 160 causes an LBA associated with the user data 302 in the write request to be associated with a PBA of the page 216 which is “re-validated” instead of a PBA of the first page (e.g., the page 213). Accordingly, the data included in the page 216 has been “reclaimed” from being marked as “stale” and invalid to being marked as “programmed” and valid. In some embodiments, by causing the page 216 to be marked as “programmed,” the memory controller 150 has avoided performing one or more procedures (e.g., “garbage collections”) that may decrease / reduce the useful lifetime of the first block 202 of memory and / or the memory 140.
[0059] FIGS. 4A and 4B illustrate an example of a request to read data, according to embodiments of the disclosure. FIG. 4A illustrates a representation including the first block 202 of memory that is included in the memory 140. In FIG. 4A, the memory controller 150 receives a request to read data from the page 217 of the first block 202 of memory. Unlike the example in FIG. 3A in which the error correction code data 312-320 is included in the cache 152, in FIG. 4A, the cache 152 does not include the error correction code data 312-320 or a portion / subset of this data. In order to efficiently write error correction code data to the cache 152, the memory controller 150 reads the data from the page 217 and the error correction code data 315 for the data in the page 217.
[0060] FIG. 4B illustrates a representation showing the first block 202 of memory included in the memory 140. In some embodiments, after reading the data and the error correction code data 315 from the page 217, the memory controller 150 may determine whether or not the described systems and techniques for error correction code data matching are enabled for the first block 202 of memory. For instance, if the described systems and techniques are enabled for the first block 202 of memory, then the memory controller 150 may retain a copy of the error correction code data 315 from the page 217 by writing the error correction code data 315 to the cache 152.
[0061] It should be appreciated that, in some embodiments, writing the error correction code data 315 to the cache 152 as part of reading the data from the page 217 is an efficient operation with minimal overhead (e.g., consumes minimal compute / memory resources) and also causes the error correction code data 315 to be available to the memory controller 150 with minimal latency. It should also be appreciated that there are various techniques for including the error correction code data 315 in the cache 152 which may be less efficient than leveraging the read operation as described above. In some embodiments, the memory controller 150 may update the memory management unit 160 to identify an open block of the memory 140 with pages marked as “free” for write operations.
[0062] FIG. 5 illustrates example logic 500 for receiving a write request, according to embodiments of the disclosure. As shown in FIG. 5, at operation 502, a memory write operation is requested for a page inside of a block of memory. At operation 504, a memory controller receives user data and generates error correction code data for the user data. At optional operation 506, it is determined whether a majority of pages inside of the block of memory are marked as “stale” or a number of erase cycles for the block of memory is relatively high. If the majority of the pages inside of the block of memory are not marked as “stale” and the number of erase cycles for the block of memory is not relatively high (no), then the logic 500 may optionally continue to operation 508. At optional operation 508, the memory controller writes the user data and the generated error correction code data for the user data to the page inside of the block of memory; and the memory controller updates a memory management unit and marks the page inside of the block of memory as “programmed.” At operation 510, the memory write operation ends.
[0063] If the majority of the pages inside of the block of memory are marked as “stale” (yes) or the number of erase cycles for the block of memory is relatively high (yes) (or if optional operation 506 is not used), then the logic 500 may continue to operation 512. At operation 512, it is determined whether the generated error correction code data for the user data matches any error correction code data included in the pages inside the block of memory marked as “stale.” If the generated error correction code for the user data does not match any of the error correction code data marked as “stale” (no), then the logic 500 may continue to operation 514. At operation 514, a “garbage collection” event is caused and an open block (a different block) of memory is selected for the memory write operation; the memory controller writes the user data and the generated error correction code data for the user data to a page inside of the different block of memory; the memory controller updates the memory management unit and marks the page inside of the different block of memory as “programmed;” and the memory controller marks the block of memory for erase (e.g., to be erased). At operation 510, the memory write operation ends.
[0064] If the generated error correction code data for the user data does match an instance of the error correction code data marked as “stale” (yes), then the logic 500 may continue to operation 516. At operation 516, it is determined whether the user data matches the stale data. In some embodiments, at operation 516, an entirety of the user data is compared to an entirety of the stale data. In some embodiments, at operation 516, the user data is compared to the stale data. In some embodiments, at operation 516, various types of comparisons may be performed to determine whether the user data matches the stale data. If the user data does not match the stale data (no), then the logic 500 may continue to operation 514. If the user data does match the stale data (yes), then the logic 500 may continue to operation 518. At operation 518, the memory controller skips a NAND device write operation; and the memory controller updates the memory management unit and marks the page inside of the block as “programmed.” At operation 510, the memory write operation ends.
[0065] FIG. 6 illustrates example logic 600 for receiving a read request, according to embodiments of the disclosure. As shown in FIG. 6, at operation 602, a memory read operation is requested for a page inside of a block of memory. At operation 604, a memory controller generates a NAND device read request with data and error correction code data for the data. At optional operation 606, it is determined whether a majority of pages inside of the block of memory are marked as “stale” or a number of erase cycles for the block of memory is relatively high. If the majority of the pages inside of the block of memory are not marked as “stale” and the number of erase cycles for the block of memory is not relatively high (no), then the logic 600 may continue to optional operation 608. At optional operation 608, the memory controller retains a copy of error correction code data of any invalidated page and writes the error correction code data of invalided pages to a cache memory; the cache memory maintains a list of known recently invalided pages; the memory controller reads data in the page inside of the block of memory and checks error correction code data in the page; the memory controller sends / transmits autocorrected user data from the page data to a system application; and the memory controller updates a memory management unit and marks the page as “stale” inside of the block of memory. At operation 610, the memory read operation ends.
[0066] If the majority of the pages inside of the block of memory are marked as “stale” (yes) or the number of erase cycles for the block of memory is relatively high (yes), then the logic 600 may continue to optional operation 612. At optional operation 612, the memory controller retains a copy of error correction code data of any invalidated page and writes the error correction code data of invalided pages to a cache memory; the cache memory maintains a list of known recently invalided pages; the memory controller reads data in the page inside of the block of memory and checks error correction code data in the page; and the memory controller sends / transmits autocorrected user data from the page data to a system application. At operation 614, the memory controller retains a copy of the error correction code data from the page inside the block of memory and writes the error correction code data to a cache memory (e.g., the cache 152); and the memory controller includes the block of memory for future write operations based on an error correction code data matching queue. At operation 610, the memory read operation ends.
[0067] FIG. 7 illustrates example logic 700 for writing error correction code data for data in invalidated pages to a cache memory, according to embodiments of the disclosure. At operation 702, a memory operation is requested for a block and the logic 700 may continue to operation 704. At operation 704, it is determined whether a page has been invalidated. If a page has not been invalidated (no), then the logic 700 may continue to operation 706. At operation 706, the operation is performed for the block. At operation 708, the memory operation ends.
[0068] At operation 704, if a page has been invalidated (yes), then the logic 700 may continue to operation 710. At operation 710, error correction code data for data in the invalidated page is written to a cache memory; a list of known recently invalidated pages is maintained in the cache memory. At operation 706, the operation is performed for the block. At operation 708, the memory operation ends.
[0069] FIG. 8 shows a flowchart of a first example procedure 800 for receiving a write request, according to embodiments of the disclosure. At block 802, a first request to write user data to a first page of a first block 202 of memory is received, a number of erase cycles for the first block 202 of memory is greater than a threshold number of erase cycles. At block 804, first error correction code data is generated for the user data. At block 806, the first error correction code data is matched with second error correction code data of a second page of the first block 202 of memory. At block 808, the second page is caused to be marked as programmed.
[0070] FIG. 9 shows a flowchart of a second example procedure for receiving a write request, according to embodiments of the disclosure. At block 902, a request is received to write user data to a first page of a first block 202 of memory. At block 904, first error correction code data is generated for the user data. At block 906, the first error correction code data is compared to instances of error correction code data included in a cache of a memory controller. At block 908, a second page of a second block of memory is identified based on comparing the first error correction code data to the instances of error correction code data, the second page marked as stale. At block 910, the second page is caused to be marked as programmed.
[0071] FIG. 10 shows a flowchart of a third example procedure 1000 for receiving a write request, according to embodiments of the disclosure. At block 1002, a first request to write first data to a first page of a first block 202 of memory is received, a number of erase cycles for the first block 202 of memory is greater than a threshold number of erase cycles. At block 1004, first error correction code data is generated for the first data. At block 1006, the first error correction code data is compared with error correction code data of pages of the first block 202 of memory. At block 1008, the first data is written to a page of a second block 204 of memory.
[0072] In FIGS. 8-10, some embodiments of the disclosure are shown. But a person skilled in the art will recognize that other embodiments of the disclosure are also possible, by changing the order of the blocks, by omitting blocks, or by including links not shown in the drawings. All such variations of the flowcharts are considered to be embodiments of the disclosure, whether expressly described or not.
[0073] The following discussion is intended to provide a brief, general description of a suitable machine or machines in which certain aspects of the disclosure may be implemented. The machine or machines may be controlled, at least in part, by input from conventional input devices, such as keyboards, mice, etc., as well as by directives received from another machine, interaction with a virtual reality (VR) environment, biometric feedback, or other input signal. As used herein, the term “machine” is intended to broadly encompass a single machine, a virtual machine, or a system of communicatively coupled machines, virtual machines, or devices operating together. Exemplary machines include computing devices such as personal computers, workstations, servers, portable computers, handheld devices, telephones, tablets, etc., as well as transportation devices, such as private or public transportation, e.g., automobiles, trains, cabs, etc.
[0074] The machine or machines may include embedded controllers, such as programmable or non-programmable logic devices or arrays, application specific integrated circuits (ASICs), embedded computers, smart cards, and the like. The machine or machines may utilize one or more connections to one or more remote machines, such as through a network interface, modem, or other communicative coupling. Machines may be interconnected by way of a physical and / or logical network, such as an intranet, the Internet, local area networks, wide area networks, etc. One skilled in the art will appreciate that network communication may utilize various wired and / or wireless short range or long range carriers and protocols, including radio frequency (RF), satellite, microwave, Institute of Electrical and Electronics Engineers (IEEE) 802.11, Bluetooth®, optical, infrared, cable, laser, etc.
[0075] Embodiments of the present disclosure may be described by reference to or in conjunction with associated data including functions, procedures, data structures, application programs, etc. which when accessed by a machine results in the machine performing tasks or defining abstract data types or low-level hardware contexts. Associated data may be stored in, for example, the volatile and / or non-volatile memory, e.g., random access memory (RAM), read only memory (ROM), etc., or in other storage devices and their associated storage media, including hard-drives, floppy-disks, optical storage, tapes, flash memory, memory sticks, digital video disks, biological storage, etc. Associated data may be delivered over transmission environments, including the physical and / or logical network, in the form of packets, serial data, parallel data, propagated signals, etc., and may be used in a compressed or encrypted format. Associated data may be used in a distributed environment, and stored locally and / or remotely for machine access.
[0076] Embodiments of the disclosure may include a tangible, non-transitory machine-readable medium comprising instructions executable by one or more processors, the instructions comprising instructions to perform the elements of the disclosures as described herein.
[0077] The various operations of methods described above may be performed by any suitable means capable of performing the operations, such as various hardware and / or software component(s), circuits, and / or module(s). The software may comprise an ordered listing of executable instructions for implementing logical functions, and may be embodied in any “processor-readable medium” for use by or in connection with an instruction execution system, apparatus, or device, such as a single or multiple-core processor or processor-containing system.
[0078] The blocks or steps of a method or algorithm and functions described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. If implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a tangible, non-transitory computer-readable medium. A software module may reside in random access memory (RAM), flash memory, read only memory (ROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), registers, hard disk, a removable disk, or any other form of storage medium known in the art.
[0079] Having described and illustrated the principles of the disclosure with reference to illustrated embodiments, it will be recognized that the illustrated embodiments may be modified in arrangement and detail without departing from such principles, and may be combined in any desired manner. And, although the foregoing discussion has focused on particular embodiments, other configurations are contemplated. In particular, even though expressions such as “according to an embodiment of the disclosure” or the like are used herein, these phrases are meant to generally reference embodiment possibilities, and are not intended to limit the disclosure to particular embodiment configurations. As used herein, these terms may reference the same or different embodiments that are combinable into other embodiments.
[0080] The foregoing illustrative embodiments are not to be construed as limiting the disclosure thereof. Although a few embodiments have been described, those skilled in the art will readily appreciate that many modifications are possible to those embodiments without materially departing from the novel teachings and advantages of the present disclosure. Accordingly, all such modifications are intended to be included within the scope of this disclosure as defined in the claims.
[0081] Consequently, in view of the wide variety of permutations to the embodiments described herein, this detailed description and accompanying material is intended to be illustrative only, and should not be taken as limiting the scope of the disclosure. What is claimed as the disclosure, therefore, is all such modifications as may come within the scope and spirit of the following claims and equivalents thereto.
Claims
1. A method comprising:receiving, by a memory controller, a first request to write user data to a first page of a first block of memory;generating, by the memory controller, first error correction code data for the user data;matching, by the memory controller, the first error correction code data with second error correction code data of a second page of the first block of memory; andcausing, by the memory controller, the second page to be marked as programmed.
2. The method according to claim 1, further comprising determining a number of erase cycles for the first block of memory is greater than a threshold number of erase cycles.
3. The method according to claim 1, further comprising comparing the first error correction code data with third error correction code data of a third page of the first block of memory.
4. The method according to claim 1, wherein the second error correction code data is included in a cache of the memory controller.
5. The method according to claim 1, further comprising:marking a third page of the first block of memory as stale; andwriting third error correction code data of the third page to a cache of the memory controller.
6. The method according to claim 1, further comprising comparing the first error correction code data to instances of error correction code data included in a cache of the memory controller.
7. The method according to claim 6, wherein the instances of error correction code data correspond to data in pages marked as stale.
8. The method according to claim 1, further comprising determining that a majority of pages of the first block of memory are marked as stale.
9. A method comprising:receiving a request to write user data to a first page of a first block of memory;generating first error correction code data for the user data;comparing the first error correction code data to instances of error correction code data included in a cache of a memory controller;identifying a second page of a second block of memory based on comparing the first error correction code data to the instances of error correction code data, the second page marked as stale; andcausing the second page to be marked as programmed.
10. The method according to claim 9, further comprising:marking a third page of a third block of memory as stale; andwriting third error correction code data of the third page to the cache.
11. The method according to claim 9, further comprising matching the first error correction code data with second error correction code data of the second page.
12. The method according to claim 11, wherein identifying the second page is based on matching the first error correction code data with the second error correction code data.
13. The method according to claim 9, further comprising comparing the user data to data included in the second page.
14. The method according to claim 13, further wherein identifying the second page is based on comparing the user data to the data included in the second page.
15. The method according to claim 9, further comprising determining a number of erase cycles for the first block of memory is greater than a threshold number of erase cycles.
16. A method comprising:receiving, by a memory controller, a first request to write first data to a first page of a first block of memory;generating, by the memory controller, first error correction code data for the first data;comparing, by the memory controller, the first error correction code data with error correction code data of pages of the first block of memory; andwriting, by the memory controller, the first data to a page of a second block of memory.
17. The method according to claim 16, wherein the error correction code data of the pages of the first block of memory is included in a cache of the memory controller.
18. The method according to claim 16, further comprising determining a number of erase cycles for the second block of memory is greater than a threshold number of erase cycles.
19. The method according to claim 16, further comprising:receiving a second request to write second data to the first page of the first block of memory; andgenerating second error correction code data for the second data.
20. The method according to claim 19, further comprising:matching the second error correction code data with third error correction code data of a third page of the first block of memory; andcausing the third page to be marked as programmed.
