Re: when spin_lock_irq (as opposed to spin_lock_irqsave) is appropriate?

From: Oliver Neukum
Date: Sat Oct 11 2008 - 11:43:30 EST


Am Samstag, 11. Oktober 2008 17:29:01 schrieb Andrey Borzenkov:
> Logically, one piece of kernel code has no way to know whether another
> piece of kernel code (or may be hard-/firmware) has disabled some
> interrupt line. So it looks like spin_lock_irq should not even exist,
> except may be for very specific cases (where we are sure no other piece
> of kernel code may run concurrently)?
>
> Sorry for stupid question, I an not actually a HW type of person ...
>

This has no connection with individual irq lines. It's about being able
to sleep. Kernel code usually knows whether it can sleep.
If it knows to be able to sleep it can use spin_lock_irq() which is
more efficient than spin_lock_irqsave()

Regards
Oliver

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/