config: cache results of kernel checks #17106
Open
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.
Motivation and Context
Kernel checks are the heaviest part of the configure checks. This allows the results to be cached through the normal autoconf cache.
Since we don't want to reuse cached values for different kernels, but don't want to discard the entire cache on every kernel, we instead add a short checksum to kernel config cache keys, based on the version and path, so the cache can hold results for multiple different kernels.
Description
In
ZFS_AC_KERNEL
, once we've done the kernel detection, we create a simple checksum out ofkernelsrc
,kernelbuild
andkernsrcver
.In
ZFS_LINUX_TEST_SRC
, if the output cache key exists (regardless of value), we skip creating the test source at all, since we don't want to build it.Then the test module build runs as normal, if there's anything left that wasn't cached already.
In
ZFS_LINUX_TEST_RESULT
andZFS_LINUX_TEST_RESULT_SYMBOL
, if the cache key doesn't exist, we run the test and set the cache var from it. Then, based on the cached value, we run the "yes" or "no" commands.How Has This Been Tested?
By hand, trying combinations of
--config-cache
and different kernels, then building.Without
--config-cache
, works as normal.With
--config-cache
, works as normal, and all sorts of interesting kernel things in the cache. Just one:Running again with
--config-cache
, same result just faster.Building against a different kernel, again, slow on the first run, fast on the next. And then, two items in the cache:
And finally, the real win for me is on a potato riscv board I've been messing with this weekend:
Types of changes
Checklist:
Signed-off-by
.