From 4158d899b56870b65b14e866882db103de2f8536 Mon Sep 17 00:00:00 2001 From: 4lDO2 <4lDO2@protonmail.com> Date: Wed, 24 Jul 2024 22:38:25 +0200 Subject: [PATCH] Probably fix TLB shootdown "diagonal" livelock. Diagonal as in Thread A Thread B Send to B Send to A Wait for B Wait for A. I haven't reproduced this bug, but this should fix it, since the wait steps now checks the local percpu block for pending TLB shootdowns onto itself. --- src/context/memory.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/context/memory.rs b/src/context/memory.rs index b7d4094fb5..0956c1c092 100644 --- a/src/context/memory.rs +++ b/src/context/memory.rs @@ -2898,6 +2898,7 @@ impl<'guard, 'addrsp> Flusher<'guard, 'addrsp> { } while self.state.ackword.load(Ordering::SeqCst) < affected_cpu_count { + PercpuBlock::current().maybe_handle_tlb_shootdown(); core::hint::spin_loop(); }