Re: Interrupts with SMP defined

David S. Miller (davem@dm.cobaltmicro.com)
Wed, 4 Mar 1998 16:31:50 -0800


Date: Wed, 4 Mar 1998 17:03:17 -0500 (EST)
From: Chris Loveland <cwl@fclinux-e.iol.unh.edu>

spin_lock_irqsave(&some_lock, flags1);
/* interupts now off */
save_flags(flags2);
cli();
restore_flags(flags2);
/* interupts are back on, bad stuff happens */
spin_unlock_irqrestore(&some_lock, flags1);

Don't do that.... it's just as bad (although not the same problem)
as going:

spinlock_t a;
spinlock_t b;
spin_lock(&a);
spin_lock(&b);
spin_unlock(&a);
spin_unlock(&b);

Later,
David S. Miller
davem@dm.cobaltmicro.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu