blackfin - cmpxchg not atomic ?
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
Signature · 3 lines
Mathieu Desnoyers Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
Quoted 3 lines · Mathieu Desnoyers
I am currently passing through each architectures adding a
cmpxchg_local()to eachsystem.h, and I notice that you disable interrupts in yourcmpxchg()implementation, why are you doing so ?
because Blackfin lacks any atomic instructions
Quoted 3 lines
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
Quoted 7 lines
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
Quoted 15 lines · * Mike Frysinger ([email protected]) wrote:
Quoted 3 lines · Mathieu Desnoyers
I am currently passing through each architectures adding a
cmpxchg_local()to eachsystem.h, and I notice that you disable interrupts in yourcmpxchg()implementation, why are you doing so ?because Blackfin lacks any atomic instructions
Quoted 3 lines
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
Quoted 2 lines
I also don't like the comment in
asm-blackfin/atomic.h:
Quoted 8 lines
Quoted 5 lines
* 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?
Signature · 3 lines
Mathieu Desnoyers Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F BA06 3F25 A8FE 3BAE 9A68
Quoted 19 lines · Mathieu Desnoyers
Quoted 18 lines · * Mike Frysinger ([email protected]) wrote:
Quoted 3 lines · Mathieu Desnoyers
I am currently passing through each architectures adding a
cmpxchg_local()to eachsystem.h, and I notice that you disable interrupts in yourcmpxchg()implementation, why are you doing so ?because Blackfin lacks any atomic instructions
Quoted 3 lines
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
Quoted 5 lines
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.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
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
Quoted 5 lines · Mike Frysinger
Quoted 3 lines
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
Signature · 5 lines
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-9Quoted 8 lines · Robert Schwebel
Quoted 5 lines · Mike Frysinger
Quoted 3 lines
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
On Fri 20 Jul 2007 16:28, Mathieu Desnoyers pondered:
Quoted 8 lines
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