From: Peter Zijlstra <peterz@infradead.org>
To: Catalin Marinas <catalin.marinas@arm.com>
Cc: Russell King - ARM Linux <linux@arm.linux.org.uk>,
Ohad Ben-Cohen <ohad@wizery.com>,
Hari Kanigeri <h-kanigeri2@ti.com>, Suman Anna <s-anna@ti.com>,
Benoit Cousson <b-cousson@ti.com>,
Tony Lindgren <tony@atomide.com>, Greg KH <greg@kroah.com>,
linux-kernel@vger.kernel.org,
Grant Likely <grant.likely@secretlab.ca>,
akpm@linux-foundation.org, linux-omap@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 0/3] Add OMAP hardware spinlock misc driver
Date: Mon, 18 Oct 2010 17:58:39 +0200 [thread overview]
Message-ID: <1287417519.1998.1943.camel@laptop> (raw)
In-Reply-To: <tnxaambh52q.fsf@e102109-lin.cambridge.arm.com>
On Mon, 2010-10-18 at 16:51 +0100, Catalin Marinas wrote:
> Peter Zijlstra <peterz@infradead.org> wrote:
> > On Mon, 2010-10-18 at 16:27 +0100, Catalin Marinas wrote:
> >> Peter Zijlstra <peterz@infradead.org> wrote:
> >> > On Mon, 2010-10-18 at 14:35 +0100, Russell King - ARM Linux wrote:
> >> >> In any case, Linux's spinlock API (or more accurately, the ARM exclusive
> >> >> access instructions) relies upon hardware coherency support (a piece of
> >> >> hardware called an exclusive monitor) which isn't present on the M3 nor
> >> >> DSP processors. So there's no way to ensure that updates from the M3
> >> >> and DSP are atomic wrt the A9 updates.
> >> >
> >> > Right, so the problem is that there simply is no way to do atomic memory
> >> > access from these auxiliary processing units wrt the main CPU? Seeing as
> >> > they operate on the same memory space, wouldn't it make sense to have
> >> > them cache-coherent and thus provide atomicy guarantees through that?
> >>
> >> With cache coherency you may get atomicity of writes or reads but
> >> usually not atomic modifications.
Right, so you forgot the qualifying part of your stmt: on ARM.
> > Sure, but you can 'easily' extend your coherency protocols with support
> > for things like ll/sc (or larger transactions).
> >
> > Have ll bring the cacheline into exclusive state and tag it, then
> > anything that demotes the cacheline will clear the tag and make sc fail.
>
> For the ll/sc operations on ARM (exclusive load/store) there is a
> per-CPU local exclusive monitor and a (virtual) global one. The global
> one may either be a separate piece of hardware or emulated via cache
> lines as you said.
> But if you need synchronisation with a CPU (or DSP)
> like Cortex-M3 which doesn't have any built-in caches, you can only get
> atomic operations on the main processor (A9) but not on the M3 (as you
> can't have a cache line in exclusive state on the M3).
Right, and I take it that modifying the M3 to participate in the full
coherency/exclusive monitor thing would have been more work.
> The M3 may have a local exclusive monitor (like the main CPU) but it
> isn't cleared by memory accesses from the main CPU.
Sounds like asking for trouble if you ask me ;-)
WARNING: multiple messages have this Message-ID (diff)
From: peterz@infradead.org (Peter Zijlstra)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 0/3] Add OMAP hardware spinlock misc driver
Date: Mon, 18 Oct 2010 17:58:39 +0200 [thread overview]
Message-ID: <1287417519.1998.1943.camel@laptop> (raw)
In-Reply-To: <tnxaambh52q.fsf@e102109-lin.cambridge.arm.com>
On Mon, 2010-10-18 at 16:51 +0100, Catalin Marinas wrote:
> Peter Zijlstra <peterz@infradead.org> wrote:
> > On Mon, 2010-10-18 at 16:27 +0100, Catalin Marinas wrote:
> >> Peter Zijlstra <peterz@infradead.org> wrote:
> >> > On Mon, 2010-10-18 at 14:35 +0100, Russell King - ARM Linux wrote:
> >> >> In any case, Linux's spinlock API (or more accurately, the ARM exclusive
> >> >> access instructions) relies upon hardware coherency support (a piece of
> >> >> hardware called an exclusive monitor) which isn't present on the M3 nor
> >> >> DSP processors. So there's no way to ensure that updates from the M3
> >> >> and DSP are atomic wrt the A9 updates.
> >> >
> >> > Right, so the problem is that there simply is no way to do atomic memory
> >> > access from these auxiliary processing units wrt the main CPU? Seeing as
> >> > they operate on the same memory space, wouldn't it make sense to have
> >> > them cache-coherent and thus provide atomicy guarantees through that?
> >>
> >> With cache coherency you may get atomicity of writes or reads but
> >> usually not atomic modifications.
Right, so you forgot the qualifying part of your stmt: on ARM.
> > Sure, but you can 'easily' extend your coherency protocols with support
> > for things like ll/sc (or larger transactions).
> >
> > Have ll bring the cacheline into exclusive state and tag it, then
> > anything that demotes the cacheline will clear the tag and make sc fail.
>
> For the ll/sc operations on ARM (exclusive load/store) there is a
> per-CPU local exclusive monitor and a (virtual) global one. The global
> one may either be a separate piece of hardware or emulated via cache
> lines as you said.
> But if you need synchronisation with a CPU (or DSP)
> like Cortex-M3 which doesn't have any built-in caches, you can only get
> atomic operations on the main processor (A9) but not on the M3 (as you
> can't have a cache line in exclusive state on the M3).
Right, and I take it that modifying the M3 to participate in the full
coherency/exclusive monitor thing would have been more work.
> The M3 may have a local exclusive monitor (like the main CPU) but it
> isn't cleared by memory accesses from the main CPU.
Sounds like asking for trouble if you ask me ;-)
next prev parent reply other threads:[~2010-10-18 15:58 UTC|newest]
Thread overview: 157+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-18 7:44 [PATCH 0/3] Add OMAP hardware spinlock misc driver Ohad Ben-Cohen
2010-10-18 7:44 ` Ohad Ben-Cohen
2010-10-18 7:44 ` Ohad Ben-Cohen
2010-10-18 7:44 ` [PATCH 1/3] drivers: misc: add omap_hwspinlock driver Ohad Ben-Cohen
2010-10-18 7:44 ` Ohad Ben-Cohen
2010-10-18 7:44 ` Ohad Ben-Cohen
2010-10-19 15:46 ` Greg KH
2010-10-19 15:46 ` Greg KH
2010-10-19 20:18 ` Ohad Ben-Cohen
2010-10-19 20:18 ` Ohad Ben-Cohen
2010-10-19 16:58 ` Kevin Hilman
2010-10-19 16:58 ` Kevin Hilman
2010-10-19 16:58 ` Kevin Hilman
2010-10-19 20:21 ` Ohad Ben-Cohen
2010-10-19 20:21 ` Ohad Ben-Cohen
2010-10-19 20:21 ` Ohad Ben-Cohen
2010-10-19 17:01 ` Grant Likely
2010-10-19 17:01 ` Grant Likely
2010-10-19 17:01 ` Grant Likely
2010-10-19 20:43 ` Ohad Ben-Cohen
2010-10-19 20:43 ` Ohad Ben-Cohen
2010-10-19 20:58 ` Arnd Bergmann
2010-10-19 20:58 ` Arnd Bergmann
2010-10-19 21:57 ` Ohad Ben-Cohen
2010-10-19 21:57 ` Ohad Ben-Cohen
2010-10-19 17:16 ` Kevin Hilman
2010-10-19 17:16 ` Kevin Hilman
2010-10-19 17:16 ` Kevin Hilman
2010-10-20 13:00 ` Ohad Ben-Cohen
2010-10-20 13:00 ` Ohad Ben-Cohen
2010-10-20 18:18 ` Kevin Hilman
2010-10-20 18:18 ` Kevin Hilman
2010-10-20 18:18 ` Kevin Hilman
2010-10-19 17:21 ` Arnd Bergmann
2010-10-19 17:21 ` Arnd Bergmann
2010-10-19 20:51 ` Ohad Ben-Cohen
2010-10-19 20:51 ` Ohad Ben-Cohen
2010-10-19 21:08 ` Arnd Bergmann
2010-10-19 21:08 ` Arnd Bergmann
2010-10-20 22:43 ` Ohad Ben-Cohen
2010-10-20 22:43 ` Ohad Ben-Cohen
2010-10-21 9:04 ` Arnd Bergmann
2010-10-21 9:04 ` Arnd Bergmann
2010-10-21 10:13 ` Ohad Ben-Cohen
2010-10-21 10:13 ` Ohad Ben-Cohen
2010-10-21 12:02 ` Arnd Bergmann
2010-10-21 12:02 ` Arnd Bergmann
2010-10-22 17:00 ` Tony Lindgren
2010-10-22 17:00 ` Tony Lindgren
2010-10-18 7:44 ` [PATCH 2/3] OMAP4: hwmod data: Add hwspinlock Ohad Ben-Cohen
2010-10-18 7:44 ` Ohad Ben-Cohen
2010-10-18 7:44 ` Ohad Ben-Cohen
2010-10-18 7:44 ` [PATCH 3/3] omap: add hwspinlock device Ohad Ben-Cohen
2010-10-18 7:44 ` Ohad Ben-Cohen
2010-10-18 7:44 ` Ohad Ben-Cohen
2010-10-19 17:03 ` Kevin Hilman
2010-10-19 17:03 ` Kevin Hilman
2010-10-19 17:03 ` Kevin Hilman
2010-10-19 17:05 ` Grant Likely
2010-10-19 17:05 ` Grant Likely
2010-10-19 21:02 ` Ohad Ben-Cohen
2010-10-19 21:02 ` Ohad Ben-Cohen
2010-10-19 21:02 ` Ohad Ben-Cohen
2010-10-19 23:12 ` Grant Likely
2010-10-19 23:12 ` Grant Likely
2010-10-19 23:12 ` Grant Likely
2010-10-20 14:09 ` Ohad Ben-Cohen
2010-10-20 14:09 ` Ohad Ben-Cohen
2010-10-20 15:51 ` Grant Likely
2010-10-20 15:51 ` Grant Likely
2010-10-20 15:51 ` Grant Likely
2010-10-19 23:53 ` Kevin Hilman
2010-10-19 23:53 ` Kevin Hilman
2010-10-19 23:53 ` Kevin Hilman
2010-10-20 1:20 ` Ryan Mallon
2010-10-20 1:20 ` Ryan Mallon
2010-10-20 14:38 ` Ohad Ben-Cohen
2010-10-20 14:38 ` Ohad Ben-Cohen
2010-10-20 15:55 ` Grant Likely
2010-10-20 15:55 ` Grant Likely
2010-10-20 18:37 ` Kevin Hilman
2010-10-20 18:37 ` Kevin Hilman
2010-10-20 19:21 ` Ohad Ben-Cohen
2010-10-20 19:21 ` Ohad Ben-Cohen
2010-10-20 19:21 ` Ohad Ben-Cohen
2010-10-20 23:58 ` Kevin Hilman
2010-10-20 23:58 ` Kevin Hilman
2010-10-20 23:58 ` Kevin Hilman
2010-10-21 6:11 ` Ohad Ben-Cohen
2010-10-21 6:11 ` Ohad Ben-Cohen
2010-10-21 6:11 ` Ohad Ben-Cohen
2010-10-21 8:36 ` Kamoolkar, Mugdha
2010-10-21 8:36 ` Kamoolkar, Mugdha
2010-10-21 8:36 ` Kamoolkar, Mugdha
2010-10-21 9:06 ` Ohad Ben-Cohen
2010-10-21 9:06 ` Ohad Ben-Cohen
2010-10-22 9:59 ` Kamoolkar, Mugdha
2010-10-22 9:59 ` Kamoolkar, Mugdha
2010-10-22 11:16 ` Ohad Ben-Cohen
2010-10-22 11:16 ` Ohad Ben-Cohen
2010-10-21 12:26 ` Kanigeri, Hari
2010-10-21 12:26 ` Kanigeri, Hari
2010-10-21 12:26 ` Kanigeri, Hari
2010-10-22 10:14 ` Kamoolkar, Mugdha
2010-10-22 10:14 ` Kamoolkar, Mugdha
2010-10-22 10:14 ` Kamoolkar, Mugdha
2010-10-22 16:56 ` Tony Lindgren
2010-10-22 16:56 ` Tony Lindgren
2010-10-22 17:03 ` Grant Likely
2010-10-22 17:03 ` Grant Likely
2010-10-22 17:28 ` Tony Lindgren
2010-10-22 17:28 ` Tony Lindgren
2010-10-24 17:54 ` Ohad Ben-Cohen
2010-10-24 17:54 ` Ohad Ben-Cohen
2010-10-25 19:02 ` Tony Lindgren
2010-10-25 19:02 ` Tony Lindgren
2010-10-26 11:54 ` Ohad Ben-Cohen
2010-10-26 11:54 ` Ohad Ben-Cohen
2010-10-26 19:06 ` Tony Lindgren
2010-10-26 19:06 ` Tony Lindgren
2010-10-18 12:46 ` [PATCH 0/3] Add OMAP hardware spinlock misc driver Peter Zijlstra
2010-10-18 12:46 ` Peter Zijlstra
2010-10-18 13:35 ` Russell King - ARM Linux
2010-10-18 13:35 ` Russell King - ARM Linux
2010-10-18 13:43 ` Peter Zijlstra
2010-10-18 13:43 ` Peter Zijlstra
2010-10-18 14:28 ` Ohad Ben-Cohen
2010-10-18 14:28 ` Ohad Ben-Cohen
2010-10-18 14:33 ` Peter Zijlstra
2010-10-18 14:33 ` Peter Zijlstra
2010-10-18 14:33 ` Peter Zijlstra
2010-10-18 14:39 ` Ohad Ben-Cohen
2010-10-18 14:39 ` Ohad Ben-Cohen
2010-10-18 15:27 ` Catalin Marinas
2010-10-18 15:27 ` Catalin Marinas
2010-10-18 15:32 ` Peter Zijlstra
2010-10-18 15:32 ` Peter Zijlstra
2010-10-18 15:35 ` Ohad Ben-Cohen
2010-10-18 15:35 ` Ohad Ben-Cohen
2010-10-18 15:48 ` Peter Zijlstra
2010-10-18 15:48 ` Peter Zijlstra
2010-10-18 15:51 ` Catalin Marinas
2010-10-18 15:51 ` Catalin Marinas
2010-10-18 15:58 ` Peter Zijlstra [this message]
2010-10-18 15:58 ` Peter Zijlstra
2010-10-19 23:31 ` Daniel Walker
2010-10-19 23:31 ` Daniel Walker
2010-10-20 6:13 ` Ohad Ben-Cohen
2010-10-20 6:13 ` Ohad Ben-Cohen
2010-10-20 10:00 ` Ohad Ben-Cohen
2010-10-20 10:00 ` Ohad Ben-Cohen
2010-10-20 22:29 ` Bryan Huntsman
2010-10-20 22:29 ` Bryan Huntsman
2010-10-20 9:53 ` Russell King - ARM Linux
2010-10-20 9:53 ` Russell King - ARM Linux
2010-10-20 22:15 ` Daniel Walker
2010-10-20 22:15 ` Daniel Walker
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=1287417519.1998.1943.camel@laptop \
--to=peterz@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=b-cousson@ti.com \
--cc=catalin.marinas@arm.com \
--cc=grant.likely@secretlab.ca \
--cc=greg@kroah.com \
--cc=h-kanigeri2@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=ohad@wizery.com \
--cc=s-anna@ti.com \
--cc=tony@atomide.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.