Hybrid-type cache mechanism
A system is disclosed. The system includes at least one physical memory device to store a cache table and report generation logic and cache management logic and one or more processors coupled with the at least one physical memory device to execute the cache management logic to perform cache operations on the cache table based on content types associated with each of a plurality of entries in the cache table, wherein each entry includes a tag, a type identifier (ID) and a payload.
1 . A system comprising:
at least one physical memory device to store a cache table and report generation logic and cache management logic; and
one or more processors coupled with the at least one physical memory device to execute the cache management logic to:
assign a priority value to each content type inserted into each line in the cache table, wherein a cache line includes a tag, a type identifier (ID) and a payload;
generate a type-boundary bitmap (TBBM) including a priority associated with each type ID implemented in the cache table;
map each type ID to a priority value;
perform a replacement operation based on priority values of entry content type, including:
receiving a request to insert a new entry;
randomly selecting a type ID;
locating a first entry in the cache table having the type ID; and
replacing the first entry with the new entry.
2 . The system of claim 1 , wherein a first cache entry comprises a first type ID indicating a first type of content stored in the first cache entry and a second cache entry comprises a second type ID indicating a second type of content stored in the second cache entry.
3 . The system of claim 1 , wherein the cache management logic further to assign a survival rate to each type ID implemented in the cache table.
4 . The system of claim 3 , wherein performing the replacement operation comprises selecting a first random entry in the cache table, generating a random variable, determining whether the random variable is greater than a survival rate associated with the first random entry and replacing the first random entry with a new entry upon determining that the random variable is greater than the survival rate.
5 . The system of claim 4 , wherein performing the replacement operation further comprises selecting a second random entry in the cache table upon determining that the random variable is not greater than the survival rate.
6 . The system of claim 1 , wherein the cache management logic further to perform a search operation.
7 . The system of claim 6 , wherein performing the search operation comprises receiving a search request including the type ID and performing a search using the tag and the type ID is included in the cache table.
8 . A method comprising:
assigning a priority value to each of a plurality of content types included in cache line entries in a cache table;
generating a type-boundary bitmap (TBBM) including a priority associated with each type ID implemented in the cache table;
mapping each type ID to a priority value; and
performing a replacement operation based on priority values of entry content type, including;
receiving a request to insert a new entry;
randomly selecting a type ID;
locating a first entry in the cache table having the type ID; and
replacing the first entry with the new entry.
9 . The method of claim 8 , further comprising assigning a survival rate to each type ID.
10 . The method of claim 8 , further comprising performing a search operation.
11 . The method of claim 10 , wherein performing the replacement operation comprises receiving a request to insert a new entry, determining a first entry in the cache table having a lower priority than the new entry and replacing the first entry with the new entry.
12 . The method of claim 10 , further comprising assigning a threshold value to each type ID implemented in the cache table and assign a counter to each type ID, wherein each counter represents a quantity of entries in the cache table associated with a type ID.
13 . The method of claim 12 , wherein performing the replacement operation comprises receiving a request to insert a new entry, determining whether a counter has a value that is greater than an associated threshold value and replacing a first entry having a type ID associated with the counter with the new entry upon determining that the counter has a greater value.
14 . The method of claim 13 , wherein performing the replacement operation further comprises replacing a random second entry with the new entry upon determining that no counter has the greater value.
15 . The method of claim 14 , wherein performing the replacement operation further comprises incrementing the counter associated with the type ID for the new entry and decrementing the counter associated with the type ID for the replaced entry.
16 . The method of claim 3 , wherein performing the search operation comprises:
receiving a search request including the type ID; and
performing a search using a tag and the type ID is included in the cache table.
17 . The method of claim 8 , wherein performing the replacement operation comprises:
selecting a first random entry in the cache table;
generating a random variable;
determining whether the random variable is greater than a survival rate associated with the first random entry; and
replacing the first random entry with a new entry upon determining that the random variable is greater than the survival rate.
18 . The method of claim 17 , wherein performing the replacement operation comprises selecting a second random entry in the cache table upon determining that the random variable is not greater than the survival rate.
19 . The method of claim 8 , further comprising assigning a survival rate to each type ID implemented in the cache table.
20 . At least one non-transitory computer readable medium having instructions stored thereon, which when executed by one or more processors, cause the processors to:
assign a priority value to each of a plurality of content types included in cache line entries in a cache table;
generate a type-boundary bitmap (TBBM) including a priority associated with each type ID implemented in the cache table;
map each type ID to a priority value; and
perform a replacement operation based on priority values of entry content type, including;
receiving a request to insert a new entry;
randomly selecting a type ID;
locating a first entry in the cache table having the type ID; and
replacing the first entry with the new entry.