Cache metadata for implementing bounded transactional memory
First Claim
1. A method for improving operations of a bounded transactional memory system using cache metadata in a cache of a central processing unit comprising the operations of:
- providing a bounded transactional memory application with access to cache metadata in a cache of a central processing unit;
for every transactional read, setting a cache line metadata transaction-read bit;
for respective transactional writes, setting a cache line metadata transaction-write bit that designates a speculative write;
testing for evictions or invalidations of lines marked with the cache line metadata transaction-read bit or the cache line metadata transaction-write bit, the testing performed by determining if an eviction summary register is non-zero, the eviction summary register including state corresponding to each cache line, the state corresponding to a respective cache line propagated to the eviction summary register from the cache line metadata when the respective cache line is evicted or invalidated;
by the testing, finding that one or more of the lines marked with the cache line metadata transaction-read bit or the cache line metadata transaction-write bit were evicted or invalidated; and
at commit time, based on the finding that one or more of the lines marked with the cache line metadata transaction-read bit or the cache line metadata transaction-write bit were evicted or invalidated, discarding speculatively written lines and calling a cache metadata invalidate instruction to reset all cache line metadata and the eviction summary register to zero, wherein the discarding the speculatively written lines comprises invalidating the speculatively written lines, the speculatively written lines comprising the lines marked with the cache line metadata transaction-write bit.
2 Assignments
0 Petitions
Accused Products
Abstract
Various technologies and techniques are disclosed for providing a bounded transactional memory application that accesses cache metadata in a cache of a central processing unit. When performing a transactional read from the bounded transactional memory application, a cache line metadata transaction-read bit is set. When performing a transactional write from the bounded transactional memory application, a cache line metadata transaction-write bit is set and a conditional store is performed. At commit time, if any lines marked with the transaction-read bit or the transaction-write bit were evicted or invalidated, all speculatively written lines are discarded. The application can also interrogate a cache line metadata eviction summary to determine whether a transaction is doomed and then take an appropriate action.
-
Citations
12 Claims
-
1. A method for improving operations of a bounded transactional memory system using cache metadata in a cache of a central processing unit comprising the operations of:
-
providing a bounded transactional memory application with access to cache metadata in a cache of a central processing unit; for every transactional read, setting a cache line metadata transaction-read bit; for respective transactional writes, setting a cache line metadata transaction-write bit that designates a speculative write; testing for evictions or invalidations of lines marked with the cache line metadata transaction-read bit or the cache line metadata transaction-write bit, the testing performed by determining if an eviction summary register is non-zero, the eviction summary register including state corresponding to each cache line, the state corresponding to a respective cache line propagated to the eviction summary register from the cache line metadata when the respective cache line is evicted or invalidated; by the testing, finding that one or more of the lines marked with the cache line metadata transaction-read bit or the cache line metadata transaction-write bit were evicted or invalidated; and at commit time, based on the finding that one or more of the lines marked with the cache line metadata transaction-read bit or the cache line metadata transaction-write bit were evicted or invalidated, discarding speculatively written lines and calling a cache metadata invalidate instruction to reset all cache line metadata and the eviction summary register to zero, wherein the discarding the speculatively written lines comprises invalidating the speculatively written lines, the speculatively written lines comprising the lines marked with the cache line metadata transaction-write bit. - View Dependent Claims (2)
-
-
3. A method for handling a doomed transaction, using cache metadata in a cache of a central processing unit (CPU) comprising the steps operations of:
-
providing a bounded transactional memory application with access to cache metadata in a cache of a central processing unit; configuring the CPU to transfer control to a software eviction handler in response to an eviction summary register being updated when a cache line of the doomed transaction is evicted or invalidated prior to a commit attempt of the doomed transaction, the cache line marked with a transaction read bit or a transaction write bit in cache metadata corresponding to the cache line, the eviction summary register including state corresponding to each cache line, the state corresponding to cache metadata of a respective cache line propagated to the eviction summary register when the respective cache line is evicted or invalidated; and using the software eviction handler to discard speculatively written lines of the doomed transaction, wherein the discarding the speculatively written lines comprises invalidating the speculatively written lines, the speculatively written lines comprising one or more lines marked with the cache metadata transaction-write bit. - View Dependent Claims (4, 5, 6, 7)
-
-
8. A computer system comprising:
-
a central processing unit (CPU); a cache connected to the CPU, the cache including a plurality of cache lines, and cache metadata corresponding to each cache line; an eviction summary register including state corresponding to each cache line, the state corresponding to a respective cache line propagated to the eviction summary register form the cache line metadata when the respective cache line is evicted or invalidated; and a non-volatile computer-readable storage medium storing computer-executable instructions for causing the CPU to perform operations for handling a doomed transaction, the operations comprising; providing a bounded transactional memory application with access to the cache metadata; configuring the CPU to transfer control to a software eviction handler in response to the eviction summary register being updated when a cache line of the doomed transaction is evicted or invalidated prior to a commit attempt of the doomed transaction, the cache line marked with a transaction read bit or a transaction write bit in the cache metadata corresponding to the respective cache line; and using the software eviction handler to discard speculatively written lines of the doomed transaction by invalidating the speculatively written lines, the speculatively written lines marked with the cache metadata transaction-write bit. - View Dependent Claims (9, 10, 11, 12)
-
Specification