The effect of context switches on cache performance

Jeffrey C. Mogul, Anita Borg · 1991

The sustained performance of fast processors is critically dependent on cache performance.Cache performance in turn depends on locality of reference.When an operating system switches contexts, the assumption of locality may be violated because the instructions and data of the newly-scheduled process may no longer be in the cache(s).Context-switching thus has a cost above that associated with that of the operations performed by the kernel.We fed address traces of the processes running on a multi-tasking operating system through a cache simulator, to compute accurate cache-hit rates over short intervals.By marking the output of such a simulation whenever a context switch occurs, and then aggregating the postcontext-switch results of a large number of context switches, it is possible to estimate the cache performance reduction caused by a switch.Depending on cache parameters the net cost of a context switch appears to be in the thousands of cycies, or tens to hundreds of microseconds.

Read the paper · More papers on PaperTik