* spin locks and migrate_disable()
@ 2012-03-30 21:57 Frank Rowand
2012-04-13 7:52 ` Thomas Gleixner
0 siblings, 1 reply; 2+ messages in thread
From: Frank Rowand @ 2012-03-30 21:57 UTC (permalink / raw)
To: Thomas Gleixner; +Cc: linux-rt-users
Hi Thomas,
Two questions about spin_lock() in include/linux/spinlock_rt.h.
(1) spin_lock() and related functions invoke migrate_disable() and
migrate_enable(). These functions are created by your patch,
sched-migrate-disable.patch, and are EXPORT_SYMBOL_GPL(). Would
you be willing to change these to EXPORT_SYMBOL()?
(2) What is the purpose of the migrate_disable() in the spin lock?
Is it a correctness issue, or a performance issue, or something else?
Thanks!
-Frank
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: spin locks and migrate_disable()
2012-03-30 21:57 spin locks and migrate_disable() Frank Rowand
@ 2012-04-13 7:52 ` Thomas Gleixner
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Gleixner @ 2012-04-13 7:52 UTC (permalink / raw)
To: Frank Rowand; +Cc: linux-rt-users
On Fri, 30 Mar 2012, Frank Rowand wrote:
> Hi Thomas,
>
> Two questions about spin_lock() in include/linux/spinlock_rt.h.
>
> (1) spin_lock() and related functions invoke migrate_disable() and
> migrate_enable(). These functions are created by your patch,
> sched-migrate-disable.patch, and are EXPORT_SYMBOL_GPL(). Would
> you be willing to change these to EXPORT_SYMBOL()?
Sigh. Yes.
> (2) What is the purpose of the migrate_disable() in the spin lock?
> Is it a correctness issue, or a performance issue, or something else?
Correctness. spinlocks disable preemption in mainline and therefor
migration. So you can access per cpu data in a spinlocked section. Now
with RT the section becomes preemptible. The lock prevents reentrancy,
but we could be migrated away so the task might access parts of the
per cpu data on one and then on the other cpu. Not really a good
idea. Therefor we disable migration.
Thanks,
tglx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-04-13 7:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-30 21:57 spin locks and migrate_disable() Frank Rowand
2012-04-13 7:52 ` Thomas Gleixner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox