linux vs hardened vs zen for high-end desktop?
Been using arch for programming for quite a while and today stumbled onto the Kernel wiki page, which introduces hardened and zen kernels. Are they any beneficial over vanilla and which one should I pick for everyday run?
About this post
- Posted
- Archived
- Score
- 79 · 95% up
- Kind
- Text
- ID
- oeavfc
58 comments
I use zen for the additional patches (fsync) for gaming.
Also says does better multitasking under load. Which I can't say if it's true but seems fine.
Downside is certain arch distributed kernel modules are made for the default kernel so you may find you need to jump through some hoops.
I would stick with the default kernel TBH unless you need specific things from these other kernels.
Thanks! So I guess unless I run linux for very special uses or as daily driver (I play on Windows, so it's not my case), zen kernel won't be really helpful for me?
I would recommend sticking to just normal kernel. It's a fun project to switch to zen but besides that just stick to regular unless it's for a special use case
Zen kernel is basically pointless most of the time.
I game on Linux every day and Zen doesn't do enough for me to put up with the annoying bits when it comes to updates.
Fsync is almost a reason. But again, meh.
Really the big determining factor for multi-threading workloads is really IO. If you have NVME or some other kind of SSD, get that working right and you'll be fine.
There really isn't that much slack in the kernels work queue
Depends. In my case I see the occasional GUI stuttering esp. on heavy (disk) I/O in daily usage, which doesn't happen on Zen, so I prefer Zen. Zen trades throughput for lower latency (faster response in multitasking).
But if you're happy with the default kernel there's no reason to switch.
When using the AUR package "rtl8761b-fw" (for bluetooth) is there something special required when switching to linux-zen?
Just make sure to install
linux-zen-headersas well and that should be it.The zen kernel is in the official repositories and is as well supported as the vanilla kernel. I have been running zen for years and I have had no problems. The only real difference is the scheduler. The zen kernel prioritizes the processes that you interact with directly, giving you the illusion that your machine is running faster. In reality the vanilla kernel will have slightly higher overall throughput, but it may give you a visible lag at times of high core usage. I prefer zen, but there isn't really any big difference. Most of the time you would be hard pressed to discern any difference between the two kernels (you can actually tell by watching the CPU processes in a system monitor once you get used to telling them apart).
When I use the hardened kernel I also use apparmour and firejail so it would be difficult for me to distinguish which hoops that you have to jump through are thrown out by the kernel itself, but suffice it to say that security requires extra work.
I've been using the hardened kernel (for my every day run) for the last few years and everything works as expected, no issue at all. However, the vanilla kernel works just fine for most use cases. I just use the hardened kernel because I'm a bit of a security paranoid, that's all. You know, the kind of person who uses a hardened kernel, DNS encryption, VPN and or Tor, a firewall, 2FA, etc., for his home machine.
The only downside I can recall right now is that the hardened kernel does not support SMB 1.0 (old windows machines and Android SMB server, for example).
Btw, I also use Arch for programming.
In theory zen should be the best. But I personally just use normal kernel because well.... It's easy. In future installs I would probally try out Zen.
I would say try them both out.
Why install just one kernel?
Many people install a couple kernels so that if one breaks they can just boot the other one.
Be careful of necessary drivers if you go with the LTS kernel and have very new hardware.
Can I install multiple kernels using pacstrap during the installation of Arch?
I just do the main-kernel using pacstrap, then install the others using pacman in the chroot.
Potentially controversial opinion: just use the regular linux package. You likely won't notice any difference in performance and then you don't have unnecessary downstream patches on top of your kernel. No one ever seems to be able to produce data that shows that the zen kernel really does offer better performance for real workloads in these Reddit threads.
Pro-tip, if you're just gonna install one kernel, go with linux-lts. If you're going with two, Linux and linux-lts.
How is this a pro-tip? Why?
Don't recommend hardened kernel for desktop. It has user space namespaces disabled which are used for sandboxes.
hardened kernel comes with a performance and usability penalty
personally I use https://github.com/Frogging-Family/linux-tkg for a smoother desktop experience, zen kernel comes close to that
Is the perfoance penalty significant? Also what areas do they affect? I use the hardened kernel since day one of my arch journey (~ 4 years ago) and never really had performance issues. I have a beefy machine though, so that might play a role here too. I also play video games without much troubles.
Since you already run hardened, why not benchmark same games with performance oriented kernels like xanmod or tkg. Hardened kernel to me always seemed like it belonged oddly to the server space rather than the desktop. There are numerous kernel & system options to "harden" any regular kernel to secure defaults.
Same here. TBF I've never noticed a difference between mainline, LTS, and hardened. If there is a significant performance differences, it's not that big, or on a reasonably obscure or lightly used path.
I've been using the hardened on servers and desktops for about 3 years now, and I'm quite happy with it. Laptop is certainly performant enough for me and my work, but I don't game, so I can't advise on that aspect.
Deleted before we saved it.
I have 12 core CPU but still Zen gives me visible UI performance improvement over stock when under load. Definitely recommend. It's really no harder to install than stock kernel: just install it + headers with pacman and voila!
try xanmod https://aur.archlinux.org/packages/linux-xanmod/ you'll need to edit PKGBUILD for your system tho
Deleted before we saved it.
desktops don't run on batteries afaik
That has little to do with your kernel.
Hardened disables a number of features you use as a programmer such as the syscalls used by your debugger. So stick with vanilla on you dev box.
Con-Kalivas (Linux-ck), and Zen are great. If you don't mind compiling the kernel yourself you can tweak settings to improve responsiveness or compile it for your specific CPU architecture. If you dig you may find some pre-compiled kernels for your specific CPU, but if you have a high end desktop compiling yourself won't take long at all anyway.
I have a potato pc and it takes me roughly under an hour to compile a kernel with localmodconfig. I cannot imagine the pain Gentoo users go through when its time to update installed packages.
Yeah, I cringe whenever my laptop needs to compile any small aur package and I only use pre-compiled Zen kernels for it. I miss my old beefy desktop. And yeah, Gentoo is rough on low hardware. Personally I'd only try it with a Ryzen 9 or Threadripper, but I'm sure it's plenty usable on any recent 6+ core cpu.
And you're calling that a potato. First world problems, smh smh
Do you not use modprobed-db when using localmodconfig? Because that build time is crazy.
I tried zen but it didn’t play with my hardware well I guess. I stick to LTS and have noticed zero kernel related problems since, performance isn’t much different from default kernel imo.
Zen gives me trouble with my AMD APU, freezes and even a solid green screen of death. Haven't tried it in a month or so though so let's see what happens after a reboot. Since I started having those issues I went back to LTS without trouble, but I think that Zen was marginally faster and while it doesn't have PREEMPT_RT, it does have PREEMPT with is better for audio stuff.
if you use the linux-tkg kernel you basically have all three built into one
I run Linux for my everyday system and I don’t need the other specialised kernels but I do know ppl who use the zen Kernel to be able to run a box etc..
I am using the Zen kernel for a long time. In some situations, like copying a lot of data, the system feels smoother. But not faster. But I can't prove this with numbers. All in all, I have no problems with the Zen kernel. Because it is available in the official package sources, updates are also offered quickly.
Startup time reduced from default 3.8+s to zen's 3.072s while the power consumption stayed the same. I remember the default kernel had this startup time before a kernel update and just assumed it was for security. Anyway, only tried it for a few hours and haven't noticed any issues so far.
Edit: Hardened is slow and I get amdgpu errors.
If you don't have Nvidia graphics, go for lts. If you do, go for normal linux.
I recommend use linux-cacule or linux-cacule-rdb, I think you can get most performance from this kernel.
And compile with march=native
https://aur.archlinux.org/packages/linux-cacule/
Deleted before we saved it.