Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded...

26
Deflating the hype: Deflating the hype: Embedded Virtualization in 3 steps Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference Europe 2010, Cambridge

Transcript of Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded...

Page 1: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

Deflating the hype:Deflating the hype:Embedded Virtualization in 3 stepsEmbedded Virtualization in 3 steps

Klaas van Gend

MontaVista Software LLC

For Embedded Linux Conference Europe 2010, Cambridge

Page 2: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

10/28/10

• Why “multicore” made the topic more relevant

• Partitioning

• Virtualization

• Containers

• The Three Steps

• Summary

Agenda

Page 3: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

10/28/10

Asymmetric Multiprocessing

1985 200x

Page 4: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

10/28/10

Symmetric Multiprocessing

180cm

80cm

4 cm

1993

2009

Page 5: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

10/28/10

System Architecture & Partitioning

Core1

DecodeTLS

ConnectionTrackerManagement

EncodeTLS

Core4Core3Core2

Page 6: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

10/28/10

RT and Throughput considerations

• PREEMPT_RT makes Linux real time• Depending on HW and requirements

• RT Microkernels + Linux • hybrid approach, 2 different environments

• Merging the bad properties of both

• But Linux has its drawbacks• Complete IP stack

• not optimized for specific use cases

• Process Migration amongst CPUs

• BKL and scheduling overhead

Page 7: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

10/28/10

Partitioning & AMP

• Dedicated code is faster than general purpose code• “Let's bypass Linux”

• Assign cores to run without any blocking• “Let's bypass Linux”

• But... you bypassed Linux• You have to write new environment

Page 8: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

10/28/10

The 100% Linux alternative

• RT Patch – determinism, low latency

• UIO - direct hardware access from user space

• CPU affinity

• Scheduler improvements

• IRQ handling improvements

You now have a process running in Linux which:• has a core 100% to itself,

• can use most of Linux's regular APIs *,

• uses regular IPC* to talk to other processes

• Some “secret sauce” ingredients to the new Bare Metal EngineTM in MontaVista Carrier Grade Linux 6

*: don't use blocking APIs, duh!

Page 9: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

© 2010 MontaVista Software - Confidential 9

VirtualizationVirtualization

Page 10: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

10/28/10

Virtualization somewhat right:

dual OS on one CPU (if you must)

• Reduce BOM

• Two OS'es:• Linux for Applications

• RTOS for GSM base

• Single ARM9 CPU

Page 11: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

10/28/10

OS/License/Security Isolation

Hypervisor

I want that

You can't have it,But I will pass

messages

HardwareIRQs MMU

Page 12: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

10/28/10

Virtualization the right way:

Server Hardware Consolidation

In data centers:• Mail server(s)

• Web server(s)

• Intranet server

• File server(s)

• Firewall

All overdimensioned HWAll usually below 10% load

Combine into 1 boxusing virtualization

Page 13: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

10/28/10

Virtualization & Performance

Libraries

Linux Kernel

Hardware DriversHardware Drivers

Linux Kernel

Libraries

VirtualApps Tools

Scripts

Linux Kernel

Libraries

VirtualApps Tools

Scripts

Linux Kernel

Libraries

VirtualApps Tools

Scripts

Linux Kernel

Libraries

VirtualApps Tools

Scripts

Linux Kernel

Libraries

VirtualApps Tools

Scripts

Page 14: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

10/28/10

The Second Rule of Ready:The Second Rule of Ready:

“No extra layer of software can make your system faster.”

“No extra layer of software can make your system faster.”

Jim Ready, pioneer of VRTX and embedded Linux

Page 15: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

10/28/10

Virtualization & Para-virtualization

Libraries

Linux Kernel

Hardware DriversHardware Drivers

Linux Kernel

Libraries

Tools

Scripts

NativeApps

VirtualApps Tools

Scripts

Para virtualization: guest OS has knowledge of virtualization environment. Usually to prevent expensive operations

Page 16: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

10/28/10

Virtualization, Performance & Space

Libraries

Linux Kernel

Hardware DriversHardware Drivers

Linux Kernel

Libraries

VirtualApps Tools

Scripts

Linux Kernel

Libraries

VirtualApps Tools

Scripts

Linux Kernel

Libraries

VirtualApps Tools

Scripts

Linux Kernel

Libraries

VirtualApps Tools

Scripts

Page 17: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

10/28/10

Virtualization, Performance & Space

Linux Kernel

Libraries

VirtualApps Tools

Scripts

Linux Kernel

Libraries

VirtualApps Tools

Scripts

Linux Kernel

Libraries

VirtualApps Tools

Scripts

Linux Kernel

Libraries

VirtualApps Tools

Scripts

Linux Kernel

Libraries Libs

ToolsScriptsWhat a waste ofspace and performance!

Page 18: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

10/28/10

Containers

Linux Kernel

Libraries Libs

ToolsScripts

Libs

VirtualApps

Libs

VirtualApps

Libs

VirtualApps

Libs

VirtualApps

VirtualApps

ToolsScripts

• More than chroot

• Allow custom libraries (glibc)

• Same across all: • Udev, D-Bus, kernel

Page 19: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

10/28/10

Containers, part II

• Interesting features:• Use network bridging for multiple Ethernet interface

• Custom handling per container possible

• Integrates nicely with Cisco VRF

• Best feature: Resource usage limitations• Partition CPU, network, disk bandwidth

• Also interesting: integration with SELinux• Make a container really secure

Page 20: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

© 2010 MontaVista Software - Confidential 20

The Three StepsThe Three Steps

slide(i)   =  3 steps

i=1

17

Page 21: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

10/28/10

Q #1 Multiple OSes or Bare Metal?

• Or: do you really need something besides Linux?

• Answer YES if:• You need an RTOS, Bare Metal, Windows

• Answer NO if:• You need multiple Linuxes or one Linux “with tricks”

Page 22: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

10/28/10

Q#2a Reason for multiple OS'es?

Do you have Legacy code • And you don't want to port it?

• Do you require features that are not in Linux?• Windows?• RTOS?• Bare Metal?

You are now aware of the alternatives???

Page 23: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

10/28/10

Q#2b Reasons for multiple Linuxes?

No reason for virtualization if:• you think you need multiple versions of tools or

libraries• you need multiple network ports• You want to partition the resource usage

• Do you need kernel drivers that no longer work with current kernels?

• Hmmm... What are you getting yourself into?

Page 24: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

10/28/10

Q#3 Really need non-Linux?

• Legacy

• RTOS-type real time response• Classic argument for microkernel + Linux• PREEMPT_RT !

• GPL/Security shielding

• Much higher network performance than Linux kernel• Use Asymmetric MultiProcessing?

• FreeScale QorIQ• Cavium Octeon• Netlogic XL* family Bare Metal EngineTM

Page 25: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

10/28/10

The three steps in one diagram

Do you needmultiple OS'es and/or

bare metal?

START “I NEEDVIRTUALIZATION”

Really neednon-Linux?

Reason?

Reason?

KVMXen, VMWare

Containers

Bare Metal Engine TM

True Hypervisor(OKLabs / Virtuallogix

/TrustZone)

Really neednon-Linux?

Yes

No, just Linux.

Legacy,Windows

Real time responsiveness,Throughput

Yes, true RTOS required

“No OS at all”

Limit max resource use,

security implications

Yes, security/GPL

No

Page 26: Deflating the hype: Embedded Virtualization in 3 steps · Deflating the hype: Embedded Virtualization in 3 steps Klaas van Gend MontaVista Software LLC For Embedded Linux Conference

10/28/10

Summary

•“There's nothing new here”

•There are obviously good examples of virtualization

•Linux features are underestimated by most

• Containers – partitioning & resource limiting

• KVM – true virtualization

• Simulate “bare metal” high performance without going to another environment using UIO & friends