Eviction operation for evicting dirty cache lines to persistent memory

By detecting ejection trigger events in the cache hierarchy and writing dirty cache lines to persistent memory, the problem of transaction loss in persistent memory is solved, atomicity is guaranteed under power failure or reset events, and the difficulty and cost of system modification are reduced.

CN116171426BActive Publication Date: 2026-11-27ARM LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202180061605.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2020-09-14
Filing Date
2021-08-16
Publication Date
2026-11-27
Estimated Expiration
2041-08-16

AI Technical Summary

Technical Problem

Existing technologies struggle to ensure the atomicity of transactions when using persistent storage, especially during power outages or reset events, which can lead to the loss of some transaction results in persistent storage and affect the system's fault atomicity.

Method used

By detecting eviction trigger events in the cache hierarchy, scanning a subset of the cache hierarchy to identify dirty cache lines, and writing them to persistent storage, the system prevents the loss of uncommitted transaction results in the event of power failure or reset, and uses backup power to provide energy to support the eviction operation.

Benefits of technology

It ensures the atomicity of transactions in systems using persistent storage, avoids data loss due to power failures or reset events, reduces the cost of hardware and software modifications, and improves system reliability and performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116171426B_ABST
    Figure CN116171426B_ABST
Patent Text Reader

Abstract

An apparatus has processing circuitry (4) that supports transactional memory and a cache hierarchy (110, 112, 118) that includes at least two levels of cache. In response to an eviction trigger event that has the potential to cause loss of state stored in at least one additional level of cache (112, 118) outside of a predetermined level of cache (110) prior to committing the transaction, an eviction circuit (170) performs an eviction operation to scan a subset of the cache hierarchy to identify dirty cache lines and write data associated with the dirty cache lines to persistent storage (124), speculative store data generated by the transaction in the predetermined level of cache being marked as speculative. The subset of the cache hierarchy includes the at least one additional level of cache (112, 118). In the eviction operation, speculative store data marked as speculative in the predetermined level of cache (110) is prevented from being evicted to the persistent storage.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This technology relates to the field of data processing.

[0002] A data processing system can execute multiple data processing threads. Sometimes, threads may need to access shared resources, and the nature of data processing operations may mean that once a thread begins interacting with a shared resource, a set of operations may need to be completed atomically using the resource without any other thread accessing it at the same time.

[0003] One technique for handling such conflicts between threads is to use locks to control exclusive access to at least one target resource. For example, when a thread begins accessing data in a specific address range, it can set a lock variable to declare ownership of the lock, and subsequently, when the thread that owns the lock has ownership, other threads checking the lock variable can determine that the lock has been declared and therefore may be unable to enter the code section interacting with that address range. Such a lock-based approach can be considered pessimistic because each thread is assumed by default not to enter the code section accessing the shared resource, as a conflict with another thread is possible unless it owns the lock, thus guaranteeing no conflict. However, lock identifiers can typically control exclusive access to multiple resources (e.g., address ranges), and therefore there is no guarantee that if one thread is accessing some resources within a set of resources protected by a lock variable, another thread will definitely access the same resources. Therefore, in cases where conflicts between threads are infrequent, lock-based approaches can lead to performance penalties because threads may unnecessarily wait for the lock to be released before entering critical code sections using shared resources.

[0004] A more optimistic approach to handling conflicts between threads accessing shared resources could be using transactional memory support. Data processing systems can have circuitry that supports the execution of transactions within data processing threads. A transaction can be those thread instructions executed between a transaction start instruction (marking the start of a transaction) and a transaction end instruction (marking the end of a transaction). Between the transaction start and end instructions, the processing circuitry can speculatively execute intermediate instructions and prevent the commit of the results of those speculatively executed instructions until the transaction end instruction is reached. An abort event occurring after the transaction start instruction is executed (but before the transaction end instruction is reached) can cause the transaction to be aborted and speculative results to be discarded. There can be many reasons for a transaction to be aborted, but one reason could be the detection of a conflict with a memory access performed by another thread. Therefore, using this approach, each thread can optimistically begin processing critical code sections assuming no conflicts with other threads, and then commit the transaction results upon reaching the end of the critical section without detecting any conflicts. In cases where conflicts are infrequent, using transactional memory support can improve performance by allowing more threads to process their critical code sections concurrently.

[0005] At least some examples provide an apparatus comprising: processing circuitry supporting transaction processing, the transaction including instructions speculatively processed between a transaction start instruction and a transaction end instruction, the processing circuitry configured to prevent the submission of the result of the speculatively processed instructions before the transaction end instruction is reached, in the absence of the transaction being aborted; and a cache hierarchy including at least two levels of cache; wherein: in response to a storage instruction processed within a transaction, the processing circuitry is configured to write speculative storage data into the cache hierarchy, wherein the speculative storage data is marked as speculative to prevent the speculative storage data from being passed across the cache hierarchy before the transaction is submitted. The device includes an evacuation circuit that detects an evacuation trigger event that could cause the loss of state stored in the at least one additional level of cache, and performs an evacuation operation in response to detecting the evacuation trigger event to scan a subset of the cache hierarchy to identify dirty cache lines and write data associated with the dirty cache lines to persistent memory, the subset of the cache hierarchy including the at least one additional level of cache, wherein in the evacuation operation, the evacuation circuit is configured to ensure that dirty cache lines storing speculative stored data marked as speculative in the cache of the predetermined level are prevented from being evacuated to the persistent memory.

[0006] At least some examples provide an apparatus comprising: a component for processing instructions, the component supporting transaction processing, the transaction including instructions speculatively processed between a transaction start instruction and a transaction end instruction, the component for processing being configured to prevent the commit of the result of the speculatively processed instructions before the transaction end instruction is reached, in the absence of the transaction being aborted; and a component for caching data in a cache hierarchy including at least two levels of cache; wherein: in response to a storage instruction processed within a transaction, the component for processing is configured to write speculative storage data to the component for caching, wherein the speculative storage data is marked as speculative to prevent the speculative storage data from being passed across the cache hierarchy before the transaction is committed. The device includes a cache hierarchy that extends beyond a predetermined cache level to at least one additional cache level; and the device includes a component for evacuating cached data to persistent memory, wherein, in response to detecting an evacuation trigger event that could potentially lead to the loss of state stored in the at least one additional cache level, the evacuation component is configured to perform an evacuation operation to scan a subset of the cache hierarchy to identify dirty cache lines and write data associated with the dirty cache lines to the persistent memory, the subset of the cache hierarchy including the at least one additional cache level, wherein, during the evacuation operation, the evacuation component is configured to ensure that dirty cache lines storing speculative stored data marked as speculative in the predetermined cache level are prevented from being evacuated to the persistent memory.

[0007] At least some examples provide a method comprising: processing a transaction including instructions speculatively processed between a transaction start instruction and a transaction end instruction; for the transaction, preventing the commit of the results of the speculatively processed instructions before the transaction end instruction is reached, provided that the transaction is not aborted; and writing speculative storage data to a cache hierarchy including at least two levels of cache in response to storage instructions processed within the transaction, wherein the speculative storage data is marked as speculative to prevent the speculative storage data from being passed across a predetermined level in the cache hierarchy before the transaction is committed. The cache hierarchy extends beyond the cache to at least one additional level of cache; and in response to detecting an eviction trigger event that could lead to the loss of state stored in the at least one additional level of cache, an eviction operation is performed to scan a subset of the cache hierarchy to identify dirty cache lines and write data associated with the dirty cache lines to persistent memory, the subset of the cache hierarchy including the at least one additional level of cache, wherein when the eviction operation is performed, dirty cache lines storing speculative data marked as speculative in the cache of the predetermined level are prevented from being evictioned to the persistent memory.

[0008] Further aspects, features, and advantages of this technology will become apparent from the following description, which is taken in conjunction with the accompanying drawings, in which: Figure 1 An example of a data processing system using persistent memory is illustrated schematically; Figure 2 An example of processing circuitry with transactional memory support is shown; Figure 3 An example of instructions that perform speculative processing within a transaction is shown; Figure 4 This demonstrates the use of a lock-based approach for execution. Figure 3 Alternative examples of operations; Figure 5 An example of a cache line in the Level 1 data cache is shown; Figure 6 It is a flowchart illustrating the processing of a transaction; Figure 7 This is a flowchart illustrating how snooping requests are processed by the first-level data cache; Figure 8 A method for performing a discharge operation in response to a discharge trigger event is shown; Figure 9 An example of an ejection circuit is shown for performing an ejection operation to scan a subset of the cache hierarchy to identify dirty cache lines and write the dirty cache lines to persistent memory, wherein a subset of the cache hierarchy excludes the first-level data cache. Figure 10 An alternative example is shown, in which a subset of the cache hierarchy scanned during the ejection operation includes the first-level data cache; and Figure 11 This is a flowchart illustrating the method for performing the discharge operation.

[0009] The data processing apparatus may have processing circuitry supporting hardware transactional memory, providing the hardware circuitry logic for transaction processing as previously described. The processing circuitry may support transaction processing, which includes instructions speculatively processed between a transaction start instruction and a transaction end instruction, and the processing circuitry may prevent the commit of the results of the speculatively processed instructions before the transaction end instruction is reached, in the absence of transaction abort. The processing circuitry may access a cache hierarchy including at least two levels of caches. In response to a store instruction processed within a transaction, the processing circuitry may write speculative store data into the cache hierarchy, wherein the speculative store data is marked as speculative to prevent the speculative store data from being passed beyond the cache of a predetermined level in the cache hierarchy to at least one additional level of cache before the transaction is committed. Preventing the speculative store data from being passed beyond the cache of a predetermined level while the transaction remains pending helps prevent the speculative store data from becoming visible to threads executing on other processor cores (which share at least one additional level of cache with the core having the processing circuitry) before the transaction is committed, so that the result of the transaction is atomically perceived by other threads.

[0010] Once a transaction is committed, any previously speculative stored data in the intended cache level can then be written back to other cache levels in the cache hierarchy or to main memory. This may occur some time after the transaction is committed, as cache lines in the intended cache level are evicted to make way for other data. Therefore, there may be a period after the transaction is committed during which only a portion of the data generated in the transaction has been written back to main memory, while the rest has not. In typical systems that provide hardware support for transactional memory, this is not a problem because, although for transient periods, the data stored in main memory may only reflect the portion updated by the transaction and therefore does not provide an atomic view of the transaction's effects, this only lasts for a finite period, and simultaneously, accesses from other threads to addresses involved in the transaction will hit higher levels of the cache hierarchy (or trigger snooping on caches associated with other kernels), allowing those other threads to see the latest data generated by the committed transaction. Furthermore, in typical systems that support hardware transactional memory, main memory is usually implemented using volatile memory storage devices such as dynamic random access memory (DRAM). Therefore, even if a power failure occurs during the cycle in which only a transaction-related portion of the stored data has been written back to main memory, the power failure or reset will cause the state saved in main memory to be lost. Thus, when the system is subsequently powered on again after the power failure or reset to the known state in response to the reset event, any partial effect of the transaction will be lost. And therefore, this still does not cause any long-term visibility of the partial effect of the transaction to other threads, and atomicity is thus preserved.

[0011] However, processing systems increasingly utilize persistent memory (PM), where non-volatile memory is used to provide at least a portion of random access memory for storing working data of processes executing on the processing circuitry. This contrasts with traditional systems where non-volatile memory storage devices are typically only accessible using input / output (I / O) mechanisms limited by bulk transfers and relatively slow. Enabling transactional memory to be used in conjunction with PM can be useful, as its functionality can be helpful in ensuring fault atomicity with respect to PM (even for sequential programs, rather than in the presence of multiple parallel threads). With the introduction of PM, any sequential program can be considered to have concurrent observers (recovery observers) within the PM, much like concurrent threads or another processor core can be considered concurrent observers of the state generated by transactions in the previously discussed parallel thread / kernel example. It may be desirable to ensure that updates to the PM caused by sequential code are implemented atomically to ensure fault atomicity. Transactional memory can be a convenient way to achieve this.

[0012] However, typical transactional memory systems do not tend to work well with PMs. When using PMs, data may be written to the PM in response to eviction or write-back from cache lines in a cache hierarchy. This means that, unlike systems that provide non-volatile memory only via I / O ports, the PM can be gradually updated with stored data from committed transactions over a period of time after a transaction is committed. Because the PM is non-volatile, if a power failure or unexpected reset occurs during this period, the PM may be storing partial results of the transaction once the system resumes processing after power has been restored or the reset has been performed, risking loss of atomicity. Therefore, existing systems supporting transactional memory will not work in a plug-and-play manner when replacing or supplementing volatile memory with PMs.

[0013] One technique to address this issue is to require, when processing transactions, to make hardware log trace addresses in the memory management system (PM) involved in the transaction's processing. This allows the hardware log to be used to identify what changes need to be made to the data in the PM upon recovery from a reset or power failure, either in response to the transaction or to implement any remaining changes caused by the transaction that have not yet been flushed to the PM. However, such hardware logs incur performance and power consumption costs. In some examples, dedicated instructions are provided in the instruction set architecture to allow transaction requests to propagate data beyond predetermined cache levels while the transaction remains pending. Compared to designs that do not support PMs, such techniques require significant changes to the cache, memory controller, and / or instruction set architecture, and may therefore be difficult to implement.

[0014] In the example below, the apparatus includes an evacuation circuit that detects an evacuation trigger event that could lead to the loss of state in at least one additional cache level (a cache outside a predetermined level of the cache hierarchy where speculative stored data associated with a pending transaction is marked as speculative). In response to detecting the evacuation trigger event, the evacuation circuit performs an evacuation operation. The evacuation operation includes scanning a subset of the cache hierarchy to identify dirty cache lines and writing the data associated with the dirty cache lines to the PM. The subset of the cache hierarchy involved in the scan for the evacuation operation includes at least one additional cache level outside the point where speculative stored data for a transaction is marked. During the evacuation operation, the evacuation circuit ensures that dirty cache lines storing speculative stored data marked as speculative in the predetermined cache level are prevented from being evacuated to the PM.

[0015] Therefore, some circuitry is provided to scan the cache hierarchy to identify any dirty lines writable to the PM in response to the detection of an ejection trigger event that could potentially lead to state loss. This can be implemented in hardware more easily than the aforementioned changes to the cache, memory controller, and / or ISA, and avoids the performance cost of implementing a hardware log of transaction addresses in the PM. This enables systems supporting hardware transactional memory to be implemented even if a portion of main memory is implemented as PM, but requires less additional development effort to make hardware transactional memory features compatible with PM. Furthermore, this approach allows software written to existing hardware transactional memory systems to execute unchanged on systems using PM, as it does not require recompiling the software to include additional instructions for forcing writes to the PM within transactions still pending commit.

[0016] In one example, a subset of the cache hierarchy scanned by the eject circuitry during an eject operation can exclude a predetermined tier of cache where speculative stored data associated with a transaction is marked as speculative to prevent that data from being passed beyond the predetermined tier's cache. In some systems, it may not be necessary to scan the predetermined tier of cache to ensure that any data generated by committed transactions is ejected to the PM.

[0017] For example, this approach may be suitable when the next level of cache after the cache at a predetermined level in a hierarchical structure is an inclusive cache, where all addresses cached in the predetermined level are also allocated cache entries in the next level of cache. In this case, the state associated with the cache lines in the next level of cache after the predetermined level is sufficient to determine whether there is any data in the predetermined level cache that might need to be evicted from memory, making a scan of the predetermined level cache itself unnecessary.

[0018] By excluding a predetermined level of cache from the scans performed during the drain operation, the total time spent performing the scan operation is reduced, thus saving power. This can be particularly useful in implementations where the drain operation is performed based on power from a backup power source (discussed further below), as reducing the total time spent performing the drain operation in this case allows the use of a backup power source with a smaller energy capacity.

[0019] Alternatively, for other implementations, a subset of the cache hierarchy scanned by the eviction hierarchy may include caches at predetermined levels. For example, if the next level of cache after the predetermined level is an exclusive or non-containment cache, this method can be used such that an entry cached in the predetermined level does not necessarily have a corresponding entry cached in the next level. If the scanned subset of the cache hierarchy includes caches at predetermined levels, then when the eviction circuit scans the predetermined level cache to identify dirty cache lines, the eviction circuit can prevent lines marked as speculative dirty cache lines from being evicted to the PM. Therefore, when scanning the predetermined level cache, only non-speculative cache lines can be allowed to be evicted to the PM. This prevents partial results of uncommitted transactions from becoming visible in the PM, thus providing an atomicity guarantee for transactions.

[0020] In some implementations, the memory controller used to control the writing of data to memory may have a write queue for queuing data waiting to be written to the PM. Similar to a cache hierarchy, when an ejection trigger event occurs, there may still be some data in the memory controller write queue that has not yet been written back to the PM, and therefore the ejection trigger event may also cause the memory controller write queue to lose its state. If, after an earlier transaction has been committed, only a portion of the data associated with that transaction has been written to the PM, and some data in the memory controller write queue has not yet been written, this could again pose a risk to atomicity. Therefore, in response to an ejection trigger event, the eject circuitry can also cause the pending write data stored in the memory controller write queue to be written to the PM. This approach may be useful if a volatile memory storage device is used to implement the memory controller write queue.

[0021] However, in other systems, the memory controller write queue itself can use a non-volatile form of memory, and in this case, it is not necessary to scan the memory controller write queue to identify the data to be written to the PM.

[0022] In some specific implementations, volatile form of storage technology can be used to implement all caches in the cache hierarchy, and therefore the scan performed in the eject operation that covers the last level cache of the cache hierarchy may be useful.

[0023] However, in other examples, the last-level cache (and optionally one or more higher-level caches) of a cache hierarchy can be implemented using a PM. In this case, the eviction operation may include eviction of dirty cache lines from at least one additional level of cache to the last-level cache, making it potentially unnecessary to eviction data all the way to main memory. Therefore, the PM discussed above can include the last-level cache of a cache hierarchy. Furthermore, if a PM is used to implement the last-level cache on a cache hierarchy, it is not necessary to scan the last-level cache in the eviction operation because it will retain its data after the eviction trigger event and therefore does not pose a risk of data loss to the atomicity of stored data generated in a transaction. Therefore, when a PM is used to implement the last-level cache of a cache hierarchy, the subset of the cache hierarchy scanned in the eviction operation can exclude the last-level cache. Similarly, if a PM is used to implement a cache at a higher level than the last-level cache in the hierarchy, that cache can also be excluded from the scanned subset of the cache hierarchy.

[0024] An eviction trigger event can be any event that could potentially cause the loss of state stored in at least one additional level of the cache hierarchy. For example, an eviction trigger event can be a reset event, which can occur when a reset input to the processing system is asserted. For instance, the system can be reset when a user presses a power-off or restart button. A reset input can also be asserted in response to some type of interrupt or exception indicating that an unrecoverable error has occurred. In response to a reset event, storage elements (such as flip-flops in processing circuitry) can be reset to a default state (binary zero or binary one depending on the specific storage element). This can lead to state loss when storage elements within the cache are reset. Therefore, when a reset event occurs, it may be useful to perform an eviction operation to scan a subset of the cache hierarchy and write the data associated with the dirty cache line to the PM before resetting the corresponding storage element storing the dirty data.

[0025] Another example of an eject trigger event when a power failure is detected on the mains power supply used to power the processing circuitry can be a power outage event. A power outage event can be an event that occurs when power is suddenly interrupted, potentially causing volatile memory circuitry to lose its state. Power outage events can also be planned power outage events used to conserve energy, such as entering sleep or hibernation modes, for example, by power-gating the cache and kernel. Whether a power outage event is planned or unplanned, it risks data loss in at least one additional level of the cache hierarchy. By performing an eject operation in response to an eject trigger event, the results generated by committed transactions are preserved to ensure atomicity when the system is subsequently powered on again.

[0026] Additionally, the evict operation prevents violations of transaction ordering requirements. For example, if older committed transactions are not persisted to the PM, newer committed transactions may not be allowed to be atomically persisted. Therefore, by performing an evict operation when an evict trigger event is detected, this ensures that any incomplete write-backs of older committed transactions are propagated to the PM, thus avoiding ordering violations.

[0027] The discharge circuitry and at least one additional level of cache may be coupled to a backup power input for providing backup during discharge operations. The backup power input may be separate from the main power input used to supply power to the processing circuitry. The main power input may also supply power to the cache hierarchy during normal operation, but during discharge operations, if the main power supply is unavailable, power may optionally be supplied to the cache hierarchy from the backup power input. By providing a backup power input, energy can be provided for performing the discharge operation even when a power outage event has occurred, interrupting the main power supply. The backup power input may be a pin on an integrated circuit including the processing circuitry and the discharge circuitry, through which power is supplied from a backup power source, such as a battery or capacitor. The battery or capacitor itself may not be part of the integrated circuit implementing the device as defined in the claims, because the battery or capacitor may be coupled to the backup power input in a downstream step of the manufacturing / supply chain, so the battery or capacitor may not be present when the device including the processing circuitry, cache, discharge circuitry, and backup power input is manufactured or supplied to a customer.

[0028] A backup power supply is not necessary to support the aforementioned discharge circuitry, as a discharge operation can still be performed even without a backup power supply when a reset event occurs as a discharge trigger event as discussed above. However, providing a backup power input can be useful to allow the system to also perform a discharge operation in response to a power outage event. For example, the backup power supply could be a battery or supercapacitor that can supply a sufficient amount of power for a sufficiently long period to support the scan and write-back operations performed in response to the discharge operation. The specific charging capacity required for the battery or supercapacitor can vary depending on the cache size and the expected latency of the scan / write-back operations, and therefore can vary depending on the specific implementation.

[0029] When using backup power, excluding a predetermined level of cache from the scanned subset of the cache hierarchy can be particularly useful, as this allows cheaper batteries or capacitors to be used as backup power, eliminating the need for the relatively expensive uninterruptible power supply (UPS) typically provided as backup power for large servers. Therefore, designing the device to exclude a predetermined level of cache from the scanned subset of the hierarchy can help reduce the overall cost of implementing backup power.

[0030] Similarly, in an example where the memory controller write queue is also subject to an ejection operation to eject data from the memory controller write queue to the PM, the memory controller write queue can also be coupled to a backup power input to allow backup power to be supplied to the memory controller write queue during the ejection operation.

[0031] The cache at a predetermined level can also be coupled to a backup power input, enabling power to be supplied to the cache at the predetermined level even if a power failure occurs in the main power supply. This is useful not only when the cache at the predetermined level is part of a scanned subset of the cache hierarchy as discussed in the second embodiment above, but also when the scanned subset of the cache hierarchy scanned by the exclusion circuit excludes the cache at the predetermined level in the first example described above. This can be seen as counterintuitive. However, even without scanning the cache at the predetermined level itself, it is possible to mark a cache line in the next lower level cache as "modified but obsolete" to indicate that the cache line has been modified relative to the corresponding copy of the data in memory, but the latest version of the data associated with that cache line may actually be stored in the cache at the predetermined level. In some implementations, a "modified but stale" cache line can be marked as dirty and invalid (dirty because it is different from the underlying copy of the data in memory, and invalid because the valid data at the corresponding address exists in the cache at the predetermined level). However, other implementations may provide different ways to identify modified but stale lines (e.g., a modified but stale cache line can still be marked as valid, but there may be a separate tag or consistency status indicator indicating that it is a modified but stale line). When a scan of at least one additional cache level identifies a modified but stale cache line, the eviction circuitry can trigger a snooping request to the cache at the predetermined level to request updated data associated with the modified but stale cache line, and in response to receiving the updated data, the updated data can be written to the PM. The snooping request triggered by the eviction circuitry can be performed directly or indirectly by the eviction circuitry (e.g., scanning the cache at a given level may cause the cache to snoop if a line is identified as modified but stale, so the eviction circuitry itself may not need to directly issue a snooping request).

[0032] Therefore, it may be useful to provide backup power to the cache at the predetermined level without scanning the cache itself during the eviction operation, so as to allow the cache at the predetermined level to respond to any snooping requests from caches at other levels in the cache hierarchy, which are triggered by scan operations performed in those other caches.

[0033] If a cache at a predetermined level receives such a listener request, the cache at that predetermined level may return a listener response. Such a listener request specifies the listener target address associated with speculative stored data marked as speculative in the cache at that predetermined level (indicating that it is data associated with a transaction that is still pending). The listener response indicates that the data associated with the listener target address is not available in the cache at that predetermined level (even if the data is actually available, it is being prevented from propagating to caches at other levels to ensure that the stored data of the uncommitted transaction is viewed atomically by other threads).

[0034] Each cache line in a predefined cache level can be associated with an exclusivity indicator. The exclusivity indicator of a given cache line indicates whether the corresponding data is speculative storage data for a pending transaction. When the exclusivity indicator of a given cache line has a first value, the predefined cache level prevents speculative storage data in that cache line from being visible outside the predefined cache level, and when the exclusivity indicator of a given cache line has a second value, it allows speculative storage data in that cache line to propagate to caches at other levels.

[0035] Exclusivity indicators may not be the only type of metadata associated with cache lines in a predefined level of cache used to track transactional processing. The predefined level of cache may also store working set tracking indicators to mark cache lines stored in the predefined level of cache as associated with a set of working addresses accessed within a transaction. This can be useful for tracking conflicts between addresses accessed within a transaction and addresses accessed by other threads, allowing the transaction to be aborted if an address conflict with another thread is detected, potentially at the risk of losing atomicity.

[0036] The cache at a predetermined level can be any cache in the cache hierarchy that stores such exclusive indications and / or working set trace indications. In some systems, transaction-related tracing can be performed at a second-level cache or another cache in the cache hierarchy.

[0037] However, in practice, if the cache of the predetermined level is a level 1 data cache (which is the first level cache accessed when the processing circuitry performs a load / store operation), then this may be the simplest.

[0038] The cache at a predetermined level can be a dedicated cache, which is dedicated to the processing circuitry in a given processor core and cannot be directly accessed by other processor cores (although in some scenarios these other processor cores may be able to probe the L1 cache that is dedicated to the first core).

[0039] The techniques discussed above can be particularly useful when the next level of cache in a cache hierarchy is a containing cache, outside of the previous level. This means that any address cached in the previous level will also have an entry allocated for that address in the next level of cache. When the next level of cache is containing, it means that any dirty data in the previous level's cache that has not yet been written back to the PM can be identified from a scan of the next level's cache. Therefore, it is not necessary to include the previous level's cache in the scanned subset of the cache hierarchy, thereby achieving power savings by reducing the number of cache lines that need to be scanned in the cache hierarchy, and thus reducing the power consumed when performing evict operations.

[0040] Persistent memory can include any form of memory whose contents remain available after a power cycle or other restart. For example, "persistent memory" can include non-volatile memory such as magnetic core memory, flash memory, magnetoresistive random access memory (MRAM), ferroelectric RAM (F-RAM), phase-change RAM (PCRAM), resistive RAM (ReRAM), correlated electronic RAM (CeRAM), and other memory technologies that are inherently non-volatile. Furthermore, "persistent memory" can include main memory that is automatically backed up to non-volatile memory (such as flash memory) and reloaded after a power-on / off cycle. For example, a non-volatile dual in-line memory module (NVDIMM-N) combines DIMMs, DRAM, flash memory, and a small power supply in a single module.

[0041] A memory module (PM) can be byte-addressable. That is, a PM can support access to individual bytes of data, rather than just access to large blocks of data. For example, for a range of memory addresses mapped to a PM, each distinct binary value of a memory address generated by the processing circuitry within that range can correspond to a different byte of data within the PM (note that even if the processing circuitry requests access to only a single byte within the PM, some hardware implementations may still return a larger block of data from the PM and cache that larger block, anticipating that the processing circuitry might need other parts of that block later). In contrast, most non-volatile memory devices accessible via input / output ports can be block-addressable, supporting access only at a coarser granularity than a PM (e.g., access in 512-byte blocks, as an example). Traditionally, non-volatile memory devices have been used only for large-capacity storage of data or offline storage of program code, rather than for storing working data that is periodically updated during program code processing. In contrast, with the development of PM technologies (such as MRAM or PCRAM), it has become feasible to provide byte-addressable PMs, which opens up the opportunity to use PMs to store regular working data within the processor's main random access memory. However, this introduces the problem associated with combining PMs with transactional memory as discussed above, which can be addressed using the previously described outgoing circuitry.

[0042] PMs may include at least one off-chip PM module and / or at least one on-chip PM module that acts as one or more buffers. For example, buffers may include on-chip caches, high-speed temporary storage, or buffers within memory controllers or interconnects.

[0043] Figure 1 An example of a data processing system 100 including processor core 104 is schematically illustrated. Each core 104 can execute program instructions to perform data processing operations on operands stored in register 106. Instructions for execution by core 104 can be fetched from level 1 instruction cache (L1I$) 108. L1I$ 108 is part of a cache hierarchy that also includes level 1 data cache (L1D$) 110, level 2 cache (L2$) 112 accessed when L1I$ 108 or L1D$ 110 is missed, and a shared level 3 cache (L3$) 118 shared among processor cores 104. Level 1 caches 108, 110, and L2$ 112 are dedicated to a single core. Load / store instructions executed by a given core 104 trigger an access to L1D$ 110 of that core. If the request misses L1D$, then the request is made to L2$ 112 of the kernel or to the shared L3$ 118, or if the request misses any cache, then the request is made to memory 120, 124, or 128.

[0044] In this example, L1D$110 is a write-back cache, such that when processor core 104 writes to an address valid in L1D$110, the data is updated and marked as dirty, and is not immediately written back to L2$112 or another level of cache or memory, unless the data for that address is evicted from L1D$110 or requested by another core, or encounters some other trigger for write-back. Alternatively, some systems may support the ability to define certain regions of the address space as write-through and others as write-back, and in this case, a write to a cache line associated with an address in a write-back region can be marked as dirty and not immediately written back to memory, and a write to a cache line associated with an address in a write-through region can trigger a write-back to L2$110 or elsewhere when L1D$112 is updated.

[0045] Moreover, in this example, L1D$110 is a write-allocated cache, which means that when data that was not previously cached in L1D$ is accessed by processor core 104 from L2$112 or a lower level, the data is not only returned to core 104, but also allocated to L1D$110.

[0046] L2$112 is dedicated to a single kernel. L2$112 is an inclusive cache, meaning that any address cached in one of the L1 caches 108, 110 of a given kernel 104 also has a corresponding entry in that kernel's L2$112. The L2 cache 112 is within a coherence domain managed by coherence control circuitry 116, which connects the respective kernels 104 to the interconnect 114. Coherence control circuitry 116 can implement coherence protocols (e.g., snoop-based or directory-based protocols) to ensure that when data at a given address is updated by one kernel, other kernels accessing the same address subsequently will see the updated data. In some examples, the shared L3$118 can also act as a snoop filter, which can at least partially track which addresses are cached in the dedicated caches 110, 112, 108 of a particular kernel 104 to help reduce cache overhead when snooping is performed by other kernels (e.g., this allows snooping on caches that do not store data at a given address, as learned from the snoop filter 118, to be eliminated). The consistency control circuit 116 can use any known consistency protocol to manage consistency. In this example, L3$118 is shown as being provided within the interconnect, but in other examples, L3$118 can be a separate block from the interconnect. Additionally, it is possible to implement the snooping filter as a separate structure from L3$118.

[0047] Byte-addressable memory accessible via interconnect 114 includes volatile memory 120 (dynamic random access memory (DRAM) in this example), access of which is controlled by DRAM memory controller 122. Additionally, byte-addressable memory includes persistent memory (PM) 124, which may be any of the forms of PM described previously. PM memory controller 126 is provided for controlling access to PM 124. PM is a byte-addressable non-volatile memory storage device, meaning that individual bytes of data stored in the PM can be addressed independently by processor core 104.

[0048] Interconnector 114 can also support access to external storage devices 128 (such as external flash memory drives) accessed via input / output (I / O) controller 130. Unlike byte-addressable memories 120, 124, external storage device 128 can only be accessed in batches at address block granularity greater than one byte (e.g., each block may be, for example, 512 bytes). While DRAM 120 or PM 124 can be frequently accessed and used to store working data that is continuously accessed during main computational processing of programs executing on processor core 104, external storage device 128 can be provided for long-term offline storage of files (such as program code, image data, or other files) that are accessed intermittently during ongoing code processing. The performance of accessing external storage device 128 may be much slower than accessing DRAM 120 or PM 124.

[0049] DRAM 120 is a volatile memory device, therefore any state stored in DRAM 120 may be lost in the event of a power failure or a reset event that resets the memory elements of device 100 to a known state. PM 124 and external memory device 128 are non-volatile, and therefore their states are retained even in the event of a power failure or a reset (a reset event may not erase the contents of PM 124). Although Figure 1 The example shows a system with DRAM 120, but this is not required, and in other examples, PM 124 can be used to implement the entire byte-addressable portion of the memory space. Similarly, providing external storage device 128 is not required. Additionally, in some specific implementations, PM 124 can also be used to implement a shared L3$ 118 to provide non-volatile storage for the data in L3$ 118.

[0050] Figure 2The components of the processor core 104 for hardware transactional memory (HTM) support are shown in more detail. The processor core 104 has processing logic 4 for implementing instructions to perform data processing operations. For example, processing logic 4 (processing circuitry) may include execution units for performing various types of processing operations, such as an arithmetic / logic unit (ALU) for performing arithmetic or logical operations (such as addition, multiplication, AND, OR, etc.); a floating-point unit for performing operations on floating-point operands; or a vector processing unit for performing vector processing on vector operands comprising multiple data elements. The processor core 104 includes a set of architecture registers 6, which are provided for storing operands of instructions executed by processing logic 4 and for storing the results of the executed instructions. The processor core 104 also has an instruction decoder 8, which decodes instructions fetched from L1I$ 108 to generate control signals for controlling processing logic 4 or other components of the processor core 104 to perform related operations. The processor core 104 also includes a load / store unit 12 to perform load operations (in response to a load instruction decoded by the instruction decoder 8) to load data values ​​from L1D$ 110 or other caches 112, 118, main memory 120, 124 or external storage device 128 into architecture register 6, and to perform store operations (in response to a store instruction decoded by the instruction decoder 8) to store data values ​​from architecture register 6 into caches 110, 112, 118, memory 120, 124 or external storage device 128.

[0051] Processor core 104 also has transactional memory support circuitry 20, which provides various resources for supporting hardware transactional memory (HTM). The HTM resources in transactional memory support circuitry 20 support transactions processed by processing logic 4, where a transaction is a series of instructions, and processing logic 4 does not submit any results of speculatively executed instructions until the transaction is completed. Transactional memory support circuitry 20 may include, for example: speculative result storage 22 for storing speculative results of transactions; address tracking circuitry 24 for tracking addresses accessed by transactions; conflict detection circuitry 26 for detecting conflicts between data accesses performed by a transaction and data accesses performed by other threads, such that the transaction can be aborted when a conflict is detected; and recovery state storage circuitry 28 for storing a snapshot of architecture state data from architecture register 6 at the start of a transaction, such that the state can be restored to rewrite the speculative results of the transaction when the transaction is aborted. Although in Figure 2 The address tracking circuit 24 is indicated separately, but as discussed below, in some specific implementations (as shown below) Figure 5In the example, address tracking circuitry 24 can be implemented at least in part using L1D$ 110, which contains an indication of which addresses are in the read or write set tracked for a transaction. Similarly, speculative result storage device 22 can also be combined with L1D$ 110, since data stored in L1D$ can be marked as speculative to indicate that it will not be committed until the corresponding transaction has been committed.

[0052] During transaction processing by processing logic 4, the results of some speculatively executed instructions (e.g., store instructions for storing data into caches 110, 112, 118 or memories 120, 124) are temporarily stored in speculative result storage device 22 (e.g., L1D$ 110) so that the results can be committed once the transaction is complete (assuming the transaction has not been aborted). Transaction abort can be triggered when conflict detection circuit 26 determines that an address in the address read set (e.g., an address in memory that has been read by an instruction within the transaction) has been written by an instruction outside the transaction. In the event of abort, recovery state storage device 28 restores the state of architecture register 6 to its state before the start of transaction processing.

[0053] Nested transactions are possible, where a new transaction start instruction is received before a transaction end instruction corresponding to a previous transaction start instruction is encountered, while the earlier transaction is still pending and has not yet been aborted. A nesting depth register tracks the current nesting depth of transactions to distinguish between situations where no transaction has started, when only a single transaction has started, or when another nested transaction has started within a previous transaction. When no transaction has started, the nesting depth can be 0. In response to the first transaction start instruction, the nesting depth can increment to 1. If another nested transaction starts, the nesting depth can increment again to 2, and so on. The nesting depth can be decremented when a transaction is committed. Thus, as each corresponding nested transaction is committed, the nesting depth gradually unwinds until all transactions have been committed and the nesting depth returns to 0. In some implementations, nested transactions can be treated as a single large transaction, where a transaction start operation is performed in response to the outermost transaction's transaction start instruction, and a transaction commit operation is performed in response to the outermost transaction's transaction end instruction. This simplifies circuit implementation because it eliminates the need to maintain multiple sets of recovery states for, for example, each nested transaction. In this scenario, once the outermost transaction is committed, the inner nested transactions can be committed.

[0054] Figure 3 An example of executing a transaction within a given thread using transactional memory support circuitry 20 and processing logic 4 is shown. A transaction is a section of program code defined by a transaction start instruction (tstart) and a transaction end instruction (tend). For example... Figure 3As shown, in response to a transaction start instruction, the current architecture state in architecture register 6 is captured and stored in recovery state storage circuit 28. Processing logic 4 begins speculative execution of subsequent instructions following the tstart instruction, and while these instructions are being executed, the addresses accessed by these instructions are tracked by address tracking circuit 24, and conflict detection circuit 26 detects conflicts between the tracked addresses and addresses accessed using load / store unit 12 in response to other threads (or conflicts between the tracked addresses and addresses accessed by other kernels 104—such conflicts can be detected based on snooping requests sent by interconnect 114 in response to memory accesses from other kernels 104). At least some speculative results of instructions within a transaction are stored in speculative result storage circuit 22. For example, while a transaction remains pending, values ​​stored in cache or stored in memory in response to the store instruction STR can be maintained in speculative result storage device 22 (e.g., L1D$110, where cache lines are marked speculative). If a transaction end instruction (tend) is reached without an abort event occurring, then in response to the transaction end instruction, speculative results are committed (e.g., speculative indicators on the cache line associated with the transaction in L1D$110 are cleared). After the transaction is committed, any results of the thread stored in speculative result storage 22 can be written to parts of the memory system other than L1D$110, and the recovery state in recovery state storage 28 can be discarded or allowed to be overwritten, since it is no longer necessary to revert the architecture state to the point before the transaction start instruction was encountered.

[0055] On the other hand, if an abort event occurs, such as when a conflict is detected by the conflict detection circuit 26 when another thread accesses an address already accessed by a transaction, then the transaction is aborted, and the recovery state from the recovery state storage device 28 is restored to the architecture register 6. Other causes of an abort event may include, for example, the execution of instructions that are not allowed to be executed within a transaction, insufficient resources in the speculative result storage device 22 or the address tracking circuit 24 for speculative results or addresses required to process a given transaction, or receiving an interrupt during the transaction.

[0056] Figure 3 This demonstrates how a specific set of processing operations can be executed in transactional mode using transaction start and end instructions. For example... Figure 4As shown, the same set of processing operations can also be executed in non-transactional mode using a lock-based mechanism. In this case, before initiating the critical code section managed by the lock, at least one lock check instruction 40 checks the lock variable in memory, identified by the lock address #addLock, and checks whether the lock variable indicates that another thread already holds the lock. If another thread holds the lock, then the processing does not proceed beyond the lock check instruction 40 until the lock is released. Once the lock is determined to be available, it is declared by writing a given value (e.g., binary 1) to the lock address #addLock. For example, the lock check instruction 40 can be implemented using an atomic compare and swap instruction that compares the current value stored at the specified address to determine whether the lock is held, and updates the lock variable to declare the lock if it is not declared. Alternatively, the lock check can be implemented using a series of multiple instructions to read the lock, test the value of the lock, and defer processing if the lock has been declared, or declare the lock by updating the lock variable if it is not currently declared. After the code section protected by the lock is completed, another instruction 42 can release the lock once exclusive access to the resource protected by the lock is no longer needed. For example, the resource protected by the lock could be a data location identified by various addresses accessed during the intermediate code section.

[0057] The lock-based approach described above can be useful in situations where frequent abnormal aborts might occur, for example, if a transactional mode were used. If frequent aborts do occur during a transaction, the code written to use the transactional memory can be written back to the lock-based system by default to allow the instruction sequence to complete. However, this is generally more efficient than the lock-based system when the code sequence executed successfully and the transaction is committed.

[0058] Figure 5An example of a portion of L1D$ 110 supporting address tracking circuitry 24 and speculative result storage device 22 for a specific processor core 104 is shown. L1D$ 110 includes multiple cache lines 140. Each cache line (or cache entry) stores cached data 156 for a corresponding memory address and a tag value 154 that can be used to identify which address caches its data in the corresponding cache line. The data 154 in a single cache line 140 can be stored at a cache line granularity, which can be larger than a byte-sized granularity, where individual data items can be requested by the processor core 104 at a byte-sized granularity. Therefore, the data field 156 in the cache line can be multiple bytes wide, and the tag 154 can correspond to the address of the first byte in that data block (although individual bytes can be addressed individually by the core 104). A validity field 142 in each cache line 140 indicates whether the cache line holds valid data. Each cache line 140 also includes a consistency status field 144, which indicates the consistency status associated with the corresponding cache line. This consistency status field can be used by the consistency control circuitry 116 to manage the consistency between data cached in the corresponding kernel's dedicated cache. For example, the consistency status 144 can indicate whether data in the corresponding cache line is marked as dirty or clean. Dirty data is data that has been modified relative to the corresponding address stored in the underlying memory system, such that the kernel owning that particular L1D$110 is responsible for writing the data back to memory when it is evicted from L1D$110. Clean data is data consistent with the underlying data stored in memory (or it may be different from the underlying data in memory, but in which the data is also cached in the dedicated cache of another kernel 104 and that kernel is responsible for writing the data back, so the kernel with the modified data marked as "clean" is not responsible for writing it back). Therefore, generally speaking, dirty data is data that needs to be written back when it fails or is evicted from the cache, while clean data is data that does not need to be written back when it fails or is evicted from the cache but can be simply discarded. Consistency protocols can also support other forms of consistency states, such as indicating whether data is dedicated to a single kernel or shared with another kernel. The specific definition of a consistency state can depend on the protocol used.

[0059] Each cache line also includes fields 146, 148, 150, and 152 to support transactional memory functionality. Data stored in L1D$110 by memory instructions executed within a transaction is marked speculatively by setting the exclusivity field 146 to a predetermined value (e.g., 1). Cache lines not associated with pending transactions have exclusivity fields set to different values ​​(e.g., 0). When a cache line is allocated for a memory operation executed within a pending transaction, a transaction identifier identifying that particular transaction is also allocated to the cache line and stored in the transaction identifier (TXID) field 148. Each cache line also includes a write set indicator 150 and a read set indicator 152, which respectively indicate whether the address associated with the corresponding cache line 140 is part of the write set or read set of the transaction identified in the TXID field 148. When a load operation is performed within a pending transaction, the read set field 152 is set to indicate that the address is read during the transaction, and for a storage operation performed within a pending transaction, the write set indicator 150 is set to indicate that the address is written during the transaction.

[0060] The exclusivity field 146 controls access to the cache, ensuring that speculative data stored in the cache within a transaction is inaccessible to other threads executing on the same or different kernels performing the transaction. Therefore, a cache miss will be detected when a memory access request is made to L1D$110 specifying a transaction identifier other than the one specified in the TXID field 148 (or no valid transaction identifier is specified). Furthermore, when the interconnect 114 listens for L1D$110 in response to an access to a corresponding address from a different kernel, even if the cache has a corresponding cache line with tag 154 corresponding to that address, if that cache line is marked as exclusive in the exclusivity field 146, a listener response indicating that the data is unavailable is returned to ensure that speculative results within the still-to-be-committed transaction are unavailable to other threads.

[0061] Read set indicator 150 and write set indicator 152 are used to track addresses accessed in L1D$110 and to support conflict detection, enabling L1D$110 and the consistency mechanism provided by consistency control circuitry 116 to provide functionality corresponding to address tracking circuitry 24 and conflict detection circuitry 26. Attempts to read or write data associated with addresses within the read or write set can be detected based on snooping requests received from L2$112 and interconnector 114, which may be triggered by an event at another kernel. If a snooping request is received indicating a possible attempt to read data from an address marked as being within the write set 150 of a transaction, where the corresponding cache line is still marked as exclusive, this can indicate a potential conflict and trigger transaction abort, causing either of the exclusive cache lines associated with the corresponding transaction ID to invalidate and discard speculative results. Additionally, abort can trigger the restoration of any recovery state saved at the start of the transaction. Similarly, attempting to write to an address marked as being in the read set or write set of a pending transaction from another kernel can generate an abort. An attempt by another kernel to read an address marked as being in the read set of a pending transaction but not in the write set does not need to trigger an abort.

[0062] Figure 6 This is a flowchart illustrating the transaction processing. At step 200, a transaction start instruction is executed by the given processor core 104, which causes the transaction recovery state to be captured at step 202. For example, the current value in register 6 can be stored in an alternate storage location so that the current value remains available later if the transaction needs to be aborted. It is also possible to capture the recovery state by changing the register mapping used to identify which physical registers correspond to the architecture registers identified by the instruction, allowing the capture of the recovery state to be performed without actually needing to transfer any data between storage elements, since the remapping can subsequently allow subsequent updates to the architecture state to be performed in a different storage location than where the state was previously stored. It should be understood that there are multiple ways to capture the recovery state, but in general, the operation ensures that the contents of register 6 can be reverted to the state it had at the time of the transaction start instruction, if necessary.

[0063] At step 204, processor core 104 begins speculative execution of the transaction's instructions.

[0064] At step 206, it is determined whether a store instruction for writing data to the memory system has been encountered during transaction processing. If so, at step 208, speculative store data is written to L1D$110, and the cache line 140 allocated with the data is updated to set the write set indicator 150 of the cache line to indicate that the corresponding address is part of the write set of the transaction, the TXID field 148 is updated to indicate the identifier of the transaction being executed, and the exclusivity indicator 146 is set to indicate that the data in the cache line is speculative store data. Before the transaction is committed, the speculative store data should be prevented from being transmitted beyond L1D$110 to other caches 112, 118, or memory. If no store instruction has been encountered, step 208 is omitted.

[0065] At step 210, the processor core determines whether a load instruction (an instruction used to transfer data from the memory system to register 6) has been encountered. If so, at step 212, the data for the target address to be loaded is obtained from the cache hierarchy or the memory system and allocated to L1D$110 (if it does not already exist in L1D$110). A read set indicator flag 152 is set for the cache line 140 corresponding to the accessed address, and the transaction identifier of the executed transaction is assigned to the TXID field 148 of that cache line 140. If no load instruction has been encountered, step 212 is omitted.

[0066] At step 214, processor core 104 determines whether any abort event has occurred. This can occur if a listening request is received indicating that another core is attempting to read an address set with write set indicator 150 (which indicates that the address is within the write set of the pending transaction), or attempting to write an address indicated by write / read set indicator 152 as being within the read set or write set of the pending transaction. Alternatively, an abort can be triggered if another thread executing on the same core as the thread involved in the transaction attempts to write to an address included in the read set or write set, or read an address included in the write set. Additionally, aborts can be triggered for non-conflict-related reasons, such as the occurrence of an exception, an attempt to execute an instruction that is not permitted within a transaction, or based on resource constraints, such as when all cache lines 140 of L1D$110 have been allocated to store data marked as being within the write or read set of a pending transaction, and the current transaction subsequently attempts to access another address in L1D$110 that cannot be allocated without evicting another line marked as being within the read or write set of the transaction. It should be understood that this is not an exhaustive list of all events that could lead to transaction abort.

[0067] When a transaction abort event occurs, the transaction is aborted at step 216, and the recovery state captured at step 202 is restored such that when the recovery procedure is executed, the processor state is consistent with the state that would have existed if the transaction had never been executed. Cache lines 140 marked as exclusive, where transaction identifier 148 is set to match the transaction ID of the aborted transaction, are invalidated, and the exclusivity indication 146 in these lines can be cleared (or alternatively, the clearing of the exclusivity indication can occur later, after non-transaction-related cache lines are filled to allocate non-speculsive data to the corresponding cache line 140). Optionally, abort status information can be recorded, for example, in a transaction abort information register or in another storage location where the reason for the transaction abort can be recorded. This information can be read by software to determine how to recover after the transaction abort, thereby, for example, helping the software distinguish between reasons for aborts that may recur and reasons that may have occurred once but might not occur in repeated transactions. Such abort status information can be used by the software to determine whether to continue attempting to execute an operation as a transaction or whether to use, for example, Figure 4 The lock-based method shown switches to fallback code.

[0068] If no abnormal abort event occurs, then at step 218 it is determined whether a transaction end instruction has been executed. If so, then at step 220 any speculative results of the transaction are committed. Cache lines 240 marked with the transaction ID 148 of the committed transaction in L1D$ 110 are updated to clear their exclusivity indicator 146, so that these lines are no longer marked as speculative. This means that these lines are now visible to other threads executing on the same core 104 and can be listened to by the interconnector 114, making them accessible to processors operating on other cores 104. Additionally, upon committing the transaction, processor core 4 can now allow discarding or overwriting any recovery state of the transaction captured at step 202.

[0069] Figure 6 The method can loop through steps 206, 210, 214, and 218 until one of these events occurs. Although these steps are... Figure 6 The steps are shown sequentially, but in other examples, these steps may be performed in a different order or may be performed in parallel, either wholly or partially, so that different checks can be performed simultaneously.

[0070] Figure 7This is a flowchart illustrating the processing of a listener request by L1D$. At step 250, L1D$ receives a listener request (e.g., from L2$ 112). The listener request may be issued as a result of a memory access triggered on another processor core 104, and may specify a listener address. The listener request may request L1D$ 110 to return one of the following: an indication of whether the data at the listener address is effectively cached in L1D$, a consistency state 144 associated with the data at the listener address in L1D$ 110, and / or that the dirty value of the data at the address specified by the listener request is effectively cached in L1D$ (if the data is dirty). Different types of listener requests may be provided to trigger different forms of responses. It is also possible to receive a listener request that may request invalidation of data at a given address within L1D$ (such a listener request may be one of the examples of events in which a cache line invalidated in response to a listener is marked as exclusive to the pending transaction, triggering transaction abort).

[0071] Therefore, in Figure 7 At step 250, L1D$ receives a probe request specifying a target address, which requires some form of probe response. At step 252, L1D$ 110 determines whether the target address is specified by the tag field 154 of a valid cache line 140 (the cache line 140 for which a valid indication 142 is set). If the target address is not validly cached in L1D$, then at step 254, a probe response indicating that the data associated with the target address is unavailable is returned.

[0072] If L1D$ does indeed include a valid cache line 140 with label 154 corresponding to the target address, then at step 256, L1D$ determines whether the valid cache line corresponding to the target address is marked as exclusive (146). If not, then at step 258, a probe response indicating that the data associated with the target address is available is returned to L2$ 112 or interconnect 114. For example, the probe response could indicate the consistency status of the data (such as whether the data is dirty) and / or (if the data is dirty) could also return the dirty data value associated with that address. On the other hand, if at step 256 it is confirmed that the valid cache line corresponding to the target address is marked as exclusive, then again at step 254, a probe response indicating that the data associated with the target address is unavailable is returned. This prevents speculative data associated with pending transactions that have not yet been aborted or committed from becoming available outside of L1D$ 110. This helps maintain the atomicity guarantees required for operations performed within a transaction.

[0073] Typical HTM schemes have been designed for systems without PM 124. Such existing HTM schemes generally assume that the memory is volatile (such as DRAM 120), and therefore, after a transaction commits, as the later eviction from the L1D$110 cache of the kernel 104 executing the transaction triggers a writeback of the data written to L1D$110 by the transaction, it is acceptable to update the data in volatile memory 120 to the now committed result of the transaction for a period of time. Therefore, there will be a period where some of the addresses written by the transaction may have been updated in memory 120 with the new values ​​calculated in the transaction, but other addresses written in the transaction have not yet been updated in volatile memory 120. Although a non-atomic view of the transaction's result temporarily exists in volatile memory 120, this is not a problem because accesses to these addresses will hit higher levels of the cache hierarchy and thus return the correct values ​​produced from the complete committed transaction. Additionally, when using volatile memory (e.g., DRAM) 120, this means that even if a power failure or reset event occurs during a period when DRAM 120 is only partially updated with the result of a committed transaction, the data in DRAM 120 and the cache hierarchy will be lost or reset, and therefore, when power is restored after a power cycle or reset, there will be no stored data representing the partial result of that transaction in volatile memory 120 or the cache hierarchy.

[0074] However, with the development of systems using PM 124 as a byte-addressable random access memory, including PM 124 means that state written to PM 124 before a power failure or reset event remains visible after recovery from the power failure or reset. This can be beneficial in some scenarios because recovering data still in PM allows subsequent processing to be completed faster than in cases where data has been lost, and repeating the processing performed before the power failure or reset event may be less necessary.

[0075] However, when PM 124 is used in conjunction with an HTM-enabled kernel 104, most existing HTM schemes do not work plug-and-play with PM. For example, if a power failure or reset event occurs during the period after a transaction has been committed and only a portion of the transaction's results have been written back to PM 124, this means that after recovery from the power failure or reset, a non-atomic view of the transaction's results is visible in the data stored in PM 124, which breaks the guarantees required by HTM schemes. In other words, because existing HTM systems only focus on atomic visibility and not atomic durability, existing HTM can guarantee concurrent atomicity in terms of visibility (through other concurrent threads), but may not guarantee atomicity in terms of power failure (regarding persistent memory, i.e., what the recovering thread can observe from persistent memory after a power cycle). In other words, existing HTM only addresses the "ACID" aspects of atomicity (A), consistency (C), and isolation (I), without addressing transaction durability (D).

[0076] Some mechanisms to address this could include allowing cache lines to be flushed within a hardware transaction, or providing a hardware logging mechanism to track addresses accessed within a transaction in the PM 124. However, this would require hardware changes to the cache and memory controller and / or instruction set architecture changes, and might require recompiling code written for HTM systems that do not support PM to account for these changes.

[0077] Figures 8 to 10 An alternative technique for solving this problem is shown, which requires minimal changes to the hardware of the ISA or caches 110, 112, 118 and memory controller 126, and does not require addresses accessed within a transaction to be logged to PM 124. This technique allows the aforementioned problem to be solved without requiring any changes to the software already written for systems that do not support HTM with PM 124.

[0078] Figure 8 A flowchart illustrating a method for responding to a discharge trigger event, which can be, for example, a power outage event or a reset event. Figure 9 As shown, the device may be equipped with a discharge circuit 170, which receives a discharge trigger signal 174 indicating whether a discharge trigger event has occurred. When in Figure 8 When an ejection trigger event is detected at step 280, at step 282, ejection circuit 170 performs an ejection operation to scan a subset of the cache hierarchy to identify dirty cache lines and write the dirty cache lines to PM 124 (while ensuring that any cache lines marked as speculative in L1D$ are prevented from being ejected to PM 124).

[0079] like Figure 9As shown in the example, the discharge circuit 170 may be coupled to a backup power input 176 that is powered from a backup power source, such as a battery or capacitor, which can be used in the event of a power failure in the main power supply used to power the processor core 104 and cache during normal operation. In this example, the discharge circuit 170, along with L1D$ 110, L2$ 112, and L3$ 118, is coupled to the backup power input 176 (for simplicity, the connection between the backup power input 176 and the cache is not shown in the figure but will be provided in the implementation). Additionally, the memory controller 126 may include a pending write queue (WQ) 178, also coupled to the backup power input 176. During normal processing, power is supplied from the main power supply to the processor core 104, caches 110, 112, 118, and memory controllers WQ 178 and PM 124. If a power failure is detected in the main power supply, the backup power supply is used to support the discharge operation being performed.

[0080] Therefore, when the discharge trigger signal 174 indicates that a discharge trigger event has been detected (e.g., a power failure or reset event in the mains power supply), the discharge circuit 170 triggers a discharge operation to be performed, which includes scanning a subset of the cache hierarchy to identify dirty cache lines and writing the dirty cache lines to PM 124. Figure 9 In the example, the scan performed in the eject operation applies to the eject scan region 172 of the memory system, which includes L2$112, L3$118, and the memory controller write queue 178. Figure 9 In the example, L1D$110 was excluded from the excluded scan area.

[0081] For the memory structures within the eject scan region 172, when the eject trigger signals an eject trigger event, the eject circuit scans each memory location (e.g., cache line or write queue entry) of these memory structures 112, 118, and 178 and checks whether these locations contain dirty data. If a location contains dirty data, then the dirty data is written back to PM 124 to preserve it (note that in the case of memory controller write queue entries, all entries in write queue 178 can be considered dirty). This means that if any of these dirty data values ​​were generated by a recently committed transaction, then the complete result of that transaction will be ensured to be written back to PM 124 to ensure atomicity. Backup power input 176 ensures that sufficient power is available to perform the eject operation even if the main power supply used in normal operation fails.

[0082] exist Figure 9In the example, since L2$112 is an inclusive cache, dirty entries in L1D$110 will also have corresponding entries in L2$112, so it is unnecessary to perform a scan operation on L1D$110. By excluding L1D$ from the evacuation scan region 172, this reduces the total time spent performing the evacuation operation, and therefore the backup power supply does not need to have a larger capacity to handle the evacuation operation, which allows for the use of cheaper forms of backup power supply, such as batteries or capacitors mentioned above. In addition, this makes the evacuation circuit 170 simpler, as it does not need to check whether dirty rows in L1D$ are part of uncommitted transactions and skip evacuating such rows (as discussed below). Figure 10 (as in the example). Additionally, processor core 104 does not need to be coupled to a backup power supply because the backup power supply is only designed to provide a relatively limited amount of power sufficient to allow the discharge operation to be performed, and does not need to provide enough power to allow the processor core to continue executing the program.

[0083] Although L1D$ 110 is excluded from the eject scan area, it is connected to backup power input 176, allowing it to respond to a probe request from L2$ 112 for an address in L2$ marked as dirty, for which a modified data value exists in L1D$ 110. If L1D$ includes any cache line 140 that is still marked as exclusive for the pending transaction at the time of the eject trigger event, then L1D$ will return a probe response indicating that the data is unavailable (e.g., ...). Figure 7 (as described in steps 256 and 254), and therefore the dirty data will not be discharged to PM 124. Although the results of any processing pending within an uncommitted transaction will therefore be lost after a power cycle or reset, this is not a problem and is actually preferred because it will ensure that an atomic view of the transaction is subsequently seen in PM 124, where any given transaction either propagates its entire result to PM 124 or is not seen at all. On the other hand, if there are any cache lines 140 previously marked as exclusive to indicate speculative stored data for a transaction, but the transaction has now been committed and therefore the exclusiveness indicator 146 has been cleared, then a snooping request sent from L2$ 112 during the discharge operation will trigger a snooping response from L1D$ 110, which can provide the latest data, and this data can then be written back to PM 124 to ensure that the complete result of the processor transaction is propagated to PM 124, so that an atomic view of the transaction's result is seen after recovery from the discharge triggering event. While some additional power is required for the L1D$110 to respond to such snooping requests, the power consumption is far less than if the L1D$ itself were scanned line by line to identify dirty data. Figure 9The method shown can help reduce the cost of implementing backup power and reduce the complexity of the discharge circuit 170.

[0084] therefore, Figure 9 The illustrated scheme provides a backup power source to allow cache lines in the L2$, L3$, and memory controller write-pending queues to be emptied into the PM during a power failure. Core 104 and L1D$ 110 are not in the scanned domain; only dirty lines between L2$ and the PM in the scanned domain 172 are emptied into the PM during a power failure. The emptying of dirty cache lines into the PM is handled by a dedicated finite state machine circuit 170 in the processor, so core 104 can be powered down when a power failure is detected, and backup power is activated to use the emptying circuit 170 to empty cache lines in the scanned domain 172 into the PM 124. Although not in the scanned domain 172, the L1 data cache remains powered on because stale lines in the inclusive L2$ 112 will fetch new data by listening to the aforementioned L1D$ 110. Therefore, L1D$ 110 is valid in the scanned domain 172, but since L2 is inclusive, no additional backup power is needed to actually scan L1D$ line by line. When a power failure occurs before a transaction is committed, dirty rows in L1D$110 (marked speculatively for partially executed TX) cannot be evicted because L1D$110 is not in the scanned domain. This is equivalent to them not being visible to other concurrent threads (concurrency atomicity) because the exclusive indicator 146 is set for these rows. Once a transaction in one thread becomes visible to another thread (i.e., the concurrent observer), it can be ensured that the transaction also becomes persistent (or visible from PM to the persistence observer) due to the natural write-back that occurs when rows that are no longer speculative and are associated with the committed transaction are evicted from L1D$110, or due to a power failure or reset caused by an evicting operation performed by the evicting circuit 170. This is because (1) if a thread in kernel 1 requests a cache line in L1D$110 of kernel 0, then the cache line will cross from L1D$110 to L2$112 associated with both kernel 0 and kernel 1, and will therefore be within the eject scan region 172; and (2) if a thread on the same kernel 0 requests a line in L1D$110 of kernel 0, then the line does not need to cross from L1D$110 of kernel 0 to L2$112, but in this case, the eject circuitry will pull the updated cache line into 110 when the eject operation is performed. This means that applications running with HTM (on volatile DRAM) will not require code changes to work with PM, thus greatly simplifying the programming challenges associated with using PM-enabled applications.

[0085] Figure 10 It shows Figure 9Alternative methods to the example shown. For example... Figure 9 As shown, a discharge circuit 170 is provided to perform a discharge operation in response to a discharge trigger event, but this time L1D$ 110 is included in the discharge scan region 172. This method can be used with non-inclusive L2$ The system 112 ensures that any dirty data generated by committed transactions within L1D$ is flushed to PM. In this way, when directly scanning L1D$, it may not be necessary for L2$ to snoop on L1D$, and instead, L1D$ 110 and L2$ 112 can be scanned separately to identify dirty data. Additionally, in this example, when L1D$ 110 is scanned by flush circuit 170, any cache line 140 with a speculative exclusivity indicator 146 set to mark data as such will not be flushed to PM 124. In other respects, Figure 10 The method shown is the same as Figure 9 The similarities (differences are) Figure 10 The middle-exclusion circuit 170 may be slightly more complex because it includes circuitry for checking whether dirty rows in L1D$110 are part of an uncommitted transaction when scanning L1D$110, and if so, skipping the exclusion of such dirty rows—in Figure 9 The lieutenant general does not need this circuit logic.

[0086] exist Figure 9 and Figure 10 In the two examples shown, the memory controller write queue 178 is included within the eject scan region 172 to ensure that if any pending write requests for write data generated within a committed transaction are still pending in the write queue 178 at the time of the eject trigger event, they are all propagated to PM 124 to ensure that the entire dataset in PM 124 is consistent with the atomic results generated by the transaction upon recovery from the eject trigger event. It should be noted that in other examples, the memory controller write queue 178 can be implemented using PM to provide non-volatile storage, and in this case, the memory controller write queue 178 does not need to be within the eject scan region 172. Similarly, if a PM is used to implement a last-level cache such as L3$ 118, then that last-level cache will not need to be within the eject scan region 172. Additionally, if a PM is used to implement the last-level cache 118, then when an eject operation is performed, dirty lines ejected from higher-level caches 110, 112 may not be written all the way to the main memory PM module 124, but may instead be written back to the last-level cache 118.

[0087] Although Figure 9 and Figure 10 Only a single exhaust circuit 170 associated with multiple cores 104 is shown, but in cases such as Figure 1In a multi-core system, each core 104 may be associated with such an exhaust circuit 170. Alternatively, in some implementations, individual instances of the exhaust circuit 170 may be associated with each cache level 110, 112, 118 associated with a particular core 104, rather than being considered as a single exhaust circuit 170 associated with the core as a whole.

[0088] Figure 11 It is shown in more detail in Figure 8 The flowchart shows the discharge operation performed at step 282. Figure 11 The steps shown illustrate a scan operation for a single storage structure 110, 112, 118, or 178 within the exhaust scan area 172. Figure 11 The method can be executed individually or sequentially for each of the memory structures within the scanned region 172. For simplicity, Figure 11 Only the steps for scanning one of these structures are shown.

[0089] At step 300, the eviction circuit 170 scans the next line of the memory structure being scanned (which can be a line in caches 110, 112, 118 or an entry in the memory controller write queue 178). At step 302, the eviction circuit 170 determines whether the scanned line of the memory structure is dirty. For caches, this can be determined based on the consistency status indicator 144 (or dirty indicator) associated with the scanned cache line. For the memory controller write queue 178, all pending entries in the queue are considered dirty by default. If the scanned line is not dirty, then at step 304, the eviction circuit 170 determines that the line does not need to be evicted to PM 124, and at step 320, it determines whether all lines of the memory structure have been scanned, and if so, then at step 322, the scan ends. If a line is still waiting to be scanned, the method returns to step 300 to scan the next line of the memory structure.

[0090] On the other hand, if it is determined at step 302 that the scanned line is dirty, then at step 306, the eviction circuit 170 determines whether the scanned line is valid. If so, then at step 308, the eviction circuit 170 determines whether the scanned line is within L1D$110 and has an exclusive indicator 146 set to mark the cache line as exclusive, thereby indicating that the data 156 in the cache line is speculative stored data for a pending transaction. If so, then at step 304, the cache line 140 of L1D$ is not evicted to PM 124 because the line is still speculative and should not be propagated to the downstream cache or PM before the corresponding transaction has been committed. On the other hand, if the scanned cache line determined to be valid at step 306 is not in L1D$, or is in L1D$110 but not marked as exclusive, then at step 310, the scanned cache line is evicted to PM. If the scanned structure is cache 110, 112, or 118, then the eject circuit 170 controls the cache to generate a write-back request to write data from the scanned cache line back to PM 124. Similarly, if the line is in the memory controller write queue 178, then the pending write request is processed to write the corresponding data to PM 124.

[0091] It should be understood that, in situations such as Figure 9 In some implementations, where L1D$ is excluded from the eject scan region, the answer at step 308 will always be no, and thus in such implementations, the method can proceed directly from step 306 to step 310 when the scanned cache line is dirty and valid. In this case, there is no need to check the condition at step 308. It should also be understood that, in practice, step 308 may not be implemented as an explicit check of whether the line is in L1D$, but in some specific implementations where L1D$ 110 is within the eject scan region 172, the eject circuit 170 may include a first set of scan logic corresponding to L1D$ 110 and a second set of scan logic associated with other cache or memory structures. For L1D$ 110, the first set of scan logic checks whether the line is dirty, valid, and non-exclusive, and triggers ejection of the line to PM 124 when all these requirements are met. The second set of scan logic omits the check of exclusivity of the cache line and simply writes the data back to memory if the line is dirty and valid.

[0092] If, at step 306, it is determined that a scanned line of the memory structure is dirty but invalid, then the method proceeds to step 312 (this can occur in an example where L2$112 or L3$118 is an inclusive cache and includes cache lines corresponding to dirty data stored in L1D$110, where the corresponding entry in L2$112 or L3$118 is marked as invalid and dirty to signal that L2$112 or L3$118$ is not keeping up-to-date data but that data exists elsewhere in L1D$ that needs to be written back to memory). At step 312, the ejection circuit 170 determines whether the line is in L2$112 or L3$118. If the line is in L3$118, then at step 313, the line is not ejected to PM 124, and the method proceeds to step 320 to determine whether all lines have been scanned.

[0093] If it is determined at step 312 that a scanned row is in L2$ 112, then at step 314 a listener request is sent to L1D$ 110 to request the latest copy of the data, and at step 316 it is determined whether a listener response including dirty data has been returned from L1D$. Alternatively, in some examples, step 314 may not require explicit action of the drain circuit 170. In some specific implementations, all listeners to L1D$ 110 may be issued via L2$ 112, so in this case, the drain circuit 170 may function similarly to a DMA master, which simply attempts to read the desired row in L2$ 112 at step 300, and if it is determined that the row is dirty, this will cause L2$ 112 to issue a listener request to L1D$ 110 to pull in the dirty data.

[0094] Regardless of whether the probe request for L1$ 110 is sent by L2$ 112 or by the ejection circuit 170, if the probed cache line is marked as non-exclusive, then L1D$ can return a probe response including dirty data. However, if the line is marked as exclusive, then it is still associated with an uncommitted pending transaction, and therefore the corresponding probe response will indicate that the data is unavailable. If the probe response received from L1D$ 110 indicates that the data is unavailable (or otherwise does not return dirty data), then at step 313, the scanned lines of L2$ are not ejected to PM, and the method then returns to step 320 to determine if there are any more lines to scan. In contrast, if the probe response from L1D$ provides dirty data, then at step 318, the dirty data received from L1D$ 110 is ejected to PM, and the method again returns to step 320. Finally, after scanning all rows of the storage structure, the method ends at step 322, and the backup power supply can then be turned off (assuming that all other storage structures to be scanned have also been completed).

[0095] exist Figure 11 In the example, if a cache line in L2$112 is dirty (step 302) and invalid (step 306), the cache line is identified as modified but stale. However, other examples may use different techniques to indicate whether a cache line is modified but stale. More generally, if a modified but stale cache line is identified while scanning at least one additional level of cache, a listener request sent in step 314 can be issued.

[0096] In this application, the phrase "configured as..." is used to mean that the elements of the device have a configuration capable of performing the defined operation. In this context, "configuration" means the arrangement or manner of interconnection of hardware or software. For example, the device may have dedicated hardware that provides the defined operation, or a processor or other processing device may be programmed to perform the function. "Configured as" does not mean that the elements of the device need to be changed in any way to provide the defined operation.

[0097] While exemplary embodiments of the invention have been described in detail herein with reference to the accompanying drawings, it should be understood that the invention is not limited to those precise embodiments, and various changes and modifications can be made therein by those skilled in the art without departing from the scope of the invention as defined by the appended claims.

Claims

1. An apparatus for data processing, comprising: A processing circuit that supports transaction processing, the transaction including instructions that are speculatively processed between a transaction start instruction and a transaction end instruction, wherein, for the transaction, the processing circuit is configured to prevent the submission of the result of the speculatively processed instructions before the transaction end instruction is reached, in the absence that the transaction is aborted. and A cache hierarchy structure including at least two levels of cache; wherein: In response to a storage instruction processed within a transaction, the processing circuitry is configured to write speculative storage data into the cache hierarchy, wherein the speculative storage data is marked as speculative to prevent the speculative storage data from being passed beyond a predetermined level of cache in the cache hierarchy to at least one additional level of cache before the transaction is committed; and The apparatus includes an evacuation circuit that detects an evacuation trigger event that could potentially lead to the loss of state stored in the at least one additional level of cache, and in response to detecting the evacuation trigger event, performs an evacuation operation to scan a subset of the cache hierarchy to identify dirty cache lines and write data associated with the dirty cache lines to persistent memory, the subset of the cache hierarchy including the at least one additional level of cache, wherein, during the evacuation operation, the evacuation circuit is configured to ensure that dirty cache lines storing speculative stored data marked as speculative in the cache of the predetermined level are prevented from being evacuated to the persistent memory.

2. The apparatus of claim 1, wherein the subset of the cache hierarchy scanned by the ejection circuit excludes the cache of the predetermined level.

3. The apparatus of claim 1, wherein the subset of the cache hierarchy scanned by the eject circuit includes the cache of the predetermined level, and the eject circuit is configured to prevent dirty cache lines that store speculative storage data marked as speculative from being ejected to the persistent memory when the eject circuit scans the cache of the predetermined level to identify the dirty cache lines.

4. The apparatus according to any preceding claim, comprising a memory controller write queue, the memory controller write queue queuing data awaiting writing to the persistent memory; wherein: In response to the eject trigger event, the eject circuit is configured to write pending write data stored in the memory controller's write queue to the persistent memory.

5. The apparatus according to any one of claims 1 to 3, wherein the last-level cache of the cache hierarchy is implemented using persistent memory, and the subset of the cache hierarchy excludes the last-level cache.

6. The apparatus according to any one of claims 1 to 3, wherein the discharge triggering event includes at least one of the following: Reset event; and Power outage event.

7. The apparatus according to any one of claims 1 to 3, wherein the discharge circuit and the at least one additional level of cache are coupled to a backup power input for supplying backup power during the discharge operation, wherein the backup power input is separate from the main power input for supplying power to the processing circuit.

8. The apparatus of claim 4, wherein the ejection circuit, the at least one additional level of cache, and the memory controller write queue are coupled to a backup power input for supplying backup power during the ejection operation, wherein the backup power input is separate from the main power input for supplying power to the processing circuitry.

9. The apparatus of claim 7, wherein the cache of the predetermined level is further coupled to the backup power input.

10. The apparatus according to any one of claims 1 to 3, wherein when a scan of the at least one additional level of cache identifies a modified but stale cache line, the eject circuitry is configured to trigger a snooping request to the cache at the predetermined level to request updated data associated with the modified but stale cache line, and to write the updated data to the persistent memory in response to receiving the updated data.

11. The apparatus of claim 10, wherein in response to a snooping request, the predetermined level cache is configured to return a snooping response, the snooping request specifying a snooping target address associated with speculative stored data marked as speculative in the predetermined level cache, and the snooping response indicating that the data associated with the snooping target address is unavailable in the predetermined level cache.

12. The apparatus according to any one of claims 1 to 3, wherein the cache of the predetermined level is configured to store working set tracking indicator identifiers to mark cache lines associated with the working address set accessed within a transaction.

13. The apparatus according to any one of claims 1 to 3, wherein the cache of the predetermined level is a level 1 data cache.

14. The apparatus according to any one of claims 1 to 3, wherein the persistent memory is byte-addressable.

15. The apparatus according to any one of claims 1 to 3, wherein the persistent memory comprises one or both of the following: At least one off-chip persistent memory module; and At least one on-chip persistent memory module that acts as a level one or more buffers.

16. An apparatus for data processing, comprising: A component for processing instructions, the component for processing instructions supporting transaction processing, the transaction including instructions speculatively processed between a transaction start instruction and a transaction end instruction, the component for processing being configured to prevent the submission of the result of the speculatively processed instructions before the transaction end instruction is reached, in the absence of the transaction being aborted. and A component used for caching data in a cache hierarchy including at least two levels of cache; wherein: In response to a storage instruction processed within a transaction, the processing component is configured to write speculative storage data to the caching component, wherein the speculative storage data is marked as speculative to prevent the speculative storage data from being passed beyond a predetermined level of the cache hierarchy to at least one additional level of cache before the transaction is committed; and The apparatus includes components for evacuating cached data to persistent memory, wherein in response to detecting an evacuation trigger event that could potentially lead to the loss of state stored in the at least one additional cache level, the evacuation components are configured to perform an evacuation operation to scan a subset of the cache hierarchy to identify dirty cache lines and write data associated with the dirty cache lines to the persistent memory, the subset of the cache hierarchy including the at least one additional cache level, wherein during the evacuation operation, the evacuation components are configured to ensure that dirty cache lines storing speculative stored data marked as speculative in the cache of the predetermined level are prevented from being evacuated to the persistent memory.

17. A method for data processing, comprising: Processing a transaction, the transaction including instructions that are speculatively processed between a transaction start instruction and a transaction end instruction, wherein, for the transaction, in the absence of the transaction being aborted, the result of the speculatively processed instructions is prevented from being committed before the transaction end instruction is reached; In response to a storage instruction processed within a transaction, speculative storage data is written to a cache hierarchy comprising at least two levels of cache, wherein the speculative storage data is marked as speculative to prevent the speculative storage data from being passed beyond a predetermined level of cache in the cache hierarchy to at least one additional level of cache before the transaction is committed. as well as In response to the detection of an evasion trigger event that could potentially lead to the loss of state stored in the at least one additional level of cache, an evasion operation is performed to scan a subset of the cache hierarchy to identify dirty cache lines and write data associated with the dirty cache lines to persistent memory, the subset of the cache hierarchy including the at least one additional level of cache, wherein when the evasion operation is performed, dirty cache lines storing speculative stored data marked as speculative in the predetermined level of cache are prevented from being evacuated to the persistent memory.

Citation Information

Patent Citations

  • Apparatus and method for efficiently implementing a processor pipeline

    US20150378731A1