Re: loopback blockdev deadlocks -- explained?

From: Maciej W. Rozycki (macro@ds2.pg.gda.pl)
Date: Tue Apr 18 2000 - 07:27:08 EST


On Tue, 18 Apr 2000, Tigran Aivazian wrote:

> --- linux/arch/i386/kernel/smp.c Tue Apr 18 08:56:43 2000
> +++ work/arch/i386/kernel/smp.c Mon Apr 17 21:44:59 2000
> @@ -146,7 +146,7 @@
> /*
> * Setup KDB IPI to be delivered as an NMI
> */
> - cfg = (cfg&~APIC_DEST_DM_MASK)|APIC_DEST_DM_NMI;
> + cfg = (cfg&~APIC_DM_EXTINT)|APIC_DM_NMI;
> }
> #endif /* CONFIG_KDB */

 Hmm, you'd better define APIC_DEST_DM_MASK for clarity, instead, just
like the original kdb patch does. Although your change is correct, it may
be confusing.

 There is a more serious issue with the above code -- it won't work for
i82489DX-based systems and the actual behaviour can be unpredictable. The
problem is the i82489DX requires NMI to be programmed as level-triggered
by definition and asserted and deasserted separately (the integrated APIC
has no such event as an interrupt deassertion). For this exact purpose
you'd better avoid to use send_IPI_*() functions for kdb purpose (hurting
the performance of __send_IPI_shortcut(), additionally).

 I believe you'd better write a separate send_IPI_NMI() function which
would properly handle NMI interrupts -- basically need to send either one
or two IPIs (depending on the version of the APIC used in a system) and in
the latter case you need to take care of the hold time for both the
assertion and the deassertion period of NMI.

-- 
+  Maciej W. Rozycki, Technical University of Gdansk, Poland   +
+--------------------------------------------------------------+
+        e-mail: macro@ds2.pg.gda.pl, PGP key available        +

- 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/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:13 EST