Custom Search

Re: spin locks and migrate_disable()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



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
--
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


[RT Stable]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Photo]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

Add to Google Powered by Linux