IP Library Granted Patent US 8,813,052
Granted Patent B2
US 8,813,052 · App. 11/811,370 · Granted Aug 19, 2014

Cache metadata for implementing bounded transactional memory

Inventors: Jan Gray (Bellevue, WA); Timothy L. Harris (Cambridge, GB); James Larus (Mercer island, WA); Burton Smith (Seattle, WA)
Assignee: Microsoft Corporation
G06F9/467
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 8,813,052
App. No.
11/811,370
Granted
Aug 19, 2014
Kind
B2
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.

Claims (28)

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. The method of claim 1 , wherein the cache metadata invalidate instruction is part of an instruction set architecture on the central processing unit.

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.

4. The method of claim 3 further comprising, executing a cache metadata flash clear instruction.

5. The method of claim 4 further comprising calling a cache metadata invalidate instruction, wherein the cache metadata invalidate instruction is part of an instruction set architecture on the central processing unit.

6. The method of claim 3 , wherein configuring the CPU to transfer control to the software eviction handler comprises setting an eviction handler mask register.

7. The method of claim 6 further comprising, clearing the eviction handler mask register when the software eviction handler is invoked.

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.

9. The computer system of claim 8 , wherein configuring the CPU to transfer control to the software eviction handler comprises setting an eviction handler mask register.

10. The computer system of claim 8 , the operations further comprising clearing the eviction handler mask register when the software eviction handler is invoked.

11. The computer system of claim 8 , the operations further comprising, executing a cache metadata flash clear instruction.

12. The computer system of claim 11 , the operations further comprising calling a cache metadata invalidate instruction, wherein the cache metadata invalidate instruction is part of an instruction set architecture on the central processing unit.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 9, 2014
From: MICROSOFT CORPORATION
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 034542/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 19, 2007
From: GRAY, JAN; HARRIS, TIMOTHY L.; LARUS, JAMES; SMITH, BURTON
To: MICROSOFT CORPORATION
Reel/Frame 020265/0747 →
Continuity (3)
Continuation In Part 11389451 · Mar 23, 2006
Provisional Application 60748386 · Dec 7, 2005
Related Publication 20070245099A1 · Oct 18, 2007