
Originally Posted by
Sidicas
Hrm, I'm surprised that the low-jitter kernel had any overall performance boost at all. I'd expect performance to be down slightly, nearly across the board. low-jitter is nice for gaming and is also nice for GPGPU as you have less chance for the GPU to go idle while waiting on the CPU. For GPGPU, it really doesn't take any CPU work at all to send work to the GPU, but if the CPU's work dispatcher (to the GPU) thread gets delayed by even a single ms, then it could mean losing a massive number of compute cycles on the GPU and a massive drop in GPU compute performance.
When we wrote the original folding@home wrapper for nVidia GPUs (CUDA) on Linux. Jitter was a big problem, I think partially because for whatever reason we had to use polling to check if the GPU was done with the GPGPU work previously sent. The problem was that we would sleep the work dispatcher thread to prevent wasting CPU, but it might have been many times longer than sleep duration before the GPU dispatcher thread got any CPU again. As a result, the GPU could go idle during that time and we'd lose massive amounts of GPU performance. I think some people fixed our initial work on the GPGPU wrapper by later going back and actively changing the polling interval to account for increasing jitter due to misc. system load. Increasing the amount of polling caused CPU usage to skyrocket on a thread that wasn't even doing any computation and the duration between each poll was still drastically random because of jitter. I had recommended people use low-jitter or real-time kernels for GPGPU work as they were clearly more efficient as we didn't have to use such aggressive polling and the thread would wake up from sleep exactly when it was supposed to. However, I think nVidia had a solution with the drivers where it wasn't necessary to use polling anymore for GPGPU.
The kernel is *VERY* good at scheduling things to get the most efficient use out of the CPU, but sometimes you don't want to schedule things that way because it could mean starving some very low CPU usage threads that are very time critical, and causing the GPU to idle for *far* too long. You can "kind-of" counter that by being very aggressive with the polling, but that causes CPU usage to skyrocket and it's a lot of wasted CPU cycles when the CPU isn't doing other work. It also doesn't absolutely guarantee the kernel will give you the CPU when your thread needs it most.
This is the kind of thing where I think Linux can really beat Windows at it's own game (pun intended). Linux can very easily be customized for optimal gaming all the way down to the kernel level (real-time / low-jitter kernels).