Android patches add SMP support for ARM Cortex-A9 MP

437 views
Skip to first unread message

Andrea Gallo

unread,
Aug 28, 2009, 11:57:10 AM8/28/09
to android-platform, surinder-...@st.com, marco....@stericsson.com, vinay....@stericsson.com
We are porting Android to the ST-Ericsson U8500 chipset, which
contains a dual ARM Cortex A9 SMP CPU subsystem.

In order to enable Android to run on ARM SMP, we have applied an
initial set of simple modifications that we have already submitted
into Gerrit for code review:

Change id 11088 11089 11090 11092

These patches are actually of more general use for ARM v6 and v7 (i.e.
ARM11, ARM Cortex A8/A9) architectures. In particular they replace
the deprecated use of the 'swp' instruction in the bionic library with
ldrex/strex instructions, plus use is made of the TLS (Thread Local
Storage) register, instead of using the "magic" memory location in the
vector page. Memory barrier instructions are also added to enforce
memory consistency when using t __atomic_swap in bionics, and when
setting the TLS register. More details on these changes are
illustrated in the submitted patches above.

With these modifications, Andorid runs successfully in our SMP
platform, including Dalvik applications, browsing, media play. We
haven't observed any regression compared to single-core execution, nor
instabilities of any kind. Both cores are active of course, so that
the CPU load is balanced between the cores as expected, in multi-task/
multi-threaded conditions.

There are however several places in the Android sources where SMP
safeness is not clear, in particular after an initial scan, we found
that memory barriers are potentially missing in these places:

frameworks/base/libs/surfaceflinger/Barrier.h:32
bionic/libc/include/sys/cdefs.h:276
dalvik/vm/Atomic.h:34
external/tremor/Tremor/misc.h (#define MB())

plus probably others that we haven't found yet.

We keep working on our SMP port, and so we will do further testing and
more systematic checks of the places were SMP safeness is potentially
missing, updating the community on our findings of course. We
encourage and welcome any help on SMP safeness and optimization.

These patches have been posted in Gerrit by Vinay Harugop from ST-
Ericsson on behalf of Surinder-pal Singh from STMicroelectronics, who
has identified and developed them on ST-Ericsson U8500 platform.

Best regards

fadden

unread,
Aug 28, 2009, 3:48:46 PM8/28/09
to android-platform
On Aug 28, 8:57 am, Andrea Gallo <andrea.ga...@stericsson.com> wrote:
> With these modifications, Andorid runs successfully in our SMP
> platform, including Dalvik applications, browsing, media play.  We
> haven't observed any regression compared to single-core execution, nor
> instabilities of any kind.

Very cool.

> There are however several places in the Android sources where SMP
> safeness is not clear, in particular after an initial scan, we found
> that memory barriers are potentially missing in these places:
[...]
> dalvik/vm/Atomic.h:34

In addition to the incompletely defined memory barrier macro, there
are undoubtedly places in the VM code where memory barriers should be
used but aren't. Unfortunately that's going to require a bit of
concentrated effort to fix.
Reply all
Reply to author
Forward
0 new messages