I did some more reading on this. The zero value is likely wrong. It should be:
You can check whether or not you need MTRR cleanup by running cat /proc/mtrr
. Here is what mine looked like before enabling MTRR cleanup:
reg00: base=0x0d0000000 ( 3328MB), size= 256MB, count=1: uncachable
reg01: base=0x0e0000000 ( 3584MB), size= 512MB, count=1: uncachable
reg02: base=0x000000000 ( 0MB), size= 8192MB, count=1: write-back
reg03: base=0x200000000 ( 8192MB), size= 512MB, count=1: write-back
reg04: base=0x220000000 ( 8704MB), size= 256MB, count=1: write-back
With MTRR cleanup enabled, cat /proc/mtrr
reg00: base=0x000000000 ( 0MB), size= 2048MB, count=1: write-back
reg01: base=0x080000000 ( 2048MB), size= 1024MB, count=1: write-back
reg02: base=0x0c0000000 ( 3072MB), size= 256MB, count=1: write-back
reg03: base=0x100000000 ( 4096MB), size= 4096MB, count=1: write-back
reg04: base=0x200000000 ( 8192MB), size= 512MB, count=1: write-back
reg05: base=0x220000000 ( 8704MB), size= 256MB, count=1: write-back
If cat /proc/mtrr
shows uncachable lines, then you need to do something about it. One way is to go into your BIOS, find the MTRR setting and change it from continuous to discrete. The other way is to enable MTRR cleanup, either via a boot parameter or by recompiling your kernel.
Here are my references:
The Gentoo Nvidia guide says that having uncachable in /proc/mtrr is a problem. The MTRR at the unofficial Gentoo Wiki explains the nature of the MTRR settings. The blog talks about the kernel parameters.
With the MTRR fixed, the issues I have been having appear to have gone away. I think that the reason for this is because as stuff runs, it is allocated randomly in system memory by heap randomization. If you have uncachable MTRR entries, then anything allocated inside of them will suffer a performance penalty, which will cause lag that can expose race conditions in code that normally would not occur. At the same time, there could be multiple issues at work here, so fixing this issue will not solve the fixing the other issues affecting people, but so far, my issues appear to be fixed.