lkl: Drop unnecessary config selects#598
Merged
tavip merged 2 commits intolkl:masterfrom May 11, 2025
Merged
Conversation
The defconfig files should be created with make savedefconfig rather than edited manually. This command will automatically remove unnecessary comments in .config, identify the necessary configs that need to be listed in the defconfig file, and sort the config options properly. If we don't use it, the contents of the defconfig files can get messy and hard to maintain. This commit is created via the following commands: make ARCH=lkl defconfig make ARCH=lkl savedefconfig mv defconfig arch/lkl/configs/defconfig make ARCH=lkl fuzzing_defconfig make ARCH=lkl savedefconfig mv defconfig arch/lkl/configs/fuzzing_defconfig Signed-off-by: Ruihan Li <lrh2000@pku.edu.cn>
ddiss
reviewed
May 11, 2025
LKL can work without network support. The current Kconfig forces all LKL builds to enable CONFIG_NET, which is not necessary. LKL tests may still expect such features to be enabled by default, so this commit removes the selects in Kconfig, but specifies them as enabled in defconfigs. End users using defconfigs should not be affected by this patch, but end users with their own configs or allnoconfig may benefit from this patch by having a minified kernel image. Signed-off-by: Ruihan Li <lrh2000@pku.edu.cn>
ddiss
approved these changes
May 11, 2025
tavip
approved these changes
May 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
As #541 points out, our
Kconfigcurrently forces the network and many other subsystems to be selected and built. Since it is forced, there is no way to disable it.linux/arch/lkl/Kconfig
Lines 13 to 32 in 7a3e989
This makes compilation time unnecessarily long and the resulting kernel object unnecessarily large. But I don't see a good reason why LKL needs to include all these subsystems.
I tried moving them into
defconfig. Everything seems to work fine. The CI should still pass because it usesdefconfig. I've played withallnoconfig(but manually setCONFIG_64BIT,CONFIG_OUTPUT_FORMAT, andLKL_CONFIG_64BIT) and it boots successfully and works normally without any problems.One thing to note is that our existing
defconfigs seem to have been edited manually, so it has some formatting issues and contains some outdated options. We shouldn't do this. In the first commit, I regenerated thesedefconfigs withmake savedefconfigto fix the problems. Please read the commit message for the exact commands I used to regenerate it.#541 also expects tools like
tools/lkl/lib/net.cto compile conditionally (instead of just giving complication errors whenCONFIG_NETis disabled), so #541 is not fully fixed by this PR. See #598 (comment) for the discussion.