kernel: Only build metal specific drivers for metal variants #2279
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue number: #2211
Description of changes:
Make the kernels we use in metal variants (kernel-5.10 and kernel-5.15) variant-sensitive to force rebuild with every variant switch even if no changes happened to the code. Merge the metal specific config fragment conditionally on if we are building a metal kernel or not.
This is not an ideal solution as it will rebuild the kernel when there is no rebuild necessary, for example when switching from
aws-k8s-1.21
toaws-k8s-1.22
which use the same kernel. In practice the overhead from rebuilding the kernel for each variant is smaller than I anticipated (See testing below).Testing done:
In order to examine the impact of rebuilding the kernel for each variant switch I build a bunch of variants once with the patch and once without using the following script:
Grepping for interesting lines we can see the build time per variant and if a kernel was build.
without patch:
with patch:
We see roughly a 30 to 40 second increase in the build times with the rebuild per variant. I would have expected more impact here, but probably there is things about buildsys and some caching effects I do not fully understand yet.
With regards to the configurations we see the changes we would expect. For the metal variant there is no difference between building with or without this patch:
For non-metal variants we can see the expected difference in the configs:
aws-k8s-1.22
for kernel-5.10: *aws-k8s-1.22
for kernel-5.10: *Note: that the above config diffs do not include the config settings merged in #2271 as the experiments were done before rebasing on top of latest
develop
Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.