missing TLB flushes (2.3.13-2)

Manfred Spraul (manfreds@colorfullife.com)
Tue, 03 Aug 1999 11:17:56 +0200


Hi Linus,

on Friday, I sent you a mail with 2 possibly missing TLB flushes.
You fixed one of them in 2.3.13-1, but the other one is not fixed
(in 2.3.13-2).
Please send me a note if this is not a bug, so that I can stop
reposting this.

Problem:
on crossing TLB flushes, mm->cpu_vm_mask is not updated.

Fix:
add the code from smp_invalidate_interrupt() to flush_tlb_others()
Patch vs 2.3.13-2:
>>>>>>>>>>>>
--- arch/i386/kernel/smp.c.old Tue Aug 3 10:41:23 1999
+++ arch/i386/kernel/smp.c Tue Aug 3 10:44:26 1999
@@ -1634,7 +1634,10 @@
* Take care of "crossing" invalidates
*/
if (test_bit(cpu, &smp_invalidate_needed)) {
+ struct mm_struct *mm = current->mm;
clear_bit(cpu, &smp_invalidate_needed);
+ if (mm)
+ atomic_set_mask(1 << cpu,
&mm->cpu_vm_mask);
local_flush_tlb();
}
--stuck;
<<<<<<<<<<<

Description:
both flush_tlb_current() and flush_tlb_mm() rely on
mm->cpu_vm_mask to check which CPUs need a smp_invalidate_interrupt()
IPI. This flag is cleared by flush_tlb_??() and then set in
smp_invalidate_interrupt() if there is really a VM user on that CPU.

But this IPI could also be acknowledged by flush_tlb_others() if 2
CPUs execute a TLB flush at the same time, and in this
case the update of mm->cpu_vm_mask is missing.

Manfred

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/