Sectored cache replacement algorithm for reducing memory writebacks
Abstract
A 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 algorithm implemented by the method and computer program product accounts for both hit rate and bus utilization.
Claims
exact text as granted — not AI-modified1 . 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; and upon determining that said first set of cache sectors comprises one cache sector, selecting a first single cache sector for replacement.
2 . The method according to claim 1 , further comprising:
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 one cache sector, selecting a second single cache sector for replacement.
3 . The method according to claim 2 , further comprising, 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.
4 . The method according to claim 1 , further comprising marking said most recently used cache sector among said plurality of cache sectors.
5 . The method according to claim 4 , wherein said marking step comprises storing in a directory entry an identifier corresponding to said most recently used cache sector.
6 . 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; and instructions for, upon determining that said first set of cache sectors comprises one cache sector, selecting a first single cache sector for replacement.
7 . The computer program product according to claim 6 , further comprising:
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 one cache sector, selecting a second single cache sector for replacement.
8 . The computer program product according to claim 7 , further comprising 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.
9 . The computer program product according to claim 6 , further comprising instructions for marking said most recently used cache sector among said plurality of cache sectors.
10 . The computer program product according to claim 9 , wherein said instructions for marking said most recently used cache sector comprise instructions for storing in a directory entry an identifier corresponding to said most recently used cache sector.
11 . 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; and
upon determining that said first set of cache sectors comprises one cache sector, selecting a first single cache sector for replacement.
12 . The system according to claim 11 , wherein said operation further comprises:
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 one cache sector, selecting a second single cache sector for replacement.
13 . The system according to claim 12 , wherein said operation further comprises, 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.
14 . The system according to claim 11 , wherein said operation further comprises marking said most recently used cache sector among said plurality of cache sectors.
15 . The system according to claim 14 , wherein said marking step comprises storing in a directory entry an identifier corresponding to said most recently used cache sector.
16 . The method according to claim 5 , wherein said identifier is a numerical identifier based on a physical location of said most recently used cache sector.
17 . The computer program product according to claim 10 , wherein said identifier is a numerical identifier based on a physical location of said most recently used cache sector.
18 . The system according to claim 15 , wherein said identifier is a numerical identifier based on a physical location of said most recently used cache sector.Join the waitlist — get patent alerts
Track US2014208038A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.