Methods and apparatuses for dynamically changing data priority in a cache
Embodiments are generally directed to methods and apparatuses for dynamically changing data priority in a cache. An embodiment of an apparatus comprising: a priority controller to: receive a memory access request to request data; and set a priority flag for the memory access request based on an accumulated access amount of data stored in a memory block to be accessed by the memory access request to dynamically change a priority level of the requested data.
1 . An apparatus comprising:
processing circuitry to:
determine whether a target cache line storing data is found in a cache, wherein the data is requested via a memory access request;
if the target cache line is not found in the cache, determine whether a free cache line is found in the cache;
if the target cache line and the free cache line are not found in the cache, determine whether a priority flag is set to low; and
if the priority flag is set to low, process the memory access request in a memory that is set at a level lower than the cache.
2 . The apparatus of claim 1 , wherein the processor circuitry is further to if the target cache line is found in the cache, read the data from the target cache line or write the data to the target cache line.
3 . The apparatus of claim 1 , wherein the processor circuitry is further to if the free cache line is found in the cache, perform a cache fill operation on the free cache line, and read the data from the free cache line or write the data to the free cache line.
4 . The apparatus of claim 1 , wherein the processor circuitry is further to if the priority flag is not set to low, perform a cache eviction operation and a cache fill operation on a cache line selected from the cache, and read the data from the selected cache line or write the data to the selected cache line.
5 . The apparatus of claim 1 , wherein to process the memory access request with the priority flag in the cache comprises:
to store the data in the cache with the priority level indicated by the priority flag, wherein the priority flag is set for the memory access request based on an accumulated accesses for the data such that the priority level is dynamically altered corresponding to a change in the accumulated accesses; and
to evict the data in the cache with an equal or lower priority level than the priority level associated with the data.
6 . The apparatus of claim 1 , wherein the cache comprises a unified cache, and wherein the processing circuitry is coupled to a memory, the processing circuitry having graphics processing circuitry or application processing circuitry.
7 . At least one computer-readable medium having stored thereon instructions which, when executed, cause a computing device to perform operations comprising:
determining whether a target cache line storing data is found in a cache, wherein the data is requested via a memory access request;
if the target cache line is not found in the cache, determining whether a free cache line is found in the cache;
if the target cache line and the free cache line are not found in the cache, determining whether a priority flag is set to low; and
if the priority flag is set to low, processing the memory access request in a memory that is set at a level lower than the cache.
8 . The computer-readable medium of claim 7 , wherein the operations further comprise if the target cache line is found in the cache, reading the data from the target cache line or writing the data to the target cache line.
9 . The computer-readable medium of claim 7 , wherein the operations further comprise if the free cache line is found in the cache, performing a cache fill operation on the free cache line, and reading the data from the free cache line or writing the data to the free cache line.
10 . The computer-readable medium of claim 7 , wherein the operations further comprise if the priority flag is not set to low, performing a cache eviction operation and a cache fill operation on a cache line selected from the cache, and reading the data from the selected cache line or writing the data to the selected cache line.
11 . The computer-readable medium of claim 7 , wherein processing the memory access request with the priority flag in the cache comprises:
storing the data in the cache with the priority level indicated by the priority flag, wherein the priority flag is set for the memory access request based on an accumulated accesses for the data such that the priority level is dynamically altered corresponding to a change in the accumulated accesses; and
evicting the data in the cache with an equal or lower priority level than the priority level associated with the data.
12 . The computer-readable medium of claim 7 , wherein the cache comprises a unified cache, and wherein the computing device comprises processing circuitry coupled to a memory, the processing circuitry having graphics processing circuitry or application processing circuitry.
13 . A method comprising:
determining, by a computing device, whether a target cache line storing data is found in a cache, wherein the data is requested via a memory access request;
if the target cache line is not found in the cache, determining whether a free cache line is found in the cache;
if the target cache line and the free cache line are not found in the cache, determining whether a priority flag is set to low; and
if the priority flag is set to low, processing the memory access request in a memory that is set at a level lower than the cache.
14 . The method of claim 13 , further comprising if the target cache line is found in the cache, read the data from the target cache line or write the data to the target cache line.
15 . The method of claim 13 , further comprising if the free cache line is found in the cache, perform a cache fill operation on the free cache line, and reading the data from the free cache line or writing the data to the free cache line.
16 . The method of claim 13 , further comprising if the priority flag is not set to low, perform a cache eviction operation and a cache fill operation on a cache line selected from the cache, and reading the data from the selected cache line or writing the data to the selected cache line.
17 . The method of claim 13 , wherein processing the memory access request with the priority flag in the cache comprises:
storing the data in the cache with the priority level indicated by the priority flag, wherein the priority flag is set for the memory access request based on an accumulated accesses for the data such that the priority level is dynamically altered corresponding to a change in the accumulated accesses; and
evicting the data in the cache with an equal or lower priority level than the priority level associated with the data.
18 . The method of claim 13 , wherein the cache comprises a unified cache, and wherein the computing device comprises processing circuitry coupled to a memory, the processing circuitry having graphics processing circuitry or application processing circuitry.