raw_spinlock_t rules
Some time ago, the i8259 emulation code in kvm was changed to useraw_spinlock_t, as it was called in a preempt_disable() and local_irq_disable() context, which doesn't work with preemptible spinlocks used with CONFIG_PREEMPT_RT.
In Linux 2.6.37, the spinlock will no longer be taken in these contexts, so I'd like to change it to a normal spinlock_t. However, it is still taken in a spin_lock_irq() context.
Is it okay to do this change? I figured since spin_lock_irq() is part of the spinlock infrastructure it might to the right thing.
Signature · 1 line
error compiling committee.c: too many arguments to function
Quoted 5 lines · Avi Kivity
Some time ago, the i8259 emulation code in kvm was changed to use
raw_spinlock_t, as it was called in apreempt_disable()andlocal_irq_disable()context, which doesn't work with preemptible spinlocks used withCONFIG_PREEMPT_RT.
Quoted 7 lines
In Linux 2.6.37, the spinlock will no longer be taken in these contexts, so I'd like to change it to a normal
spinlock_t. However, it is still taken in aspin_lock_irq()context.Is it okay to do this change? I figured since
spin_lock_irq()is part of the spinlock infrastructure it might to the right thing.
In PREEMPT_RT all interrupts (besides the timer) is converted to a thread. The spin_lock_irq() will not disable interrupts in PREEMPT_RT, because it is not needed (irqs are threaded and wont cause a deadlock if they share the same spin_locks).
Note, spin_locks used by the timer will must be raw_spin_lock(), and threaded context must disable interrupts for real before using it.
-- Steve
Quoted 14 lines · Steven Rostedt
Quoted 5 lines · Avi Kivity
Some time ago, the i8259 emulation code in kvm was changed to use
raw_spinlock_t, as it was called in apreempt_disable()andlocal_irq_disable()context, which doesn't work with preemptible spinlocks used withCONFIG_PREEMPT_RT.Quoted 7 lines
In Linux 2.6.37, the spinlock will no longer be taken in these contexts, so I'd like to change it to a normal
spinlock_t. However, it is still taken in aspin_lock_irq()context.Is it okay to do this change? I figured since
spin_lock_irq()is part of the spinlock infrastructure it might to the right thing.
Quoted 8 lines
In
PREEMPT_RTall interrupts (besides the timer) is converted to a thread. Thespin_lock_irq()will not disable interrupts inPREEMPT_RT, because it is not needed (irqs are threaded and wont cause a deadlock if they share the samespin_locks).Note,
spin_locksused by the timer will must beraw_spin_lock(), and threaded context must disable interrupts for real before using it.
Thanks. So it looks like we can convert that spinlock.
Signature · 1 line
error compiling committee.c: too many arguments to function