IP Library Granted Patent US 8,364,900
Granted Patent B2
US 8,364,900 · App. 12/029,889 · Granted Jan 29, 2013

Pseudo-LRU cache line replacement for a high-speed cache

Inventors: Paul Caprioli (Santa Clara, CA); Sherman H. Yip (San Francisco, CA); Shailender Chaudhry (San Francisco, CA)
Assignee: Oracle America, Inc.
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,364,900
App. No.
12/029,889
Granted
Jan 29, 2013
Kind
B2
Abstract

Embodiments of the present invention provide a system that replaces an entry in a least-recently-used way in a skewed-associative cache. The system starts by receiving a cache line address. The system then generates two or more indices using the cache line address. Next, the system generates two or more intermediate indices using the two or more indices. The system then uses at least one of the two or more indices or the two or more intermediate indices to perform a lookup in one or more lookup tables, wherein the lookup returns a value which identifies a least-recently-used way. Next, the system replaces the entry in the least-recently-used way.

Claims (64)

1. A method for replacing an entry in a least-recently-used way in a skewed-associative cache, comprising:

receiving a cache line address;

generating two or more indices using the cache line address, wherein generating each index involves computing the index using a hash function for which an input is the cache line address, wherein a different hash function is used to compute an index for each way for each of the two or more indices in the skewed-associative cache;

generating two or more intermediate indices using the two or more indices;

using at least one of the two or more indices or the two or more intermediate indices to perform a lookup in one or more lookup tables, wherein the lookup returns a value which identifies a least-recently-used way; and

replacing the entry in the least-recently-used way.

2. The method of claim 1 , wherein generating each intermediate index involves performing one or more logical, mathematical, or bit-level operations to produce the intermediate index using some or all of the bits in one or more of the indices as inputs.

3. The method of claim 1 , wherein the skewed-associative cache includes more than two ways and determining a least-recently-used way involves:

selecting a final lookup table in a hierarchy of lookup tables using two or more of the intermediate indexes;

using a first index to determine a row in the final lookup table;

using a second index to determine a column in the final lookup table; and

determining a least-recently-used way from an entry where the determined row and column in the final lookup table meet.

4. The method of claim 3 , wherein selecting a final lookup table involves, for each level of the hierarchy of lookup tables:

using a first intermediate index for the level of the hierarchy to determine a row in the lookup table in the level of hierarchy;

using a second intermediate index for the level of the hierarchy to determine a column in the lookup table in the level of hierarchy; and

determining a lookup table that is to be used in a next level of the hierarchy from an entry which is located where the determined row and column meet.

5. The method of claim 3 , upon accessing an entry in a way, the method further comprises using the two or more intermediate indices and the two or more indices to update each affected lookup table in the hierarchy of lookup tables to indicate that the entry in the way was recently used.

6. The method of claim 1 , wherein the skewed-associative cache includes two ways and determining a least-recently-used way involves:

using a first index to determine a row in a single lookup table;

using a second index to determine a column in the single lookup table; and

determining a least-recently-used way from an entry where the determined row and column in the single lookup table meet.

7. The method of claim 6 , upon accessing an entry in a way, the method further comprises using the two or more indices to update the single lookup table to indicate that the entry in the way was recently used.

8. An apparatus for replacing an entry in a least-recently-used way in a skewed-associative cache, comprising:

a least-recently-used (LRU) determination mechanism, wherein the LRU determination mechanism includes one or more lookup tables for identifying a least-recently-used way, wherein the LRU determination mechanism is configured to:

receive a cache line address;

generate two or more indices using the cache line address, wherein generating each index involves computing the index using a hash function for which an input is the cache line address, wherein a different hash function is used to compute an index for each way for each of the two or more indices in the skewed-associative cache;

generate two or more intermediate indices using the two or more indices;

use at least one of the two or more indices or the two or more intermediate indices to perform a lookup in the one or more lookup tables, wherein the lookup returns a value which identifies a least-recently-used way; and

a replacement mechanism configured to replace the entry in the identified least-recently-used way.

9. The apparatus of claim 8 , wherein when generating each intermediate index, the LRU-determination mechanism is configured to perform one or more logical, mathematical, or bit-level operations to produce the intermediate index using some or all of the bits in one or more of the indices as inputs.

10. The apparatus of claim 8 , wherein the skewed-associative cache includes more than two ways and the LRU-determination mechanism is configured to identify a least-recently-used way by:

selecting a final lookup table in a hierarchy of lookup tables using two or more of the intermediate indexes;

using a first index to determine a row in the final lookup table;

using a second index to determine a column in the final lookup table; and

determining a least-recently-used way from an entry where the determined row and column in the final lookup table meet.

11. The apparatus of claim 10 , wherein when selecting a final lookup table, for each level of the hierarchy of lookup tables, the LRU-determination mechanism is configured to:

use a first intermediate index for the level of the hierarchy to determine a row in the lookup table in the level of hierarchy;

use a second intermediate index for the level of the hierarchy to determine a column in the lookup table in the level of hierarchy; and

determine a lookup table that is to be used in a next level of the hierarchy from an entry which is located where the determined row and column meet.

12. The apparatus of claim 10 , wherein when an entry in a way has been accessed, the LRU-determination mechanism is configured to use the two or more intermediate indices and the two or more indices to update each affected lookup table in the hierarchy of lookup tables to indicate that the entry in the way was recently used.

13. The apparatus of claim 8 , wherein the skewed-associative cache includes two ways and the LRU-determination mechanism is configured to identify a least-recently-used way by:

using a first index to determine a row in a single lookup table;

using a second index to determine a column in the single lookup table; and

determining a least-recently-used way from an entry where the determined row and column in the single lookup table meet.

14. The apparatus of claim 13 , wherein when an entry in a way has been accessed, the LRU-determination mechanism is configured to use the two or more indices to update the single lookup table to indicate that the entry in the way was recently used.

15. A computer system for replacing an entry in a least-recently-used way in a skewed-associative cache, comprising:

a processor coupled to the skewed-associative cache, wherein the skewed-associative cache stores data for the processor;

a least-recently-used (LRU) determination mechanism, wherein the LRU determination mechanism includes one or more lookup tables for identifying a least-recently-used way, wherein the LRU determination mechanism is configured to:

receive a cache line address;

generate two or more indices using the cache line address, wherein generating each index involves computing the index using a hash function for which an input is the cache line address, wherein a different hash function is used to compute an index for each way for each of the two or more indices in the skewed-associative cache;

generate two or more intermediate indices using the two or more indices;

use at least one of the two or more indices or the two or more intermediate indices to perform a lookup in the one or more lookup tables, wherein the lookup returns a value which identifies a least-recently-used way; and

a replacement mechanism configured to replace the entry in the identified least-recently-used way.

16. The computer system of claim 15 , wherein when generating each intermediate index, the LRU-determination mechanism is configured to perform one or more logical, mathematical, or bit-level operations to produce the intermediate index using some or all of the bits in one or more of the indices as inputs.

17. The computer system of claim 15 , wherein the skewed-associative cache includes more than two ways and the LRU-determination mechanism is configured to identify a least-recently-used way by:

selecting a final lookup table in a hierarchy of lookup tables using two or more of the intermediate indexes;

using a first index to determine a row in the final lookup table;

using a second index to determine a column in the final lookup table; and

determining a least-recently-used way from an entry where the determined row and column in the final lookup table meet.

18. The computer system of claim 17 , wherein when selecting a final lookup table, for each level of the hierarchy of lookup tables, the LRU-determination mechanism is configured to:

use a first intermediate index for the level of the hierarchy to determine a row in the lookup table in the level of hierarchy;

use a second intermediate index for the level of the hierarchy to determine a column in the lookup table in the level of hierarchy; and

determine a lookup table that is to be used in a next level of the hierarchy from an entry which is located where the determined row and column meet.

19. The computer system of claim 17 , wherein when an entry in a way has been accessed, the LRU-determination mechanism is configured to use the two or more intermediate indices and the two or more indices to update each affected lookup table in the hierarchy of lookup tables to indicate that the entry in the way was recently used.

Assignments (2)
MERGER AND CHANGE OF NAME Recorded Dec 16, 2015
From: ORACLE USA, INC.; SUN MICROSYSTEMS, INC.; ORACLE AMERICA, INC.
To: ORACLE AMERICA, INC.
Reel/Frame 037311/0195 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 5, 2008
From: CAPRIOLI, PAUL; YIP, SHERMAN H.; CHAUDHRY, SHAILENDER
To: SUN MICROSYSTEMS, INC.
Reel/Frame 020604/0639 →
Continuity (1)
Related Publication 20090204761A1 · Aug 13, 2009