Lazy TLB Improvements Heading To Linux 4.19
Written by Michael Larabel in Hardware on 30 July 2018 at 07:55 AM EDT. 2 Comments
HARDWARE --
The lazy TLB mode as a way to delay translation look-aside buffer updates will be improved upon with the upcoming Linux 4.19 kernel.

The first change queued ahead of the Linux 4.19 kernel merge window is leaving the lazy TLB mode at page table free time. As explained by that commit, "speculative memory accesses while in lazy TLB mode can crash a system, when a CPU tries to dereference a speculative access using memory contents that used to be valid page table memory, but have since been reused for something else and point into la-la land. The latter problem can be prevented in two ways. The first is to always send a TLB shootdown IPI to CPUs in lazy TLB mode, while the second one is to only send the TLB shootdown at page table freeing time."

Beyond that fix to avoid a possible system crash in the lazy TLB mode, the lazy TLB mode is being enhanced to improve system performance. This follow-on commit is making the lazy TLB mode even lazier. "Lazy TLB mode can result in an idle CPU being woken up by a TLB flush, when all it really needs to do is reload %CR3 at the next context switch, assuming no page table pages got freed... This patch reduces total CPU use in the system by about 1-2% for a memcache workload on two socket systems, and by about 1% for a heavily multi-process netperf between two systems."

Following these patches and more is also a switch to always using the kernel's lazy TLB mode. These changes are queuing as part of the x86/mm feature work for Linux 4.19.
About The Author
Author picture

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 10,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter or contacted via MichaelLarabel.com.

Related Hardware News
Popular News This Week