On Mon, 1 Jun 2015 15:00:47 -0400 Johannes Weiner <hannes@xxxxxxxxxxx> wrote: > Andrew's suggestion makes sense, we can probably just delete the check > as long as we keep the comment. > > That being said, I think it's a little weird that this doesn't work: > > spin_lock_irq() > BUG_ON(!irqs_disabled()) > spin_unlock_irq() > > I'd expect that if you change the meaning of spin_lock_irq() from > "mask hardware interrupts" to "disable preemption by tophalf", you > would update the irqs_disabled() macro to match. Most people using > this check probably don't care about the hardware state, only that > they don't get preempted by an interfering interrupt handler, no? The thing is, in -rt, there's no state to check if a spin_lock_irq() was done. Adding that would add overhead to the rt_mutexes without much gain. The fast path of spin_lock_irq() in -rt looks like this: migrate_disable(); rt_mutex_cmpxchg(lock, NULL, current); Now, the migrate_disable() is more like preempt disable. Although, maybe we could have -rt change irq_disabled() just check that, and add a raw_irq_disabled() for when we need to make sure interrupts are really off. -- Steve -- To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html