Speeding up transactions in non-volatile memory using hardware transactional memory
US-2019129716-A1 · May 2, 2019 · US
US11989090B2 · US · B2
| Field | Value |
|---|---|
| Publication number | US-11989090-B2 |
| Application number | US-202017763926-A |
| Country | US |
| Kind code | B2 |
| Filing date | Jun 16, 2020 |
| Priority date | May 14, 2020 |
| Publication date | May 21, 2024 |
| Grant date | May 21, 2024 |
A practical reading order for non-experts. Skip the full description unless you need deep technical detail.
What the patent document calls the invention.
A short plain-language summary of the technical disclosure.
Who owns or filed the patent and who is credited as inventor.
Filing, priority, publication, and grant dates set the timeline.
The legal scope of protection — read this for what is actually claimed.
Technology tags used to group this patent with similar filings.
Prior art links and similar publications in this corpus.
Official abstract text for this publication.
Disclosed in the present invention are a method and a system for ensuring the failure atomicity in a non-volatile memory, which belong to the field of computer storage. The method comprises: executing transactions encapsulated by one or more operations that need to ensure the failure atomicity in accordance with the following steps: executing operations in a current transaction in sequence, for each write operation in the current transaction, determining whether the oldest value of its corresponding data is saved into a log of the non-volatile memory, if so, then creating an UndoRedo log entry for it, otherwise creating a Redo log entry for it; using corresponding log management strategies according to types of log entries; after all operations are executed, committing the current transaction; and completing the execution of the current transaction; wherein information recorded in the UndoRedo log entries comprises: transaction number, write operation address, and oldest value and new value of corresponding data; and information recorded in the Redo log entries comprises: transaction number, write operation address, and new value of corresponding data. The present invention can reduce the overhead caused by ensuring the failure atomicity in the NVMM.
Opening claim text (preview).
The invention claimed is: 1. A method for ensuring failure atomicity in a non-volatile memory, the method comprising: executing transactions encapsulated by one or more operations that need to ensure the failure atomicity in accordance with the following steps: (S 1 ) executing operations in a current transaction in sequence, for each write operation in the current transaction, if the oldest value of its corresponding data has not been saved into a log of the non-volatile memory, then creating an UndoRedo log entry for it, and if the oldest value of its corresponding data has been saved into the log of the non-volatile memory, then creating a Redo log entry for it; wherein while log entries are created, the log entries are managed by using corresponding log management strategies according to types of log entries; (S 2 ) after all operations in the current transaction are executed, committing the current transaction; and (S 3 ) completing the execution of the current transaction; wherein information recorded in the UndoRedo log entries comprises: transaction number, write operation address, and oldest value and new value of corresponding data; information recorded in the Redo log entries comprises: transaction number, write operation address, and new value of corresponding data; and the oldest value of data is a value of the data when the current transaction just starts to be executed, and the new value of data is a value of the data after the execution of a corresponding write operation is completed; wherein an active log cache and a lazy log cache are added in a processor of the non-volatile memory; and the log management strategies comprise: active write-back strategies and lazy write-back strategies; and in the step (S 1 ), an active write-back strategy is used to manage the UndoRedo log entries, and a lazy write-back strategy is used to manage the Redo log entries; wherein using the active write-back strategy to manage the UndoRedo log entries comprises: after an UndoRedo log entry is created, it being first cached in the active log cache, and then written back to the non-volatile memory after a preset time interval; and the time interval is less than the time required for the data to be written from a first-level cache of the processor back to the non-volatile memory; and using the lazy write-back strategy to manage the Redo log entries comprises: after a Redo log entry is created, it being first cached in the first-level cache of the processor, and when a cache line where the Redo log entry is located is evicted or updated by other transactions, the Redo log entry being cached in the lazy log cache; and when the lazy log cache is full, the Redo log entry in the lazy log cache being written back to the non-volatile memory; and log entries with the same transaction number and write operation address will be merged by the lazy write-back strategy during managing the Redo log entries. 2. The method for ensuring the failure atomicity in the non-volatile memory as claimed in claim 1 , wherein log entries with the same transaction number and write operation address will be merged by the active write-back strategy during managing the UndoRedo log entries. 3. The method for ensuring the failure atomicity in the non-volatile memory as claimed in claim 1 , wherein the log entry in the active log cache or lazy log cache being written back to the non-volatile memory comprises: using a plurality of different encoding strategies suitable for the non-volatile memory in parallel to encode the log entry to be written to the non-volatile memory, and then selecting an encoding result with the smallest write overhead to write to the non-volatile memory. 4. The method for ensuring the failure atomicity in the non-volatile memory as claimed in claim 1 , wherein the encoding strategy used when the log entry in the active log cache or the lazy log cache is written back to the non-volatile memory comprises a differential log data compression strategy; and a method for the differential log data compression strategy to execute encoding comprises: discarding a part of the data value that has not changed before and after update of the write operation corresponding to the log entry, then compressing the remaining parts, and using a compression result as an encoding result of the log entry. 5. The method for ensuring the failure atomicity in the non-volatile memory as claimed in claim 1 , wherein in the step (S 2 ), committing the current transaction comprises: (S21) according to system settings, determining whether the persistence of the transaction needs to be ensured when the transaction is committed, if the persistence of the transaction needs to be ensured, then going to step (S22); and if the persistence of the transaction does not need to be ensured, then going to step (S23); (S22) writing all log entries belonging to the current transaction in the active log cache, the lazy log cache, and the first-level cache of the processor back to the non-volatile memory; and (S23) after creating a commit record of the current transaction, writing the commit record of the current transaction in a log area of the non-volatile memory; wherein information recorded in the commit record comprises: transaction number, log entry count, and ULog count; the log entry count is the number of log entries whose current transaction is located in the active log cache, the lazy log cache, and the non-volatile memory when the commit record is created; the ULog count is the number of pieces of data belonging to the current transaction and being in a ULog state in the first-level cache when the commit record is created, and the ULog state indicates that the data has been updated by the current transaction, and the oldest value of the data is saved into the log of the non-volatile memory, whereas the new value of the data is not saved into the log of the non-volatile memory. 6. The method for ensuring the failure atomicity in the non-volatile memory as claimed in claim 5 , wherein the method further comprises: executing transaction recovery in accordance with the following steps: (R1) according to system settings, determining whether the persistence of the transaction needs to be ensured when the transaction is committed, if the persistence of the transaction needs to be ensured, then going to step (R2); and if the persistence of the transaction does not need to be ensured, then going to step (R4); (R2) scanning the log area of the non-volatile memory from beginning to end to obtain the commit record of the transaction to be recovered, and the log entries belonging to each transaction in the log area of the non-volatile memory; and for any one transaction to be recovered, if the number of log entries belonging to the transaction in the log area of the non-volatile memory is equal to the log entry count in its commit record, then determining that the transaction has been committed, otherwise determining that the transaction is not committed; (R3) correspondingly copying the new value of the data in the log entry of the transaction that has been committed to a location where the write operation address is recorded, and correspondingly copying the oldest value of the data in the UndoRedo log entry of the transaction that has not been committed to the location where the write operation address is recorded, and after the copying of the data is completed, going to step (R6); (R4) scanning the log area of the non-volatile memory from beginning to end to obtain the commit record of the transaction to be recovered, and the log entries belonging to each transaction in the log area of the non-volatile memory, and for any one transaction to be recovered, if the number of log entries belonging to the transaction in the log area of the non-volatile
in cache or content addressable memories · CPC title
Transaction processing · CPC title
Means for error signaling, e.g. using interrupts, exception flags, dedicated error registers · CPC title
Dumping, i.e. gathering error/state information after a fault for later diagnosis · CPC title
involving logging of persistent data for recovery · CPC title
Related publications grouped by family.
Answers are generated from the same data shown on this page.