Messages in this thread | | | Date | Fri, 25 Feb 2000 14:58:12 -0800 | From | "David S. Miller" <> | Subject | Re: down_trylock doesn't preserve irqstate |
| |
Date: Fri, 25 Feb 2000 14:37:13 -0800 From: Rajagopal Ananthanarayanan <ananth@sgi.com>
One problem we encountered in using down_trylock is that __down_trylock() uses spin_lock_irq() and spin_unlock_irq(), which does not preserve the interrupt state of the caller.
You should not acquire a semaphore with interrupts disabled.
And if the semaphore sleeps, you'll end up with IRQs enabled when it wakes up.
A few months ago we went scattering around fixing up places which assumed IRQ state was preserved across sleep points, let's not add new ones (and thus new bugs).
Later, David S. Miller davem@redhat.com
- 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/
| |