Community
cancel
Showing results for 
Search instead for 
Did you mean: 
kewenpan
Beginner
157 Views

how to charaterize cache footprint?

Thank you,Rober Reed.

Your suggestions are very important for me to further study cache tuning.

I am studying on cache footprint for these days and would try to find some methods to charaterize cache

footprint.Maybe i am a little fuzzy about the concept of cache foorprint.

My understanding on cache footprint is as follows:

first, cache footprint is the frequency of accessing cache entry(TLB or L1 data cache) ????

for example ,Assure we access B object. we must fetch the pointer of B in A object before accessing B .

if both A and B are in the same cache page , we can directly find the pointer of B in TLB.The frequency of cache footprint is "1".if not ,the frequency is "2".

if both A and B is in the alignment space,we also can get the same result as the above only by accessing L1 data cache not TLB.

The smaller cache footprint of accessing cache entry in executing a task ,the higher the cache hit ratio ?

The smaller cache footprint of accessing cache entry in executing a task,the less the cache and the main memory interactive ?

The smaller cache footprint of accessing cache entry in executing a task,the faster the task executed ?


the above is my understanding about cache footprint,please correct my error.

I still have some questions which make me confused.Looking forward for your explantation.

first. the sentence "processes with small cache footprint might be scheduled together to share the available cache while another process that is a cache hog would get its own, private HW thread, the idea can reduce cache thrashing between processes."?

what is the mean of cache hog?

It means cache hot or larger cache footprint or others?

could you take a example about the above ?i don't exactly understand.

thank you for your reading and looking forward your reply.


0 Kudos
4 Replies
robert-reed
Valued Contributor II
157 Views

Sorry for the delay in my response. I saw your query in the other thread but just hadn't had time to get back to it.

I tried looking for a common definition of cache footprint but couldn't find one. Here's my understanding of cache footprint. Most programs require access to data in memory to complete their goals, but the amount of data, their distribution through memory and the occasions for their reuse vary from program to program. Most datum accesses will be cached and will have an impact in the amount of cache used by a program. Those data that are used once and then discarded require cache lines at various levels of the cache but can't really take advantage of them beyond prefetching adjacent data in the same line that may be about to be used by the program. However, performance benefits can be gained if data are used more than once and if those reuses can be satisfied by the existing cached copy(or copies).

In light of these observations, the cache footprint can be thought of as the amount of cache that improves performance by enabling fast data reuse within the program. It doesn't count cache lines that are used just once for a particular memory location, though these accesses may impact the ability of other programs to keep their reusable data in cache (or in the closest caches). In that sense it's related to the working set of the program. Two programs with smaller working sets may execute in separate time slices on a given HW thread without evicting each other's cache lines just as they may survive each other's execution slice without losing the physical memory pages containing their separate data. On the other hand, there may be another application with a bigger working set which gains performance via cached data reuse when running on its own HW thread but would suffer in performance if another program started on the HW thread and started evicting cache lines that the first program might eventually reuse. In the sense that the former program needs all those distinct cache lines in order to gain best performance, I would term ita cache hog, and in the speculated process scheduler try to give it its own thread to use.
kewenpan
Beginner
157 Views

i am still confused about cache footprint.

"cache footprint can be thought of as the amount of cache that improves performance by enabling fast data

reuse within the program."

what is the mean of small or largecache footprint ?

Could you take a specific example in multi-core architecture?

thank you.

Thomas_W_Intel
Employee
157 Views

I think it is best to leave out running several programs for a moment. Let us consider only one process and consider a system where the last level cache is shared. For the "cache footprint" it is then not important if the process uses one or several threads. Vaguely speaking, the cache footprint tells you how large the cache needs to be for the application to run smoothly.
If you assume that you could change the cache size of theprocessor by disabling parts ofcache or adding more cache, the cache footprint then corresponds to the size where adding more cache does not improve the performance anymore. An application with a small cache footprint cannot take advantage of a large cache; an application witha large cache footprint won't perform on a processor with small cache.
With this in mind, I think Robert's explanation captures very well what the cache footprint is and what its implications are.

kewenpan
Beginner
157 Views

thank you for Thomas Willhalm and Robert 's excellent explantation.

i am a student and have been studying on cache tuning .

i am lack of further understanding on cache principle.so i could be confused about your explantation.

i will continue to be studying for this aspect.

Reply