4 ms·
One thing I still don't understand about all this: Why is there still a (smaller) performance hit from the KPTI patch when PCID is used?
by KerrickStaley 9y ago
One thing I still don't understand about all this:
Why is there still a (smaller) performance hit from the KPTI patch when PCID is used?
- deleted 9y ago[deleted]
- dmitrygr 9y agowith PCID, you only flush the kernel mappings out of the TLB (as user mappings are the same). Without PCID you can only flush TLB or not, so you do, and thus user mappings are gone too and need to be repopulated.
- ploxiln 9y agoYou still have to switch the page tables via the CR3 register. It costs. And the code around there is more complicated now and has more conditionals ... as they say, it'll be opimized over time, this was the fastest reasonable solution they could put in there (and it still took some time). Also keep in mind that the reason PCID wasn't used by Linux until 4.14 is that the most obvious way of using it incurred more overhead managing the IDs than it saved by not flushing the TLB between different userland processes. This is the land of fiddly details where theory and practice collide and theory often loses in practice.