4 ms·
>Usermode processes call privileged processes often (kernel APIs for example), if you flush the cache every time a context switch occurs, processing is now orde
by coldtea 9y ago
>Usermode processes call privileged processes often (kernel APIs for example), if you flush the cache every time a context switch occurs, processing is now orders of magnitude slower.
Could there be a separate OS cache and a regular user code cache? Would it also speed up things (if cheap enough)?
- Someone1234 9y agoSure, but you'd require additional hardware and there's the backwards compatibility question (i.e. it has to work on both the traditional shared cache model AND the new split cache model, or you'd wind up with two versions of x86-64 that were incompatible).
- zaarn 9y agoIt could work in a backwards compatible manner like a lot of things. That could technically even be handled transparently by hardwiring caches for usage in Ring 3 or Ring 0 and then introducing additional opcode for explicitly allowing certain addresses to be put into Ring 3 cache when it goes into Ring 0 cache. PCID already does per-process caching, somewhat, though it's a bit neutered atm. The good thing is that it only needs to be backwards compatible in the sense that an OS that has no idea about this should at worst have a performance penalty. The hard point will be the additional hardware. L2 cache is expensive, L1 even moreso.