]> Zhao Yanbai Git Server - minix.git/commitdiff
Remove unnecessary TLB flushes
authorTomas Hruby <tom@minix3.org>
Wed, 22 Sep 2010 08:01:36 +0000 (08:01 +0000)
committerTomas Hruby <tom@minix3.org>
Wed, 22 Sep 2010 08:01:36 +0000 (08:01 +0000)
- this should be only for SMP

kernel/arch/i386/klib.S
kernel/proc.c

index e7e7feb89ab5dc912846bb0fcbc41706b2b32ee2..515ea5ea1b3e8fbd07861f0c57c6ac0d5e8176c9 100644 (file)
@@ -803,7 +803,7 @@ ENTRY(__switch_address_space)
         * test if the cr3 is loaded with the current value to avoid unnecessary
         * TLB flushes
         */
-#if 0
+#ifndef CONFIG_SMP
        mov     %cr3, %ecx
        cmp     %ecx, %eax
        je      0f
index a3f339917a5b04b8828b3e35aa7d2d54860e0305..3f541b47999b48f9e725f7a981788bbe246a0048 100644 (file)
@@ -374,7 +374,9 @@ check_misc_flags:
        p->p_misc_flags &= ~MF_CONTEXT_SET;
 
        assert(!(p->p_misc_flags & MF_FULLVM) || p->p_seg.p_cr3 != 0);
+#ifdef CONFIG_SMP
        refresh_tlb();
+#endif
        /*
         * restore_user_context() carries out the actual mode switch from kernel
         * to userspace. This function does not return