What Could Microkernels What Could Microkernels Learn from - - PowerPoint PPT Presentation

what could microkernels what could microkernels learn
SMART_READER_LITE
LIVE PREVIEW

What Could Microkernels What Could Microkernels Learn from - - PowerPoint PPT Presentation

What Could Microkernels What Could Microkernels Learn from Monolithic Learn from Monolithic Kernels (and Vice Versa) Kernels (and Vice Versa) http://d3s.mff.cuni.cz http://d3s.mff.cuni.cz Martjn Dck decky@d3s.mff.cuni.cz CHARLES


slide-1
SLIDE 1

http://d3s.mff.cuni.cz

http://d3s.mff.cuni.cz

Martjn Děcký

decky@d3s.mff.cuni.cz

CHARLES UNIVERSITY IN PRAGUE faculty of mathematjcs and physics faculty of mathematjcs and physics

What Could Microkernels Learn from Monolithic Kernels (and Vice Versa) What Could Microkernels Learn from Monolithic Kernels (and Vice Versa)

slide-2
SLIDE 2

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 2

What a Long Title ... What a Long Title ... Just barely missed the prize for the longest talk tjtle of the devroom ...

slide-3
SLIDE 3

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 3

What a Long Title ... What a Long Title ... Just barely missed the prize for the longest talk tjtle of the devroom ... Stjll, the tjtle is not saying enough.

slide-4
SLIDE 4

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 4

What a Long Title ... What a Long Title ... Just barely missed the prize for the longest talk tjtle of the devroom ... Stjll, the tjtle is not saying enough. This is an opinion piece. Feel free to disagree and let's discuss that.

slide-5
SLIDE 5

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 5

Introductjon Introductjon

Martjn Děcký

Computer science researcher

Operatjng systems Charles University in Prague

Co-author of HelenOS (since 2004)

Portable general-purpose microkernel multjserver

  • peratjng system designed and implemented from scratch

User of GNU/Linux (since 1998)

Also occasional contributor

slide-6
SLIDE 6
slide-7
SLIDE 7

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 7

HelenOS 0.6.0 HelenOS 0.6.0

Released on December 21st 2014

Culminatjon of more than 2 years of development (including GSoC '12, GSoC '14, ESA SOCIS '13)

GUI Support for BeagleBoard, BeagleBone, Raspberry Pi, MIPS Malta, LEON3 ext4 as default root fjle system, UDF support IPv6 support, auto-confjguratjon Audio support (including Intel HD Audio) Miscellaneous (guard pages, device drivers, telnet, VNC)

slide-8
SLIDE 8

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 8

About the Premise ... About the Premise ... Could the microkernel systems really learn something from the monolithic systems?

slide-9
SLIDE 9

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 9

Microkernels vs. Monolithic Kernels Microkernels vs. Monolithic Kernels GDI NOD

slide-10
SLIDE 10

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 10

Microkernels vs. Monolithic Kernels Microkernels vs. Monolithic Kernels Microkernels Monolithic Kernels

slide-11
SLIDE 11

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 11

Microkernels vs. Monolithic Kernels Microkernels vs. Monolithic Kernels Microkernels Monolithic Kernels

The Iron Curtain

slide-12
SLIDE 12

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 12

Microkernels & Monolithic Kernels Microkernels & Monolithic Kernels Microkernels Monolithic Kernels

Terminological demarcatjon

slide-13
SLIDE 13

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 13

Microkernels & Monolithic Kernels Microkernels & Monolithic Kernels Microkernels Monolithic Kernels

Terminological demarcatjon

slide-14
SLIDE 14

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 14

Microkernels & Monolithic Kernels Microkernels & Monolithic Kernels

componentjzatjon isolatjon dynamicity

slide-15
SLIDE 15

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 15

Meet the New Kid on the Block Meet the New Kid on the Block

OSv

Operatjng system for virtual machines Only drivers for virtual and paravirtual devices

Real devices can be supported via rump kernels

Slim API necessary to run POSIX applicatjons and a JVM

In kernel mode Single user, single process, single image, single address space

slide-16
SLIDE 16
slide-17
SLIDE 17

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 17

Microkernels → Monolithic Kernels Microkernels → Monolithic Kernels

More power for user space

Gradually moving some drivers to user space (where it makes sense)

FUSE, libusb, networking stack, etc. Performance might not be actually very problematjc

The only trouble is memory copying, but we can avoid it Caching can be stjll done in a “monolithic” way

We can see the opposing trend in many cases

KMS/DRM Due to removing duplicitjes, not due to the technical limitatjons

slide-18
SLIDE 18

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 18

Microkernels → Monolithic Kernels (2) Microkernels → Monolithic Kernels (2)

Explicit architecture

Sofuware architecture (components) can be explicitly visible in the code

Compared to metadata (naming conventjons, etc.) that usually disappear afuer compilatjon Common objectjon: We don't want to restrict the code

Don't we really? Passing pointers anywhere is just not necessary Pointers are not important, the data are

slide-19
SLIDE 19

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 19

Microkernels → Monolithic Kernels (3) Microkernels → Monolithic Kernels (3)

Bootstrap is not run-tjme executjon

An operatjng system is not an “algorithm”

It has been running forever It will be running forever The “initjal state” is indistjnguishable from the “idle state” There is no “terminal state”

Designing the same code paths for both the bootstrap, terminatjon and run-tjme executjon harms all of them

slide-20
SLIDE 20
slide-21
SLIDE 21

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 21

Monolithic Kernels → Microkernels Monolithic Kernels → Microkernels

Smart algorithms and data structures

Surprisingly enough, groundbreaking ideas are usually implemented and evaluated in the monolithic kernels fjrst

Copy-on-Write Object allocator Read-Copy-Update Namespaces Global resources (single-system image)

slide-22
SLIDE 22

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 22

Monolithic Kernels → Microkernels Monolithic Kernels → Microkernels

Smart algorithms and data structures (cont.)

Advanced scheduling

Earliest Deadline First Multj-level scheduling

Dynamic tracing and instrumentatjon Support for Hardware Transactjonal Memory Security features

Address space layout randomizatjon Extended Fault Isolatjon (XFI)

slide-23
SLIDE 23

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 23

Monolithic Kernels → Microkernels (2) Monolithic Kernels → Microkernels (2)

Scalability

Monolithic systems are shown to scale to thousands of CPUs Surprisingly, many microkernel systems stjll target

  • nly uniprocessor machines

Surprisingly enough, monolithic systems have been successfully scaled down for embedded devices

Sure, a monolith is not necessarily a huge object

slide-24
SLIDE 24

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 24

Monolithic Kernels → Microkernels (3) Monolithic Kernels → Microkernels (3)

Portability

Most monolithic systems are (surprisingly) portable

Even with respect to the executjon environment

Many microkernel systems are (surprisingly) hard to port

Usually a proper hardware abstractjon layer is missing This leads us to ...

slide-25
SLIDE 25

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 25

Microkernel Non-Goals Microkernel Non-Goals

slide-26
SLIDE 26

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 26

Restartjng Restartjng

Dependability through restartjng servers

A demonstratjon of the powerfulness of the isolatjon Microkernel design by itself does almost nothing for managing the internal state of the servers

Servers are rarely stateless The logical state is rarely limited to a single server Restartjng of a server rarely solves the root cause of the failure

slide-27
SLIDE 27

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 27

Binary Size as a Measure of Quality Binary Size as a Measure of Quality

Micro means small, right?

Is a microkernel with a size of 50 KB a betuer kernel than a microkernel with a size of 150 KB? What about 49 KB? Measuring things such as cyclomatjc complexity might be more reasonable, but at best there is a correlatjon (not causatjon) between the value and the probability of bugs

slide-28
SLIDE 28

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 28

Brain-Dead Microkernel Brain-Dead Microkernel

Using trivial algorithms as a safeguard

Again, there is a correlatjon at best Trivial bugs in trivial code (with non-trivial consequences) Simplicity is desirable, but not without consideratjon We know many sophistjcated ways how to make sure a complex piece of code is correct (e.g. formal verifjcatjon)

slide-29
SLIDE 29

Martjn Děcký, FOSDEM 2015, February 1st 2015 What Could Microkernels Learn ... 29

Conclusion Conclusion

Remember the Amdahl Law

Optjmize for the common case The common case is context-dependent Acknowledge other people's common cases

Avoid black-or-white vision Acknowledge other people's ideas Know your goals and non-goals

Avoid misguided goals