The Linux Kernel has removed PREEMPT_NONE and PREEMPT_VOLUNTARY.

Posted by InfinitesimaInfinity@reddit | linux | View on Reddit | 37 comments

PREEMPT_NONE has previously existed to provide a way to gain more throughput on almost all workloads at the expense of also gaining some more latency, and it was better for most server workloads, which value throughput more than latency.

For workloads that spend most of their time in spinlocks, it was actually able to have significantly lower latency than the other preemption options, as well.

According to Salvatore Dipietro, some PostgreSQL workloads have approximately half the performance when using PREEMPT_LAZY vs PREEMPT_NONE.

The Linux kernel maintainers have responded that PostgreSQL should add the use of the "RSEQ timeslice extension", which enables a process to ask the kernel to delay preemption for a short period of time. (The default delay is 5 millionths of a second.)

However, this solution is not perfect. First of all, it would require PostgreSQL to make changes that would make PostgreSQL unable to work on any machines that do not have an up to date kernel, dropping support for all kernels below version 7. Second of all, it would still reduce throughput and latency on such workloads. It would merely reduce them less.