linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* blackfin - cmpxchg not atomic ?
@ 2007-07-20 20:28 Mathieu Desnoyers
  2007-07-20 20:36 ` Mike Frysinger
  2007-07-23 17:24 ` Robin Getz
  0 siblings, 2 replies; 7+ messages in thread
From: Mathieu Desnoyers @ 2007-07-20 20:28 UTC (permalink / raw)
  To: tonyko, robin.getz; +Cc: linux-kernel

Hello,

I am currently passing through each architectures adding a
cmpxchg_local() to each system.h, and I notice that you disable
interrupts in your cmpxchg() implementation, why are you doing so ?
Also, does you assembly stub _really_ modify memory atomically ? If yes,
then there should be no need for disabling interrupts. Else, I see a
major problem with SMP.

I also don't like the comment in asm-blackfin/atomic.h :

 * Generally we do not concern about SMP BFIN systems, so we don't have
 * to deal with that.

I have seen on the blackfin website that you actually sell a board with
SMP. Why aren't you caring about it ?

Mathieu

-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: blackfin - cmpxchg not atomic ?
  2007-07-20 20:28 blackfin - cmpxchg not atomic ? Mathieu Desnoyers
@ 2007-07-20 20:36 ` Mike Frysinger
  2007-07-20 20:45   ` Mathieu Desnoyers
  2007-07-21  7:29   ` Robert Schwebel
  2007-07-23 17:24 ` Robin Getz
  1 sibling, 2 replies; 7+ messages in thread
From: Mike Frysinger @ 2007-07-20 20:36 UTC (permalink / raw)
  To: Mathieu Desnoyers; +Cc: tonyko, robin.getz, linux-kernel

On 7/20/07, Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> wrote:
> I am currently passing through each architectures adding a
> cmpxchg_local() to each system.h, and I notice that you disable
> interrupts in your cmpxchg() implementation, why are you doing so ?

because Blackfin lacks any atomic instructions

> Also, does you assembly stub _really_ modify memory atomically ? If yes,
> then there should be no need for disabling interrupts. Else, I see a
> major problem with SMP.

that isnt the only problem with SMP on Blackfin

> I also don't like the comment in asm-blackfin/atomic.h :
>
>  * Generally we do not concern about SMP BFIN systems, so we don't have
>  * to deal with that.
>
> I have seen on the blackfin website that you actually sell a board with
> SMP. Why aren't you caring about it ?

just because a processor has more than one core does not make it SMP
-mike

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: blackfin - cmpxchg not atomic ?
  2007-07-20 20:36 ` Mike Frysinger
@ 2007-07-20 20:45   ` Mathieu Desnoyers
  2007-07-20 20:59     ` Mike Frysinger
  2007-07-21  7:29   ` Robert Schwebel
  1 sibling, 1 reply; 7+ messages in thread
From: Mathieu Desnoyers @ 2007-07-20 20:45 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: tonyko, robin.getz, linux-kernel

* Mike Frysinger (vapier.adi@gmail.com) wrote:
> On 7/20/07, Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> wrote:
> >I am currently passing through each architectures adding a
> >cmpxchg_local() to each system.h, and I notice that you disable
> >interrupts in your cmpxchg() implementation, why are you doing so ?
> 
> because Blackfin lacks any atomic instructions
> 
> >Also, does you assembly stub _really_ modify memory atomically ? If yes,
> >then there should be no need for disabling interrupts. Else, I see a
> >major problem with SMP.
> 
> that isnt the only problem with SMP on Blackfin
> 
> >I also don't like the comment in asm-blackfin/atomic.h :
> >
> > * Generally we do not concern about SMP BFIN systems, so we don't have
> > * to deal with that.
> >
> >I have seen on the blackfin website that you actually sell a board with
> >SMP. Why aren't you caring about it ?
> 
> just because a processor has more than one core does not make it SMP
> -mike

I see, thanks for the reply. Is there a particular reason for
implementing system.h/cmpxchg() in assembly rather that in plain C then?

-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: blackfin - cmpxchg not atomic ?
  2007-07-20 20:45   ` Mathieu Desnoyers
@ 2007-07-20 20:59     ` Mike Frysinger
  0 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2007-07-20 20:59 UTC (permalink / raw)
  To: Mathieu Desnoyers, Bernd Schmidt; +Cc: robin.getz, linux-kernel

On 7/20/07, Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> wrote:
> * Mike Frysinger (vapier.adi@gmail.com) wrote:
> > On 7/20/07, Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> wrote:
> > >I am currently passing through each architectures adding a
> > >cmpxchg_local() to each system.h, and I notice that you disable
> > >interrupts in your cmpxchg() implementation, why are you doing so ?
> >
> > because Blackfin lacks any atomic instructions
> >
> > >Also, does you assembly stub _really_ modify memory atomically ? If yes,
> > >then there should be no need for disabling interrupts. Else, I see a
> > >major problem with SMP.
> >
> > that isnt the only problem with SMP on Blackfin
> >
> > >I also don't like the comment in asm-blackfin/atomic.h :
> > >
> > > * Generally we do not concern about SMP BFIN systems, so we don't have
> > > * to deal with that.
> > >
> > >I have seen on the blackfin website that you actually sell a board with
> > >SMP. Why aren't you caring about it ?
> >
> > just because a processor has more than one core does not make it SMP
>
> I see, thanks for the reply. Is there a particular reason for
> implementing system.h/cmpxchg() in assembly rather that in plain C then?

honestly ?  probably not :)

Bernd would probably know best (he's good like that)
-mike

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: blackfin - cmpxchg not atomic ?
  2007-07-20 20:36 ` Mike Frysinger
  2007-07-20 20:45   ` Mathieu Desnoyers
@ 2007-07-21  7:29   ` Robert Schwebel
  2007-07-21  8:37     ` Mike Frysinger
  1 sibling, 1 reply; 7+ messages in thread
From: Robert Schwebel @ 2007-07-21  7:29 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: Mathieu Desnoyers, tonyko, robin.getz, linux-kernel

On Fri, Jul 20, 2007 at 04:36:12PM -0400, Mike Frysinger wrote:
> > Also, does you assembly stub _really_ modify memory atomically ? If yes,
> > then there should be no need for disabling interrupts. Else, I see a
> > major problem with SMP.
> 
> that isnt the only problem with SMP on Blackfin

Could you ealborate?

Robert
-- 
 Dipl.-Ing. Robert Schwebel | http://www.pengutronix.de
 Pengutronix - Linux Solutions for Science and Industry
   Handelsregister:  Amtsgericht Hildesheim, HRA 2686
     Hannoversche Str. 2, 31134 Hildesheim, Germany
   Phone: +49-5121-206917-0 |  Fax: +49-5121-206917-9


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: blackfin - cmpxchg not atomic ?
  2007-07-21  7:29   ` Robert Schwebel
@ 2007-07-21  8:37     ` Mike Frysinger
  0 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2007-07-21  8:37 UTC (permalink / raw)
  To: Robert Schwebel; +Cc: Mathieu Desnoyers, tonyko, robin.getz, linux-kernel

On 7/21/07, Robert Schwebel <r.schwebel@pengutronix.de> wrote:
> On Fri, Jul 20, 2007 at 04:36:12PM -0400, Mike Frysinger wrote:
> > > Also, does you assembly stub _really_ modify memory atomically ? If yes,
> > > then there should be no need for disabling interrupts. Else, I see a
> > > major problem with SMP.
> >
> > that isnt the only problem with SMP on Blackfin
>
> Could you ealborate?

i'm pretty sure there's already been a thread on LKML about it ... the
fact that our parts currently lack any sort of cache snooping or
control over any other is a huge issue.

we've contracted a company to do SMP, but it'll have quite a bit of
overhead since it'll need to do a lot of communication/message passing
between cores to account for these hardware deficiencies.
-mike

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: blackfin - cmpxchg not atomic ?
  2007-07-20 20:28 blackfin - cmpxchg not atomic ? Mathieu Desnoyers
  2007-07-20 20:36 ` Mike Frysinger
@ 2007-07-23 17:24 ` Robin Getz
  1 sibling, 0 replies; 7+ messages in thread
From: Robin Getz @ 2007-07-23 17:24 UTC (permalink / raw)
  To: Mathieu Desnoyers; +Cc: tonyko, linux-kernel

On Fri 20 Jul 2007 16:28, Mathieu Desnoyers pondered:
>
> I also don't like the comment in asm-blackfin/atomic.h :
> 
>  * Generally we do not concern about SMP BFIN systems, so we don't have
>  * to deal with that.
> 
> I have seen on the blackfin website that you actually sell a board with
> SMP. Why aren't you caring about it ?

Just because something is dual core - doesn't mean it is capable of true SMP.

The 2 blackfin cores on the BF561 have their own L1 cache, but the caches are 
not coherent to the internal L2 (which is not cache, but just memory), or 
external L3.

This precludes SMP where common memory must be addressed by both cores.

-Robin

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-07-23 17:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-20 20:28 blackfin - cmpxchg not atomic ? Mathieu Desnoyers
2007-07-20 20:36 ` Mike Frysinger
2007-07-20 20:45   ` Mathieu Desnoyers
2007-07-20 20:59     ` Mike Frysinger
2007-07-21  7:29   ` Robert Schwebel
2007-07-21  8:37     ` Mike Frysinger
2007-07-23 17:24 ` Robin Getz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).