From: Thomas Gleixner <tglx@linutronix.de>
To: Frank Rowand <frank.rowand@am.sony.com>
Cc: linux-rt-users@vger.kernel.org
Subject: Re: spin locks and migrate_disable()
Date: Fri, 13 Apr 2012 09:52:59 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.02.1204130950190.2542@ionos> (raw)
In-Reply-To: <4F762C59.4050008@am.sony.com>
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
prev parent reply other threads:[~2012-04-13 7:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-30 21:57 spin locks and migrate_disable() Frank Rowand
2012-04-13 7:52 ` Thomas Gleixner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LFD.2.02.1204130950190.2542@ionos \
--to=tglx@linutronix.de \
--cc=frank.rowand@am.sony.com \
--cc=linux-rt-users@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox