Merged yesterday to Linux 6.15 Git and marked for back-porting to stable kernel series in the coming days is an x86 memory management fix to eliminate a window whereby TLB flushes could be inadvertently skipped.
Intel Linux engineers have fixed a kernel bug introduced last December where some Translation Lookaside Buffer (TLB) flushes could be accidentally skipped.
Intel engineer Dave Hansen explained with the now-merged patch fixing the issue:
“tl;dr: There is a window in the mm switching code where the new CR3 is set and the CPU should be getting TLB flushes for the new mm. But should_flush_tlb() has a bug and suppresses the flush. Fix it by widening the window where should_flush_tlb() sends an IPI.”
This fix will be in tomorrow’s Linux 6.15-rc6 release and also back-ported to fix the stable Linux kernel versions over the past six months since the bug was introduced.
This will cause more TLB flushes now, but at least this fix isn’t expected to measurably hurt performance:
“This will cause more TLB flush IPIs. But the window is relatively small and I do not expect this to cause any kind of measurable performance impact.”