asdf
Unikernels: The Next Stage of Linux’s Dominance (2019)
21–30 of 187 posts
Re: Unikernels: The Next Stage of Linux’s Dominance (2019)
#22I'm one of the authors on this paper, so ask away if you have questions.
What is a unikernel and why it's good?
This can lead to some rather spectacular performance benefits. One thing is that you remove the syscall overhead, but more importantly you can do a lot more optimizations at the compiler/linking steps.
You can remove complex code that tries to dynamically model the world with rather plain code that does just what it is supposed to. With IncludeOS (C++17 unikernel) we did make a firewall implementation that instead of using complex data structures relied on preprocessing the rule set and translate it into C++ code. The code to do this was quite simple and resulted in pretty amazing figures wrt number of rules per packet per second. Metaprogramming can sometimes deliver amazing results.
Similar things can be done in a traditional kernel as well and we've seen eBPF firewall implementations that are able to get similar numbers. On the flip side eBPF and it's firewall implementation is order of magnitude more complex. However, you can push eBPF code onto the networking card which can be a huge benefit. And ofc you could make a kernel module that implements a specific firewall ruleset and get similar performance without eBPF.
I like unikernels because I feel I can understand them better. You can reason about them and they are easier to optimize for very specific workloads.
So why aren't we using them? Likely because we know Linux so well and we've invested a lot in it. It runs everywhere and is extremely well supported. Bringing a new operating system to market is challenging, bringing a new operating system with a entirely different architecture is even harder. Even if it, on a purely technical level, could yield better results.
Re: Unikernels: The Next Stage of Linux’s Dominance (2019)
#23Unikernels are typically statically linked. Using copyleft code means the whole resulting binary is subject to copyleft. Free software is great, but not everyone is in the position where they can release all of their code all the time. For a unikernel to be viable it can't have copyleft code in it.
Unikernels are viable even if they don't allow you to do that, for many reasons - performance, workload isolation, ease of installation.
Re: Unikernels: The Next Stage of Linux’s Dominance (2019)
#24Earlier quoted context omitted.
(Not the author) No, the paper describes a small patch to Linux (~20 lines) + modifications to glibc that enable using Linux as a unikernel. Their goal is to have the modifications upstreamed so that Unikernel linux could be a GCC target etc.
I also don't get it. "Linux as a unikernel" does not make sense. The entire point of a unikernel is to not have the OS in every container/VM.
Re: Unikernels: The Next Stage of Linux’s Dominance (2019)
#25Unikernels are typically statically linked. Using copyleft code means the whole resulting binary is subject to copyleft. Free software is great, but not everyone is in the position where they can release all of their code all the time. For a unikernel to be viable it can't have copyleft code in it.
you lost your repository credentials? What prevent you from releasing code "all the time"?
Re: Unikernels: The Next Stage of Linux’s Dominance (2019)
#26The makers of top-performing NICs have been quite good at providing direct user-space access to their hardware, typically by exposing a ring buffer in shared memory, and maybe mapping device registers too, so that the process on the isolated core never does another system call until shutdown weeks later.
It is some hassle to get customers to add boot flags (isolcpus=, nohz_full, rcu_nocbs=, rcu_nocb_poll, hugepages=, etc.), and to put any mapped files in /dev/shm or /dev/hugepages so the kernel won't invent excuses to block the procees, and to direct irqs to other cores; but unikernel setup is probably not simpler.
So, I'm not sure what a unikernel would get me. Portability, or independence from proprietary drivers?
Re: Unikernels: The Next Stage of Linux’s Dominance (2019)
#27Re: Unikernels: The Next Stage of Linux’s Dominance (2019)
#28Earlier quoted context omitted.
(Not the author) No, the paper describes a small patch to Linux (~20 lines) + modifications to glibc that enable using Linux as a unikernel. Their goal is to have the modifications upstreamed so that Unikernel linux could be a GCC target etc.
I also don't get it. "Linux as a unikernel" does not make sense. The entire point of a unikernel is to not have the OS in every container/VM.
• Added a new kernel configuration option to allow theuser to select if he/she wants to compile the Linux kernel as UKL.
• Added a call to an undefined symbol (protected by an #ifdef) that can be used to invoke application code rather than creating the first userspace process.
• Created a small UKL library which has stubs for syscalls. These stubs hide the details of invoking the required kernel functionality now that the regular interface (i.e.,the syscall instruction) is no longer used.
• Changed glibc so that instead of making syscalls into the kernel, it makes function calls into UKL library.
• Changed the kernel linker script to define new segments such as thread local storage (TLS) segments which are present in application ELF binaries.
• Added a small amount of initialization code before invoking the application to replace initialization normally done by user level code, e.g., for network inter-face initialization.
• Modified the kernel linking stage to include the application code, glibc and UKL library to create a single binary.
Basically, I think the idea is you get all the linux syscalls (+ filesystems... + network stack... + hardware support... + everything) for 'free'. Sure you'll have a pretty large binary, but you won't have to write anything.
Re: Unikernels: The Next Stage of Linux’s Dominance (2019)
#29Unikernels are typically statically linked. Using copyleft code means the whole resulting binary is subject to copyleft. Free software is great, but not everyone is in the position where they can release all of their code all the time. For a unikernel to be viable it can't have copyleft code in it.
> but not everyone is in the position where they can release all of their code all the time. you lost your repository credentials? What prevent you from releasing code "all the time"?
Re: Unikernels: The Next Stage of Linux’s Dominance (2019)
#30Earlier quoted context omitted.
https://en.wikipedia.org/wiki/Unikernel Whether it's good depends on what you're doing. UKL will[1] allow you to link a regular server application to Linux and then run that single binary on baremetal or in a hypervisor, and give you a decent performance boost over running the application on top of a normal kernel. How much of a performance boost depends a great deal on the program, almost everything will be a few pe…
As I've always understood it, it's not just performance but also security: there's a lot less code running with your code which cuts the surface area for bugs and thus security holes.
Tell me if I am wrong, but is it always true though? Unikernel libraries definitely are largely not as proven as Linux kernel. Then how is unikernel secure than Linux system call?