Reducing cache pollution of a software controlled cache is provided. A request is received to prefetch data into the software controlled cache. A first designator is set for a first cache access to a first value. If there is the second cache access to prefetch, a determination is made as to whether data associated with the second cache access exists in the software controlled cache. If the data is in the software controlled cache, a determination is made as to whether a second value of a second designator is greater than the first value of the first cache access. If the second value fails to be greater than the first value, the position of the first cache access and the second cache access in a cache line is swapped. The first value is decremented by a predetermined amount and the second value is replaced to equal the first value.
Legal claims defining the scope of protection, as filed with the USPTO.
1. A method, in a data processing system, for reducing cache pollution of a software controlled cache using a look-ahead policy, the method comprising: receiving a request to prefetch data into the software controlled cache; setting a first designator for a first cache access to a first value; determining if there is a second cache access to prefetch; responsive to a determination that there is the second cache access to prefetch, determining if data associated with the second cache access exists in the software controlled cache; responsive to a determination that the data associated with the second cache access exists in the software controlled cache, determining if a second value of a second designator associated with the second cache access is greater than the first value of the first cache access; responsive to the second value failing to be greater than the first value, swapping the position of the first cache access and the second cache access in a cache line; decrementing the first value by a predetermined amount thereby forming a third value, wherein the first data access has a first designator equal to the third value; and replacing the second value to equal the first value, wherein the second data access has a second designator equal to the first value.
2. The method of claim 1 , further comprising: responsive to the second value being greater than the first value, prefetching the data associated with the second cache access into the software controlled cache in order.
3. The method of claim 1 , further comprising: responsive to a determination that the data associated with the second cache access fails to exist in the software controlled cache, prefetching the data associated with the second cache access into the software controlled cache in order.
4. The method of claim 1 , further comprising: responsive to receiving the request to prefetch the data into the software controlled cache, setting a variable associated with the first cache access equal to zero; responsive to a determination that the data associated with the second cache access exists in the software controlled cache, determining if the second value of the second designator associated with the second cache access is less than the variable; responsive to the second value failing to be less than the variable, swapping the position of the first cache access and the second cache access in the cache line; and incrementing the variable by a predetermined amount.
5. The method of claim 4 , further comprising: responsive to the second value being less than the variable, prefetching the data associated with the second cache access into the software controlled cache in order.
6. The method of claim 4 , further comprising: responsive to a determination that the data associated with the second cache access fails to exist in the software controlled cache, determining if the variable is equal to a predetermined number; responsive to the variable being equal to the predetermined number, evicting the first data access; prefetching the data associated with the second cache access into the software controlled cache; and incrementing the variable by the predetermined amount.
7. The method of claim 6 , further comprising: responsive to the variable failing to equal the predetermined number, prefetching the data associated with the second cache access into the software controlled cache in order.
8. A computer program product comprising a computer-readable storage medium having a computer readable program stored thereon, wherein the computer readable program, when executed on a computing device, causes the computing device to: receive a request to prefetch data into the software controlled cache; set a first designator for a first cache access to a first value; determine if there is a second cache access to prefetch; responsive to a determination that there is the second cache access to prefetch, determine if data associated with the second cache access exists in the software controlled cache; responsive to a determination that the data associated with the second cache access exists in the software controlled cache, determine if a second value of a second designator associated with the second cache access is greater than the first value of the first cache access; responsive to the second value failing to be greater than the first value, swap the position of the first cache access and the second cache access in a cache line; decrement the first value by a predetermined amount thereby forming a third value, wherein the first data access has a first designator equal to the third value; and replace the second value to equal the first value, wherein the second data access has a second designator equal to the first value.
9. The computer program product of claim 8 , wherein the computer readable program further causes the computing device to: responsive to the second value being greater than the first value, prefetch the data associated with the second cache access into the software controlled cache in order; and responsive to a determination that the data associated with the second cache access fails to exist in the software controlled cache, prefetch the data associated with the second cache access into the software controlled cache in order.
10. The computer program product of claim 8 , wherein the computer readable program further causes the computing device to: responsive to receiving the request to prefetch the data into the software controlled cache, set a variable associated with the first cache access equal to zero; responsive to a determination that the data associated with the second cache access exists in the software controlled cache, determine if the second value of the second designator associated with the second cache access is less than the variable; responsive to the second value failing to be less than the variable, swap the position of the first cache access and the second cache access in the cache line; and increment the variable by a predetermined amount.
11. The computer program product of claim 10 , wherein the computer readable program further causes the computing device to: responsive to the second value being less than the variable, prefetch the data associated with the second cache access into the software controlled cache in order.
12. The computer program product of claim 10 , wherein the computer readable program further causes the computing device to: responsive to a determination that the data associated with the second cache access fails to exist in the software controlled cache, determine if the variable is equal to a predetermined number; responsive to the variable being equal to the predetermined number, evict the first data access; prefetch the data associated with the second cache access into the software controlled cache; and increment the variable by the predetermined amount.
13. The computer program product of claim 12 , wherein the computer readable program further causes the computing device to: responsive to the variable failing to equal the predetermined number, prefetch the data associated with the second cache access into the software controlled cache in order.
14. An apparatus, comprising: a processor; and a memory coupled to the processor, wherein the memory comprises instructions which, when executed by the processor, cause the processor to: receive a request to prefetch data into the software controlled cache; set a first designator for a first cache access to a first value; determine if there is a second cache access to prefetch; responsive to a determination that there is the second cache access to prefetch, determine if data associated with the second cache access exists in the software controlled cache; responsive to a determination that the data associated with the second cache access exists in the software controlled cache, determine if a second value of a second designator associated with the second cache access is greater than the first value of the first cache access; responsive to the second value failing to be greater than the first value, swap the position of the first cache access and the second cache access in a cache line; decrement the first value by a predetermined amount thereby forming a third value, wherein the first data access has a first designator equal to the third value; and replace the second value to equal the first value, wherein the second data access has a second designator equal to the first value.
15. The apparatus of claim 14 , wherein the instructions further cause the processor to: responsive to the second value being greater than the first value, prefetch the data associated with the second cache access into the software controlled cache in order; and responsive to a determination that the data associated with the second cache access fails to exist in the software controlled cache, prefetch the data associated with the second cache access into the software controlled cache in order.
16. The apparatus of claim 14 , wherein the instructions further cause the processor to: responsive to receiving the request to prefetch the data into the software controlled cache, set a variable associated with the first cache access equal to zero; responsive to a determination that the data associated with the second cache access exists in the software controlled cache, determine if the second value of the second designator associated with the second cache access is less than the variable; responsive to the second value failing to be less than the variable, swap the position of the first cache access and the second cache access in the cache line; and increment the variable by a predetermined amount.
17. A method, in a data processing system, for reducing cache pollution of a software controlled cache using a look-back policy, the method comprising: receiving a request to prefetch data into the software controlled cache; setting a variable associated with a first cache access equal to zero; determining if there is a second cache access to prefetch; responsive to a determination that there is the second cache access to prefetch, determining if data associated with the second cache access exists in the software controlled cache; responsive to a determination that the data associated with the second cache access exists in the software controlled cache, determining if a value of a designator associated with the second cache access is less than the variable; responsive to the value failing to be less than the variable, swapping the position of the first cache access and the second cache access in a cache line; and incrementing the variable by a predetermined amount.
18. The method of claim 17 , further comprising: responsive to the value being less than the variable, adding the second cache access to the cache line in order.
19. The method of claim 17 , further comprising: responsive to a determination that the data associated with the second cache access fails to exist in the software controlled cache, determining if the variable is equal to a predetermined number; responsive to the variable being equal to the predetermined number, evicting the first data access; prefetching the data associated with the second cache access into the software controlled cache; and incrementing the variable by the predetermined amount.
20. The method of claim 19 , further comprising: responsive to the variable failing to equal the predetermined number, prefetching the data associated with the second cache access into the software controlled cache in order.
Cooperative Patent Classification codes for this invention. Click any code to explore related patents in that topic.
April 4, 2008
November 8, 2011
Browse 5M+ US patents with plain-English claim translations and AI-generated analysis.