System Call Cache Pollution

Friends. I want to study the effect of cache pollution due to the operating system on application performance.

To do this, I wrote a small user test program.

1. malloc an array of size = l1 data cache-size
2. repeat ... sweep this array from start to end (hit-rate = 1.0)
3. *** perform a system call that thrashes l1 data cache ***
4. sweep the array once again (expected hit-rate = ~0.7 ---> 1.0) 

Step 2 of the algorithm reads the full array multiple times. We hope that the array will remain in the cache and, therefore, will lead to a keystroke of 1.

After making a system call, I will try to read the cache again. But I guess the OS crossed out some of the cache lines belonging to the user.

As you can see, the program relies on a system call to strip many lines of user data from the l1 data cache. How can I achieve this?

I assume that the system call should be associated with a file or stream.

+4
source share
2 answers

The effects in the L1 cache will differ from system call to system call. One method is to make several different system calls and measure the impact of each of them (including, for example, I / O-related calls, such as write()where you can change the size of the buffer and thus the likely effect on the cache).

You probably want to avoid system calls implemented as vsyscalls (for example gettimeofday()), since they do not require switching to kernel space. See [ 1 , 2 ].

, L1d, , , , : 2 , , L1i . , L1d L1i , i-cache.

, .

+1

Hennessy Patterson - - . L1- - . , - , , № 3, L1. , L1i .

0

All Articles