SlideShare a Scribd company logo
1 of 30
Download to read offline
CONFIDENTIAL designator
V0000000
1
An idea for the future of
Linux from the past
Unikernel
$ whoami
Natale Vinto
Developer Advocate Lead @ Red Hat
@natalevinto@mastodon.uno
Unikernel
-Linux
Day
Milano
2023
Linux Day Milano 2023
CONFIDENTIAL designator
V0000000
Agenda
2
▸ Unikernel
▸ Unikernel & Cloud: what?
▸ Linux and Unikernel
▸ UKL
▸ Tests and performance
▸ Q&A
CONFIDENTIAL designator
V0000000
3
The unikernel architecture builds on concepts developed by Exokernel and Nemesis in the late 1990s
CONFIDENTIAL designator
V0000000
Unikernel
▸ A unikernel is a computer program statically linked with the
operating system code on which it depends.
▸ Unikernels are built with a specialized compiler that identifies the
operating system services that a program uses and links it with one
or more library operating systems that provide them.
▸ Such a program requires no separate operating system and can
run instead as the guest of a hypervisor
4
CONFIDENTIAL designator
V0000000
Unikernel: pros
▸ Single address space: no need to
transition from user to kernel space and
vice versa
▸ Direct access to the hardware: TRAP
vs Context Switch
▸ Lightweight: smaller apps bundled
directly into a kernel
▸ Surface attack reduced
▸ Runs typically on VMs
5
CONFIDENTIAL designator
V0000000
Unikernel: cons
▸ Lack of standardisation: there are
many approaches to Unikernels but not
a real standard
▸ Hardware heterogeneity: drivers
▸ One app = One VM: any new app is a
VM, hardware density need to be
considered
▸ Complexity : libraries, frameworks,
documentation, community and
enterprise support
6
CONFIDENTIAL designator
V0000000
Unikernel and Clouds?
7
CONFIDENTIAL designator
V0000000
Unikernel for Cloud computing
Unikernels offer improved scalability compared to traditional VMs
and containers. As unikernels are lightweight and have a smaller
resource footprint, they can be more easily scaled up or down to
meet the demands of an application. This makes them particularly
well-suited for cloud environments, where the ability to quickly and
efficiently scale resources is critical.
8
CONFIDENTIAL designator
V0000000
9
CONFIDENTIAL designator
V0000000
Unikernel: a comparison
10
VIRTUAL
MACHINES
CONTAINERS
VM isolates the
hardware
Container isolates the
process
VM
OS
Kernel
Hypervisor
Hardware
App
VM
OS
Kernel
App
Container Host (Kernel)
Hypervisor
Hardware
Container
App
OS deps
Container
App
OS deps
App is bundled into
Kernel
VM
Kernel
Hypervisor
Hardware
App
VM
Kernel
App
Kernel
UNIKERNELS
CONFIDENTIAL designator
V0000000
Unikernel: a comparison
11
CONFIDENTIAL designator
V0000000
Unikernel VS Traditional and Micro VMs
▸ No need for OS
▸ Hypervisor type 1
12
CONFIDENTIAL designator
V0000000
Unikernel VS VMs and Micro VMs
13
CONFIDENTIAL designator
V0000000
Unikernel development
There are essentially two approaches to Unikernel development:
▸ Clean slate: Kernel is written from scratch, this gives full control on
programming language choice and methodology.
▸ Strip down: existing kernel codebase is stripped of functionality
deemed unnecessary for the unikernel.
They both present disadvantages such as drivers compatibility for
different hardware or out-of-tree forks hard to maintain and keep up to
date.
14
CONFIDENTIAL designator
V0000000
UKL: UniKernel Linux
▸ UKL is a patch to Linux and glibc which goal is to minimize changes
both to the Linux kernel and to applications.
▸ By reusing Linux, UKL gains the advantages of Linux for free,
especially wide driver support.
▸ App and kernel are linked with the Linux kernel into a final vmlinuz
and run in kernel space
▸ Project started by Boston University in collaboration with Red Hat
Research
15
CONFIDENTIAL designator
V0000000
16
Source:
Insert source data here
There is growing evidence that the structure of today’s general-purpose
operating systems is problematic for a number of key use cases such as
I/O, Networking
Some approaches:
▸ DPDK
▸ XDP/eBPF
▸ io_uring
▸ Interrupt Affinity, NUMA, etc
Optional subheading
Linux performance
CONFIDENTIAL designator
V0000000
UKL Performance vs Generic Linux
17 Source:
Insert source data here
Insert source data here
Insert source data here
Simplest UKL, default settings. Base path is
500 lines of code.
+5%
+26%
Optimization for applications like Redis that
always uses TCP to call the underlying
routines directly. Full model patch is 1250
lines of code.
Optional subheading
CONFIDENTIAL designator
V0000000
UKL Performance vs Generic Linux
▸ The 64-bit virtual address space
layout for non-UKL user process.
▸ In orange are the segments that
are relocated to the kernel half
for the UKL process.
18
CONFIDENTIAL designator
V0000000
UKL Performance vs Generic Linux
▸ A schematic of a write system call
destined for a network device.
▸ The three alternative internal
entry points that a UKL process
exercises are shown in orange.
19
CONFIDENTIAL designator
V0000000
20
On the transition between the execution models, UKL performs the
same entry and exit code of the Linux kernel with the difference that:
▸ Transitions to kernel code are done with a procedure call rather than
a syscall
▸ Transitions from the kernel to application code are done via a ret
rather than a sysret or iret; see "Base Model"
This transition code includes changing between application and kernel
stacks, RCU handling, checking if the scheduler needs to be invoked, and
checking for signals. In addition, it includes setting a per-thread
ukl_mode to identify the current mode of the thread so that subsequent
interrupts, faults, and exceptions will go through normal transition code
when resuming interrupted application code
UKL Performance vs Generic Linux
CONFIDENTIAL designator
V0000000
UKL Performance vs Generic Linux
▸ UKL_BYP is a UKL configuration
that allows the application, on a
per-thread basis, to tell UKL to
bypass entry and exit code for
some transitions between
application and kernel code
▸ A developer can invoke an
internal kernel routine directly,
where no automatic transition
paths exist
▸ UKL_RET replaces iret with ret
21
CONFIDENTIAL designator
V0000000
Optional section marker or title
22
▸ Developed a kernel call “shortcut”
that would directly invoke the
underlying TCP routines
tcp_sendmsg and tcp_recvmsg
▸ The change to Redis to invoke this
routine required only 10 lines of code
to be modified.
Single-threaded application
Test with Redis: +26% performance
CONFIDENTIAL designator
V0000000
Optional section marker or title
23
Optional subheading
Redis-UKL
UKL_BYP
Redis-UKL
CONFIDENTIAL designator
V0000000
24
▸ UKL_RET_BYP (shortcut) with virtio
network para-virtualization drivers
▸ UKL_RET_BYP (shortcut) gets up to
10% tail latency improvement over
Linux, even as the load on the
Memcached server increases
Multi-threaded application
Test with Memcached: +10% performance
CONFIDENTIAL designator
V0000000
DEMO!
CONFIDENTIAL designator
V0000000
What’s Next?
▸ Fedora COPR service
▸ Linux community acceptance: unikernel module
▸ Community and commercial use cases
▸ Try it out!
26
CONFIDENTIAL designator
V0000000
Links
▸ RHRQ August 2023, “Unikernel Linux moves forward”
▸ Unikernel Linux - EuroSys '23: Proceedings of the Eighteenth
European Conference on Computer Systems, May 2023, Pages
590–605
▸ UKL Github
27
CONFIDENTIAL designator
V0000000
facebook.com/RedHatDeveloper
youtube.com/RedHatDevelopers
twitter.com/rhdevelopers
linkedin.com/showcase/red-hat-developer
CONFIDENTIAL designator
V0000000
Join Red Hat Developer.
Build here. Go anywhere.
facebook.com/RedHatDeveloper
youtube.com/RedHatDevelopers
twitter.com/rhdevelopers
linkedin.com/showcase/red-hat-developer
CONFIDENTIAL designator
V0000000
linkedin.com/showcase/red-hat-developer
youtube.com/RedHatDevelopers
facebook.com/RedHatDeveloper
twitter.com/rhdevelopers
30
Red Hat is the world’s leading provider of enterprise
open source software solutions. Award-winning support,
training, and consulting services make Red Hat a trusted
adviser to the Fortune 500.
Thank you
Optional
section
marker
or
title

More Related Content

What's hot

Master's Thesis Matti Sihvola 2009
Master's Thesis Matti Sihvola 2009Master's Thesis Matti Sihvola 2009
Master's Thesis Matti Sihvola 2009
Matti Sihvola
 

What's hot (20)

Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
Xen Memory Management
Xen Memory ManagementXen Memory Management
Xen Memory Management
 
Linux programming - Getting self started
Linux programming - Getting self started Linux programming - Getting self started
Linux programming - Getting self started
 
Linux-Internals-and-Networking
Linux-Internals-and-NetworkingLinux-Internals-and-Networking
Linux-Internals-and-Networking
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modules
 
Linux Device Driver’s
Linux Device Driver’sLinux Device Driver’s
Linux Device Driver’s
 
Adding a BOLT pass
Adding a BOLT passAdding a BOLT pass
Adding a BOLT pass
 
Yocto Project introduction
Yocto Project introductionYocto Project introduction
Yocto Project introduction
 
Open source software licenses
Open source software licensesOpen source software licenses
Open source software licenses
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 
Vm escape: case study virtualbox bug hunting and exploitation - Muhammad Alif...
Vm escape: case study virtualbox bug hunting and exploitation - Muhammad Alif...Vm escape: case study virtualbox bug hunting and exploitation - Muhammad Alif...
Vm escape: case study virtualbox bug hunting and exploitation - Muhammad Alif...
 
Embedded Linux - Building toolchain
Embedded Linux - Building toolchainEmbedded Linux - Building toolchain
Embedded Linux - Building toolchain
 
Introduction to Parallel Computing
Introduction to Parallel ComputingIntroduction to Parallel Computing
Introduction to Parallel Computing
 
Bare-Metal Hypervisor as a Platform for Innovation
Bare-Metal Hypervisor as a Platform for InnovationBare-Metal Hypervisor as a Platform for Innovation
Bare-Metal Hypervisor as a Platform for Innovation
 
Android Things : Building Embedded Devices
Android Things : Building Embedded DevicesAndroid Things : Building Embedded Devices
Android Things : Building Embedded Devices
 
Microkernel Evolution
Microkernel EvolutionMicrokernel Evolution
Microkernel Evolution
 
HPE Data Protector Administrator's Guide
HPE Data Protector Administrator's GuideHPE Data Protector Administrator's Guide
HPE Data Protector Administrator's Guide
 
Linux device drivers
Linux device drivers Linux device drivers
Linux device drivers
 
Secure and Fast microVM for Serverless Computing using Firecracker
Secure and Fast microVM for Serverless Computing using FirecrackerSecure and Fast microVM for Serverless Computing using Firecracker
Secure and Fast microVM for Serverless Computing using Firecracker
 
Master's Thesis Matti Sihvola 2009
Master's Thesis Matti Sihvola 2009Master's Thesis Matti Sihvola 2009
Master's Thesis Matti Sihvola 2009
 

Similar to Unikernel Linux

GitOps for Event-Driven Architecture -- Kube-Style! With Duncan Doyle | Curre...
GitOps for Event-Driven Architecture -- Kube-Style! With Duncan Doyle | Curre...GitOps for Event-Driven Architecture -- Kube-Style! With Duncan Doyle | Curre...
GitOps for Event-Driven Architecture -- Kube-Style! With Duncan Doyle | Curre...
HostedbyConfluent
 
Cloudstack conference open_contrail v4
Cloudstack conference open_contrail v4Cloudstack conference open_contrail v4
Cloudstack conference open_contrail v4
ozkan01
 
Multicloud as the Next Generation of Cloud Infrastructure
Multicloud as the Next Generation of Cloud Infrastructure Multicloud as the Next Generation of Cloud Infrastructure
Multicloud as the Next Generation of Cloud Infrastructure
Brad Eckert
 

Similar to Unikernel Linux (20)

GitOps for Event-Driven Architecture -- Kube-Style! With Duncan Doyle | Curre...
GitOps for Event-Driven Architecture -- Kube-Style! With Duncan Doyle | Curre...GitOps for Event-Driven Architecture -- Kube-Style! With Duncan Doyle | Curre...
GitOps for Event-Driven Architecture -- Kube-Style! With Duncan Doyle | Curre...
 
A consolidated virtualization approach to deploying distributed cloud networks
A consolidated virtualization approach to deploying distributed cloud networksA consolidated virtualization approach to deploying distributed cloud networks
A consolidated virtualization approach to deploying distributed cloud networks
 
M.E.L.I.G. Unikernel and Serverless
M.E.L.I.G. Unikernel and ServerlessM.E.L.I.G. Unikernel and Serverless
M.E.L.I.G. Unikernel and Serverless
 
Cigna Innovation Summit
Cigna Innovation SummitCigna Innovation Summit
Cigna Innovation Summit
 
Linux, Unikernel, LinuxKit: towards redefining the cloud stack.
Linux, Unikernel, LinuxKit: towards redefining the cloud stack.Linux, Unikernel, LinuxKit: towards redefining the cloud stack.
Linux, Unikernel, LinuxKit: towards redefining the cloud stack.
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Edge Computing: A Unified Infrastructure for all the Different Pieces
Edge Computing: A Unified Infrastructure for all the Different PiecesEdge Computing: A Unified Infrastructure for all the Different Pieces
Edge Computing: A Unified Infrastructure for all the Different Pieces
 
VMworld 2015: VMware NSX Deep Dive
VMworld 2015: VMware NSX Deep DiveVMworld 2015: VMware NSX Deep Dive
VMworld 2015: VMware NSX Deep Dive
 
VMworld 2015: VMware NSX Deep Dive
VMworld 2015: VMware NSX Deep DiveVMworld 2015: VMware NSX Deep Dive
VMworld 2015: VMware NSX Deep Dive
 
Docker for Mac
Docker for MacDocker for Mac
Docker for Mac
 
Cloudstack conference open_contrail v4
Cloudstack conference open_contrail v4Cloudstack conference open_contrail v4
Cloudstack conference open_contrail v4
 
Acronym Soup – NFV, SDN, OVN and VNF
Acronym Soup – NFV, SDN, OVN and VNFAcronym Soup – NFV, SDN, OVN and VNF
Acronym Soup – NFV, SDN, OVN and VNF
 
Networking of multiple microcontrollers
Networking of multiple microcontrollersNetworking of multiple microcontrollers
Networking of multiple microcontrollers
 
Docker Online Meetup #31: Unikernels
Docker Online Meetup #31: UnikernelsDocker Online Meetup #31: Unikernels
Docker Online Meetup #31: Unikernels
 
Persistent Storage for stateful applications on Kubernetes made easy with Ope...
Persistent Storage for stateful applications on Kubernetes made easy with Ope...Persistent Storage for stateful applications on Kubernetes made easy with Ope...
Persistent Storage for stateful applications on Kubernetes made easy with Ope...
 
OSCON: Unikernels and Docker: From revolution to evolution
OSCON: Unikernels and Docker: From revolution to evolutionOSCON: Unikernels and Docker: From revolution to evolution
OSCON: Unikernels and Docker: From revolution to evolution
 
20200113 - IBM Cloud Côte d'Azur - DeepDive Kubernetes
20200113 - IBM Cloud Côte d'Azur - DeepDive Kubernetes20200113 - IBM Cloud Côte d'Azur - DeepDive Kubernetes
20200113 - IBM Cloud Côte d'Azur - DeepDive Kubernetes
 
Multicloud as the Next Generation of Cloud Infrastructure
Multicloud as the Next Generation of Cloud Infrastructure Multicloud as the Next Generation of Cloud Infrastructure
Multicloud as the Next Generation of Cloud Infrastructure
 
Running Kubernetes on OpenStack
Running Kubernetes on OpenStackRunning Kubernetes on OpenStack
Running Kubernetes on OpenStack
 
VMworld 2015: The Future of Network Virtualization with VMware NSX
VMworld 2015: The Future of Network Virtualization with VMware NSXVMworld 2015: The Future of Network Virtualization with VMware NSX
VMworld 2015: The Future of Network Virtualization with VMware NSX
 

Recently uploaded

Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Marc Lester
 

Recently uploaded (20)

Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
Abortion Clinic In Pretoria ](+27832195400*)[ 🏥 Safe Abortion Pills in Pretor...
 
From Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST APIFrom Theory to Practice: Utilizing SpiraPlan's REST API
From Theory to Practice: Utilizing SpiraPlan's REST API
 
Workshop - Architecting Innovative Graph Applications- GraphSummit Milan
Workshop -  Architecting Innovative Graph Applications- GraphSummit MilanWorkshop -  Architecting Innovative Graph Applications- GraphSummit Milan
Workshop - Architecting Innovative Graph Applications- GraphSummit Milan
 
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
Auto Affiliate  AI Earns First Commission in 3 Hours..pdfAuto Affiliate  AI Earns First Commission in 3 Hours..pdf
Auto Affiliate AI Earns First Commission in 3 Hours..pdf
 
Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?Prompt Engineering - an Art, a Science, or your next Job Title?
Prompt Engineering - an Art, a Science, or your next Job Title?
 
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale IbridaUNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
UNI DI NAPOLI FEDERICO II - Il ruolo dei grafi nell'AI Conversazionale Ibrida
 
Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024Modern binary build systems - PyCon 2024
Modern binary build systems - PyCon 2024
 
A Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdfA Deep Dive into Secure Product Development Frameworks.pdf
A Deep Dive into Secure Product Development Frameworks.pdf
 
Abortion Pill Prices Jane Furse ](+27832195400*)[ 🏥 Women's Abortion Clinic i...
Abortion Pill Prices Jane Furse ](+27832195400*)[ 🏥 Women's Abortion Clinic i...Abortion Pill Prices Jane Furse ](+27832195400*)[ 🏥 Women's Abortion Clinic i...
Abortion Pill Prices Jane Furse ](+27832195400*)[ 🏥 Women's Abortion Clinic i...
 
Weeding your micro service landscape.pdf
Weeding your micro service landscape.pdfWeeding your micro service landscape.pdf
Weeding your micro service landscape.pdf
 
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCAOpenChain Webinar: AboutCode and Beyond - End-to-End SCA
OpenChain Webinar: AboutCode and Beyond - End-to-End SCA
 
Evolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI EraEvolving Data Governance for the Real-time Streaming and AI Era
Evolving Data Governance for the Real-time Streaming and AI Era
 
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit MilanWorkshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
Workshop: Enabling GenAI Breakthroughs with Knowledge Graphs - GraphSummit Milan
 
Software Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements EngineeringSoftware Engineering - Introduction + Process Models + Requirements Engineering
Software Engineering - Introduction + Process Models + Requirements Engineering
 
Jax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined DeckJax, FL Admin Community Group 05.14.2024 Combined Deck
Jax, FL Admin Community Group 05.14.2024 Combined Deck
 
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
Abortion Clinic Pretoria ](+27832195400*)[ Abortion Clinic Near Me ● Abortion...
 
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4jGraphSummit Milan - Visione e roadmap del prodotto Neo4j
GraphSummit Milan - Visione e roadmap del prodotto Neo4j
 
Lessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdfLessons Learned from Building a Serverless Notifications System.pdf
Lessons Learned from Building a Serverless Notifications System.pdf
 
Test Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdfTest Automation Design Patterns_ A Comprehensive Guide.pdf
Test Automation Design Patterns_ A Comprehensive Guide.pdf
 
Novo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMsNovo Nordisk: When Knowledge Graphs meet LLMs
Novo Nordisk: When Knowledge Graphs meet LLMs
 

Unikernel Linux