-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
linux: enable kcmp() system call #113236
linux: enable kcmp() system call #113236
Conversation
I've verified that everything <=4.14 has no config changes. The config changes for the Linux >=4.19 default config look like this:
|
As written in this PR, |
I refrained from enabling checkpoint/restore by default on older kernels, because there it probably was hidden on purpose behind |
I said it wrong. I meant |
This should work exactly as before unless I set the parentheses wrong. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't test this but the diff LGTM :)
The current solution by @blitz looks quite elegant to me:
criu = if (versionAtLeast version "4.19") then {
# Unconditionally enabled, because it is required for CRIU and
# it provides the kcmp() system call that Mesa depends on.
CHECKPOINT_RESTORE = yes;
} else (optionalAttrs (features.criu or false) {
# For older kernels, CHECKPOINT_RESTORE is hidden behind EXPERT.
EXPERT = yes;
CHECKPOINT_RESTORE = yes;
} // optionalAttrs (features.criu_revert_expert or true) {
RFKILL_INPUT = option yes;
HID_PICOLCD_FB = option yes;
HID_PICOLCD_BACKLIGHT = option yes;
HID_PICOLCD_LCD = option yes;
HID_PICOLCD_LEDS = option yes;
HID_PICOLCD_CIR = option yes;
DEBUG_MEMORY_INIT = option yes;
});
So basically for Linux kernels >= 4.19 we unconditionally set CHECKPOINT_RESTORE
and for older kernels the behaviour should be unchanged.
(Edit: I think I got it now, I'll have another look.)
Since 2020, Mesa requires the kcmp() system call to be available for some of its functionality. At the moment, this system call is enabled when CHECKPOINT_RESTORE is enabled in the Linux kernel. This option is also enabled by default in Fedora and Debian. This patch enables CHECKPOINT_RESTORE by default on all kernel versions where it is not marked as EXPERT, i.e. everything after and including 4.19. Fixes NixOS#112082.
I was about to merge this and finally noticed what @vcunat meant (at least I guess that's it - nice catch btw!): --- a/pkgs/os-specific/linux/kernel/common-config.nix
+++ b/pkgs/os-specific/linux/kernel/common-config.nix
@@ -638,7 +638,7 @@ let
# Unconditionally enabled, because it is required for CRIU and
# it provides the kcmp() system call that Mesa depends on.
CHECKPOINT_RESTORE = yes;
- } else (optionalAttrs (features.criu or false) {
+ } else optionalAttrs (features.criu or false) ({
# For older kernels, CHECKPOINT_RESTORE is hidden behind EXPERT.
EXPERT = yes;
CHECKPOINT_RESTORE = yes; That way the
I can confirm this. I didn't investigate this further but I assume the I also switched this PR from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's give this a try :) Thanks a lot @blitz!
Motivation for this change
Since 2020, Mesa requires the kcmp() system call to be available for some of its functionality. At the moment, this system call is enabled when CHECKPOINT_RESTORE is enabled in the Linux kernel. This option is also enabled by default in Fedora and Debian.
This PR enables CHECKPOINT_RESTORE by default on all kernel versions where it is not marked as EXPERT, i.e. everything after and including 4.19.
Fixes #112082.
Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)