feat(zone-tiny): add minimal kernel flavor - #264
Conversation
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Builds from tinyconfig plus an explicit allowlist rather than the arch defconfig, so only listed symbols ship and defconfig churn cannot leak in. verify-config.py gates the required/forbidden/subset contract before compiling. Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
|
What's the tradeoff of keeping the ethernet NIC drivers in there? Those are the 2nd most likely case for PCI passthrough usage, and it feels a little awkward to keep those in a separate kernel config since they probably aren't that expensive to keep compared to all the other junk being removed. |
mostly a shortcut because I don't really know what NIC we actually want to support (if we have a list?) I was thinking, regular zone -> tiny-zone, regular zone + passthrough -> zone, gpu zone -> gpu flavour. |
We'd probably want to have these, excluding anything that is <1GbE:
In the future, we can enable any additional customer-requested NIC drivers too. But the above covers a wide variety of common deployments. May also want to provide CONFIG_TUN, CONFIG_WIREGUARD, and CONFIG_VMXNET3 (VMware PV NIC).
I'd prefer that we keep the number of kernel variants we ship to a minimum. IMO the current split of zone + zone-gpu is heavily justified by the sheer size of the NVIDIA driver and its userspace dependencies. But the in-tree NIC drivers are tiny enough that we should just include them in all our zone kernels. |
Do we expect passthrough is nic only? At this point I suppose we need nvme stuff too? |
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
|
@tycho added back most stuff for nic and passthrough as of commit 1c718be Still we get a measurable improvement in boot and size:
default_distrobox:linux-kernel-oci$ time ./hack/bench/compare-kernel-size.sh
FLAVOR KERNEL ADDONS CONFIG META TOTAL(MB)
---------------------------------------------------------------------
zone 13.778 6.797 0.029 0.000 20.604
zone-tiny 11.521 5.590 0.024 0.000 17.135
delta zone -> zone-tiny: 3.470 MB smaller (16%)
Benchmark 1: zone
Time (mean ± σ): 396.0 ms ± 7.2 ms [User: 337.5 ms, System: 40.3 ms]
Range (min … max): 382.4 ms … 415.2 ms 100 runs
Benchmark 2: zone-tiny
Time (mean ± σ): 296.9 ms ± 6.9 ms [User: 254.5 ms, System: 23.5 ms]
Range (min … max): 285.7 ms … 317.3 ms 100 runs
Summary
zone-tiny ran
1.33 ± 0.04 times faster than zone
|
There was a problem hiding this comment.
Validated against protect's KVM and Xen e2e suites
That's all I'm looking for. If the tests don't need it, it doesn't matter. If the tests don't have it, and it does matter, then the tests need to be updated to validate it, and until then it doesn't matter. QED.
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
zone-tiny is an x86_64 zone kernel built from tinyconfig plus an explicit allowlist, a strict subset of zone. verify-config.py gates a required/forbidden/stickiness contract before the compile, so upstream defconfig churn cannot
leak in.
Validated against protect's KVM and Xen e2e suites:
zone-tiny drops all 55 loadable modules and ~730 enabled symbols (2072 -> 1343), shrinking the OCI payload 45% (20.6 -> 11.2 MB), almost all of it addons collapsing 6.8 -> 0.05 MB.
It cuts boot time ~27% under Cloud Hypervisor: 288.8 ms vs 398.5 ms mean over 100 runs.
This tinyconf is for both xen and kvm, but it's not carrying any driver in case of pass through, we should come up with a specific flavour for that (or just use the regular
zonekernel).Closes RES-89