Skip to contentSkip to conversation

in_atomic() & spin_lock / spin_unlock in different functions

DISCUSSION Manfred Spraul 1 participant 1 message Oct 13, 2002

lore
Share & tools
lore
#0 lore raw
Quoted 3 lines

What is it that in_atomic counts? Obviously spinlocks and get_cpu/put_cpu. Anything else?

preempt_disable(), local_irq_disable(), local_bh_disable().

Quoted 3 lines

I'm doing spin_lock_irqsave() then in another function spin_unlock_irqrestore. Is that okay? If no, can it cause "scheduling in atomic"?

It's not okay, but shouldn't cause scheduling in atomic messages.

The problem is sparc: the 'unsigned long flags' parameter used by _irqsave and _irqrestore contains the stack frame, which means that you cannot pass it between functions.

--
Manfred