Re: [RFC][PATCH] mm: ifdef out VM_BUG_ON check on PREEMPT_RT_FULL
From: Steven Rostedt <rostedt@goodmis.org>
Date: 2015-06-01 19:28:26
Also in:
linux-mm
From: Steven Rostedt <rostedt@goodmis.org>
Date: 2015-06-01 19:28:26
Also in:
linux-mm
On Mon, 1 Jun 2015 15:00:47 -0400 Johannes Weiner [off-list ref] 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