I finally have convenient access to a quad processor system and have been
investigating why the deadlock avoidance code I added to Linux 2.0 a while back
seems to be ineffective on quad processor systems even though it works quite
well for dual processor systems.  The enclosed patch corrects a bug in the
original deadlock avoidance code where a processor other than the boot
processor sets the smp_blocked_interrupt_pending flag, leading to chaos when
the kernel lock is yielded to the boot processor inappropriately.  Normal
interrupts will only be directed to the boot processor, but interrupts can also
be directed via the I/O APIC and that case was not accounted for in the
previous code.

                Leonard


--- linux/include/asm-i386/irq.h-       Wed Jun  3 15:17:49 1998
+++ linux/include/asm-i386/irq.h        Sat Oct  3 10:58:46 1998
@@ -162,6 +162,8 @@
        "jnc 3f\n\t" \
        "cmpb "SYMBOL_NAME_STR(active_kernel_processor)", %al\n\t" \
        "je 4f\n\t" \
+       "cmpb "SYMBOL_NAME_STR(boot_cpu_id)", %al\n\t" \
+       "jne 2f\n\t" \
        "movb $1, "SYMBOL_NAME_STR(smp_blocked_interrupt_pending)"\n\t" \
        "2: " \
         SMP_PROF_INT_SPINS \
@@ -190,7 +192,10 @@
        "movb %al, "SYMBOL_NAME_STR(active_kernel_processor)"\n\t" \
        "4: " \
        "incl "SYMBOL_NAME_STR(kernel_counter)"\n\t" \
+       "cmpb "SYMBOL_NAME_STR(boot_cpu_id)", %al\n\t" \
+       "jne 7f\n\t" \
        "movb $0, "SYMBOL_NAME_STR(smp_blocked_interrupt_pending)"\n\t" \
+       "7: " \
        "popfl\n\t" \
        "popl %edx\n\t" \
        "popl %ecx\n\t" \

Reply via email to