Skip to content
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

Status of Zen-kernel #74834

Closed
davidak opened this issue Dec 2, 2019 · 14 comments · Fixed by #94027
Closed

Status of Zen-kernel #74834

davidak opened this issue Dec 2, 2019 · 14 comments · Fixed by #94027

Comments

@davidak
Copy link
Member

davidak commented Dec 2, 2019

Issue description

In this reddit topic came the question up, why the Zen-kernel was removed from NixOS.

It was added in 2009 by @7c6f434c, but now it's not there anymore. I don't see when it was removed in the history.

491255b
03a9137

The project is actively developed (latest commit 3 days ago) and having a kernel optimised for desktop use seems a nice idea.

https://github.com/zen-kernel/zen-kernel

Project desription is currently found here: https://liquorix.net/

a distro kernel replacement built using the best configuration and kernel sources for desktop, multimedia, and gaming workloads.

Since packaging an additional kernel is actually quiet easy in NixOS, i might try it, but i will not be able to update it frequently. So an additional maintainer would be good.

@7c6f434c
Copy link
Member

7c6f434c commented Dec 2, 2019

It updates out of sync with the main kernel, and I guess 2012 could be when I either stopped needing TuxOnIce because in-kernel suspend-to-disk became good enough, or started using BtrFS and wanting to have the latest release as soon as it appears, or both.

Someone needs to update the version and prune the old ones, and noone cared at the time.

@LovingMelody
Copy link
Contributor

Oh, it’s my Reddit post. I would be happy to help update the kernel @davidak.

@davidak
Copy link
Member Author

davidak commented Jan 13, 2020

@Fuzen-py great. sadly i will not find time soon to look into it.

I have packaged a kernel that provides a new filesystem (bcachefs):

https://github.com/NixOS/nixpkgs/blob/5a1232908ce4bfa916a8c96ad31b56d1560af2c0/pkgs/os-specific/linux/kernel/linux-testing-bcachefs.nix

I would take that as an example and change what's needed.

@7c6f434c
Copy link
Member

I would hope that for packaging a new kernel, the main effort is building/testing, indeed — the bcachefs example confirms this (it just passes another source, additional config and some meta like resetting maintainers)

@Fuzen-py If you get around to try doing this, feel free to ping me for Nix-level review/merge once you have test the kernel and find it working fine.

@LovingMelody
Copy link
Contributor

I was running the zen kernel patches as my system for a while; I have moved away from nix due to compatibility issues and difficulty patching some applications such as cryptomator, Zotero and some proprietary software. That being said any testing, I would now be superficial. I am still open to helping and testing, but as this is no longer my primary distro, I don’t believe I can test this enough for initial support at this time.

@7c6f434c
Copy link
Member

Now I wonder where we should have the description for the FHS env escape-hatch functionality so that people like you (before giving up) can find it easily… (NixOS Wiki FAQ describes it in the «I've downloaded a binary» question).

@LovingMelody
Copy link
Contributor

LovingMelody commented Jan 16, 2020

I asked around for it, cryptomator is shipped as an appimage and because it needed fuse, it wasn't playing nicely. My next attempt was to build it from source, which proved to be a nightmare attempting to declare all of the maven sources. Anyways, a discussion for another issue, I did attempt patchelf though

@davidak
Copy link
Member Author

davidak commented Jan 16, 2020

I was running the zen kernel patches as my system for a while

@Fuzen-py what was your experience with it? did you get a significant performance improvement, for example in games? is it worth the effort?

@LovingMelody
Copy link
Contributor

I was running the zen kernel patches as my system for a while ...

@davidak I do notice some gains while playing games, ~10fps on some and on others nothing. I’m unsure if this is from fsync or fsync and the other patches though.

@Baughn
Copy link
Contributor

Baughn commented Jul 14, 2020

I've noticed a significant improvement in responsiveness overall. That's hard to see on a performance test, but Linux always felt laggy to me in a way that Windows doesn't... I was able to do a blind test to confirm that the Zen kernel at least improves on that, IMO significantly.

(It's not double blind when the other party is a computer, right?)

For the time being, I'm using this to run it:

  boot.kernelPackages = let
    linux_zen_pkg = { fetchurl, buildLinux, ... } @ args:
    buildLinux (args // rec {
        version = "5.7.8-zen2";
        modDirVersion = version;
  
        src = builtins.fetchGit {
          url = https://github.com/zen-kernel/zen-kernel.git;
          ref = "refs/tags/v${version}";
        };

        kernelPatches = [];

        extraMeta.branch = "5.7";
      } // (args.argsOverride or {}));
    linux_zen = pkgs.callPackage linux_zen_pkg {};
  in 
    pkgs.recurseIntoAttrs (pkgs.linuxPackagesFor linux_zen);

@7c6f434c
Copy link
Member

@Baughn blind means you implemented booting a random configuration?

If you keep track of their latest releases anyway, maybe add a hash and list it in the NUR?

@Baughn
Copy link
Contributor

Baughn commented Jul 17, 2020

@7c6f434c Yes. Nix is supposed to be purely functional, but there's nothing stopping me from doing builtins.readFile /dev/random. (Except I'm not sure if that function is lazy. In actual fact I wrote a small script to select one at random before calling nixos-rebuild.)

Are strings lazy?

Anyway... there's no doubt in my mind that zen-kernel has a better default configuration. I'm not so sure that it's not just better defaults, though. I want to look at that before uploading anything; if we're lucky, I might be able to get the same effect by tweaking vanilla kernel parameters instead.

It'll take at least a week to get enough samples to be sure of that, more likely multiple, so don't hold your breath. Meanwhile, well, there is the above, and I'll update this thread with vanilla configuration(s) once I find a decent one.

@7c6f434c
Copy link
Member

7c6f434c commented Jul 18, 2020 via email

Atemu added a commit to Atemu/nixpkgs that referenced this issue Jul 27, 2020
@Atemu Atemu mentioned this issue Jul 27, 2020
10 tasks
@Atemu
Copy link
Member

Atemu commented Jul 27, 2020

At the very least, it carries the futex-wait-multiple patchset which is not found in any pre-built NixOS kernel to my knowledge.

I went ahead and packaged it for Nixpkgs in #94027, feel free to test.

wchresta pushed a commit to wchresta/nixpkgs that referenced this issue Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants