4 ms·
Why do you assume that you get the whole L1 code cache to yourself? I would think that on a real desktop system you would be lucky to get even half of it.
by briansmith 17y ago
Why do you assume that you get the whole L1 code cache to yourself? I would think that on a real desktop system you would be lucky to get even half of it.
- DarkShikari 17y agoThe L1 cache is only 32 (or 64) kilobytes. One program's time slice lasts at least a few milliseconds, easily 100 times longer than would be necessary to fill up the cache with that program's code data. The OS can't dedicate parts of the L1 cache to different applications (the CPU doesn't offer any feature to allow it to do so), nor would it be a good idea to do so.
- briansmith 17y agoI see now. You take for granted that the L1 cache will get completely replaced during every context switch. And, it wouldn't matter anyway, because the context switch itself is already a massive performance hit relative to the L1 cache misses.
- ntoshev 17y agoI would expect the hyperthreaded cores share their cache between both threads though.
- DarkShikari 17y agoThat could actually be a good explanation for why reducing code cache pressure can help even in cases where it doesn't make sense that it would; because the another thread is also using that cache. Though I wonder if that's true of all SMT chips; I wonder if any chips have dual L1 caches for exactly this reason?