I am going to be sending proper "Next Release Proposal" email later this week (or next) and "Librarization/Modularization" will be a key part of it. Currently, OSv kernel provides quite a significant subset of the functionality of some standard Linux libraries listed here -
https://github.com/cloudius-systems/osv#kernel-size. In reality, many applications do not need all of this functionality, but they "get it" whether they need it or not. Even Java, which used to need lots of symbols from standard libraries, has become way more modular, and with the advent of GraalVM and other AOT-type technologies, OSv kernel does not need to provide all this functionality universally to every app. Worse, if you run an app on Firecracker which needs console, non-PCI virtio-blk and virtio-net drivers only, one gets all other drivers including ones for VirtualBox, Xen, VMware, etc. This actually makes OSv barely a unikernel or at best a "fat" one. This has some real negative consequences - higher memory utilization (kernel needs to be loaded in memory), larger kernel file (makes decompression longer), and poorer security because of the fairly vast number of exported symbols (at this moment everything non-static gets exported) and finally possibly less optimized code. On the other hand, because of this "universality", it is
quite easy, comparing to other unikernels, to run an arbitrary Linux app on OSv. And no matter what we do to make OSv more modular, we should preserve that "ease" and not make it harder, at least by default, to run an app on OSv.
So in general, what I am advocating for, is an ability (and a mechanism) to create more "stripped-down" versions of kernels
tailored to the need of specific app and/or specific hypervisor OSv will run on while preserving the default universal kernel. And also shrinking the universal kernel by
extracting optional functionality from it, where it makes sense and is relatively easy to do so, as a shared library to be loaded during the boot process. The latter should also ideally involve the build process (compile/link) optimizations I have already proposed in my other email I sent a week ago to the group -
https://groups.google.com/d/msg/osv-dev/hCYGRzytaJ4/D23S_ibNAgAJIn the end, what I am proposing could be organized in the following three categories:
I am also leaning more and more toward hiding C++ library - this should help us with 821 and there is at least one case - dotnet apps - that require an incompatible version of libstdc++.so. This would impact existing internal C++ apps like cpiod and httpserver as we would have to add libstdc++.so to the manifest for any of these apps. So there are some space and memory trade-offs here.