IP Library Granted Patent US 8,745,334
Granted Patent B2
US 8,745,334 · App. 12/486,304 · Granted Jun 3, 2014

Sectored cache replacement algorithm for reducing memory writebacks

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,745,334
App. No.
12/486,304
Granted
Jun 3, 2014
Kind
B2
Abstract

An improved sectored cache replacement algorithm is implemented via a method and computer program product. The method and computer program product select a cache sector among a plurality of cache sectors for replacement in a computer system. The method may comprise selecting a cache sector to be replaced that is not the most recently used and that has the least amount of modified data. In the case in which there is a tie among cache sectors, the sector to be replaced may be the sector among such cache sectors with the least amount of valid data. In the case in which there is still a tie among cache sectors, the sector to be replaced may be randomly selected among such cache sectors. Unlike conventional sectored cache replacement algorithms, the improved algorithm implemented by the method and computer program product accounts for both hit rate and bus utilization.

Claims (32)

1. A method for selecting a cache sector among a plurality of cache sectors for replacement in a computer system, said method comprising:

determining a first set of cache sectors among said plurality of cache sectors excluding a most recently used cache sector, wherein each of said first set of cache sectors has the least amount of modified data among said plurality of cache sectors excluding said most recently used cache sector;

upon determining that said first set of cache sectors comprises multiple cache sectors, determining a second set of cache sectors among said first set of cache sectors, wherein each of said second set of cache sectors has the least amount of valid data among said first set of cache sectors; and

upon determining that said second set of cache sectors comprises multiple cache sectors, selecting a random cache sector among said second set of cache sectors for replacement.

2. The method according to claim 1 , further comprising:

upon determining that said second set of cache sectors comprises one cache sector, selecting a second single cache sector for replacement.

3. The method according to claim 1 , further comprising marking said most recently used cache sector among said plurality of cache sectors.

4. The method according to claim 3 , wherein said marking step comprises storing in a directory entry an identifier corresponding to said most recently used cache sector.

5. A computer program product for selecting a cache sector among a plurality of cache sectors for replacement in a computer system, said computer program product comprising a computer-readable storage medium having computer-readable program code instructions stored therein comprising:

instructions for determining a first set of cache sectors among said plurality of cache sectors excluding a most recently used cache sector, wherein each of said first set of cache sectors has the least amount of modified data among said plurality of cache sectors excluding said most recently used cache sector;

instructions for, upon determining that said first set of cache sectors comprises multiple cache sectors, determining a second set of cache sectors among said first set of cache sectors, wherein each of said second set of cache sectors has the least amount of valid data among said first set of cache sectors; and

instructions for, upon determining that said second set of cache sectors comprises multiple cache sectors, selecting a random cache sector among said second set of cache sectors for replacement.

6. The computer program product according to claim 5 , further comprising:

instructions for, upon determining that said second set of cache sectors comprises one cache sector, selecting a second single cache sector for replacement.

7. The computer program product according to claim 5 , further comprising instructions for marking said most recently used cache sector among said plurality of cache sectors.

8. The computer program product according to claim 7 , wherein said instructions for marking said most recently used cache sector comprises instructions for storing in a directory entry an identifier corresponding to said most recently used cache sector.

9. A system comprising:

a processor; and

one or more memory elements storing a program, which, when executed on said processor, performs an operation of selecting a cache sector among a plurality of cache sectors for replacement in a computer system, said operation comprising:

determining a first set of cache sectors among said plurality of cache sectors excluding a most recently used cache sector, wherein each of said first set of cache sectors has the least amount of modified data among said plurality of cache sectors excluding said most recently used cache sector;

upon determining that said first set of cache sectors comprises multiple cache sectors, determining a second set of cache sectors among said first set of cache sectors, wherein each of said second set of cache sectors has the least amount of valid data among said first set of cache sectors; and

upon determining that said second set of cache sectors comprises multiple cache sectors, selecting a random cache sector among said second set of cache sectors for replacement.

10. The system of claim 9 , wherein said operation further comprises:

upon determining that said second set of cache sectors comprises one cache sector, selecting a second single cache sector for replacement.

11. The system of claim 9 , wherein said operation further comprises marking said most recently used cache sector among said plurality of cache sectors.

12. The system of claim 11 , wherein said marking step comprises storing in a directory entry an identifier corresponding to said most recently used cache sector.

13. The method according to claim 1 , further comprising:

upon determining that said first set of cache sectors comprises one cache sector, selecting a first single cache sector for replacement.

14. The computer program product according to claim 5 , further comprising:

instructions for, upon determining that said first set of cache sectors comprises one cache sector, selecting a first single cache sector for replacement.

15. The system according to claim 9 , wherein said operation further comprises:

upon determining that said first set of cache sectors comprises one cache sector, selecting a first single cache sector for replacement.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 10, 2014
From: INTERNATIONAL BUSINESS MACHINES CORPORATION
To: LENOVO INTERNATIONAL LIMITED
Reel/Frame 034194/0291 →