Dual-AndroidTM on Nexus 10
Samsung Research UK
Presentation
for

Xen Developer Summit
24-25 Oct 2013
Edinburgh, UK

10/21/2013

© Samsung Electronics

1
Introduction
 Feasibility: 2 copies of Android on Xen on ARM?
o Xen on mobile performance?
o Virtualized GPU required

 Nexus 10 device used
o
o
o
o

CPU: ARM Cortex A15 (x2)

GPU: ARM Mali T604
Memory available: 2GB RAM, plenty of Flash
Screen resolution: 2560x1504

© Samsung Electronics

2
Configuration
 Software configuration – 2 VMs only
o
o
o
o

DOM0 = 1st Android

DOMU = 2nd Android
Linux 3.4
Android Jelly Bean 4.2

 Xen 4.2 for ARM
o Builds on Xen on ARM for Cortex A9 work in Samsung
o Parallel development in Samsung HQ to community

Xen
SMP
I/O

© Samsung Electronics

Dual-core

DOMU kernel

1GB RAM

Memory

DOM0 kernel

1GB RAM

Dual-core

Single-core

Pass through

PV Drivers

3
Xen PVH Architecture

DOM0

DOMU

Android
Apps

Android
Apps

Android
Jelly Bean 4.2

Linux 3.4

User
(PL0)

Kernel
(PL1)

Android
Jelly Bean 4.2

Linux 3.4

Physical
Drivers

HYP
(PL2)
HW

Back End
Drivers

Rings

Front End
Drivers

Xen on ARM
Display,
Touch
etc.

© Samsung Electronics

GPU
Mali T604

CPU 0
(Cortex A15)

CPU 1
(Cortex A15)
4
Mobile Virtualization
 I/O Challenges – Mobiles have ~50 device drivers
o Sensors: Touch, gyro, proximity, ambient light
o Media: Display, GPU, Camera, Audio, Video
o Connectivity: Charger, USB, WiFi, Bluetooth

 User Switching
o Xen scheduler runs as normal.
o “Foreground” VM – user devices require arbitration driver in DOM0
• Display
• Touch

Display
Switch

Foreground VM

© Samsung Electronics

5
Video
 Demo video
o
o
o
o

Switching between Android  Icon or Volume key
Angry Birds in DOMU  Near-native performance of PV drivers
Angry Birds in DOM0 and DOMU concurrently  Two independent Android
3D Benchmark clip
DOM0 – Blue Wallpaper

Passthrough drivers

DOMU – Orange Wallpaper

PV Drivers
Switching icon

© Samsung Electronics

6
Near-Native Performance Challenges
 60 frames per second = 16.6ms per frame
o GPU renders each surface  GPU composes the surfaces  frame

 Virtualized graphics options
o API Remoting done above GPU driver for chipset portability

 Android JB has “butter smooth” technology
o Triple buffering
o Needs reliable Vsync interrupt  Xen event channel stressed
o Deferred waiting using sync points & fences

Composition frame buffers

0
1
2

App frame buffers

0
1
2

0

© Samsung Electronics

15

30

45

60

time (ms)
7
Results
Dual-Android, GPU composition
70

160

60

140

FPS

100
40
80
30

60
20

Packets/sec (k)

120

50

40

10

20

0

0

DOM0

© Samsung Electronics

DOMU

Packets/sec (k)
8
Event Channel Under Stress
 DOMU Vsync arrival time delta

Delta Time (ms)

35
Some
missed
events

30
25
20

16.67

15
10
5
0
10

11

12

13

14

15

16

Benchmark Time (sec)
© Samsung Electronics

17

18

19

20
9
Xen For Mobile
 Multi-page ring
o Needed for throughput performance running benchmarks
o Ensure low-latency

 Non-linear grant references
o Old grants are re-used. PV drivers assume linearity

 RAM Allocation limit 512MB
o Buddy allocator is unable to allocate contiguous chunk of memory from the Domheap
memory

 Per-VM interrupts unreliable when stressed
o Must ensure Vsync is received in DOMU with minimal latency

 Contribution to community
o Samsung will work to share Xen changes with community
o Some code is proprietary

© Samsung Electronics

10
Conclusion
 Two Android can run with near-native graphics performance
 Xen runs well on mobile devices
 Using PV drivers, no major changes to Xen architecture required

Android is a trademark of Google Inc.
The Android robot is reproduced or modified from work created and shared by Google and used according to terms
described in the Creative Commons 3.0 Attribution License.
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.
ARM is a registered trademark of ARM Limited. Mali is a trademark of ARM Limited.
STAR WARS and related properties are trademarks in the United States and/or in other countries of Lucasfilm Ltd. and/or
its affiliates. © 2012 Lucasfilm Ltd. All rights reserved.
Angry Birds is a trademark of Rovio Entertainment Ltd.
© Samsung Electronics

11

XPDS13: Dual-Android on Nexus 10 - Lovene Bhatia, Samsung

  • 1.
    Dual-AndroidTM on Nexus10 Samsung Research UK Presentation for Xen Developer Summit 24-25 Oct 2013 Edinburgh, UK 10/21/2013 © Samsung Electronics 1
  • 2.
    Introduction  Feasibility: 2copies of Android on Xen on ARM? o Xen on mobile performance? o Virtualized GPU required  Nexus 10 device used o o o o CPU: ARM Cortex A15 (x2) GPU: ARM Mali T604 Memory available: 2GB RAM, plenty of Flash Screen resolution: 2560x1504 © Samsung Electronics 2
  • 3.
    Configuration  Software configuration– 2 VMs only o o o o DOM0 = 1st Android DOMU = 2nd Android Linux 3.4 Android Jelly Bean 4.2  Xen 4.2 for ARM o Builds on Xen on ARM for Cortex A9 work in Samsung o Parallel development in Samsung HQ to community Xen SMP I/O © Samsung Electronics Dual-core DOMU kernel 1GB RAM Memory DOM0 kernel 1GB RAM Dual-core Single-core Pass through PV Drivers 3
  • 4.
    Xen PVH Architecture DOM0 DOMU Android Apps Android Apps Android JellyBean 4.2 Linux 3.4 User (PL0) Kernel (PL1) Android Jelly Bean 4.2 Linux 3.4 Physical Drivers HYP (PL2) HW Back End Drivers Rings Front End Drivers Xen on ARM Display, Touch etc. © Samsung Electronics GPU Mali T604 CPU 0 (Cortex A15) CPU 1 (Cortex A15) 4
  • 5.
    Mobile Virtualization  I/OChallenges – Mobiles have ~50 device drivers o Sensors: Touch, gyro, proximity, ambient light o Media: Display, GPU, Camera, Audio, Video o Connectivity: Charger, USB, WiFi, Bluetooth  User Switching o Xen scheduler runs as normal. o “Foreground” VM – user devices require arbitration driver in DOM0 • Display • Touch Display Switch Foreground VM © Samsung Electronics 5
  • 6.
    Video  Demo video o o o o Switchingbetween Android  Icon or Volume key Angry Birds in DOMU  Near-native performance of PV drivers Angry Birds in DOM0 and DOMU concurrently  Two independent Android 3D Benchmark clip DOM0 – Blue Wallpaper Passthrough drivers DOMU – Orange Wallpaper PV Drivers Switching icon © Samsung Electronics 6
  • 7.
    Near-Native Performance Challenges 60 frames per second = 16.6ms per frame o GPU renders each surface  GPU composes the surfaces  frame  Virtualized graphics options o API Remoting done above GPU driver for chipset portability  Android JB has “butter smooth” technology o Triple buffering o Needs reliable Vsync interrupt  Xen event channel stressed o Deferred waiting using sync points & fences Composition frame buffers 0 1 2 App frame buffers 0 1 2 0 © Samsung Electronics 15 30 45 60 time (ms) 7
  • 8.
    Results Dual-Android, GPU composition 70 160 60 140 FPS 100 40 80 30 60 20 Packets/sec(k) 120 50 40 10 20 0 0 DOM0 © Samsung Electronics DOMU Packets/sec (k) 8
  • 9.
    Event Channel UnderStress  DOMU Vsync arrival time delta Delta Time (ms) 35 Some missed events 30 25 20 16.67 15 10 5 0 10 11 12 13 14 15 16 Benchmark Time (sec) © Samsung Electronics 17 18 19 20 9
  • 10.
    Xen For Mobile Multi-page ring o Needed for throughput performance running benchmarks o Ensure low-latency  Non-linear grant references o Old grants are re-used. PV drivers assume linearity  RAM Allocation limit 512MB o Buddy allocator is unable to allocate contiguous chunk of memory from the Domheap memory  Per-VM interrupts unreliable when stressed o Must ensure Vsync is received in DOMU with minimal latency  Contribution to community o Samsung will work to share Xen changes with community o Some code is proprietary © Samsung Electronics 10
  • 11.
    Conclusion  Two Androidcan run with near-native graphics performance  Xen runs well on mobile devices  Using PV drivers, no major changes to Xen architecture required Android is a trademark of Google Inc. The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License. Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries. ARM is a registered trademark of ARM Limited. Mali is a trademark of ARM Limited. STAR WARS and related properties are trademarks in the United States and/or in other countries of Lucasfilm Ltd. and/or its affiliates. © 2012 Lucasfilm Ltd. All rights reserved. Angry Birds is a trademark of Rovio Entertainment Ltd. © Samsung Electronics 11