Curious to know the coolest things you achieved by configuring your kernel. I know kernel config can be boring, but I’m hoping someone will have an impressive answer.
For me I have a very lightweight kernel that runs wayland on nvidia without any issues to date.
Bragging rights.
I stopped doing it when Linux got support for kernel modules around Linux 1.2. It was a real game-changer.
I’m running a custom kernel on my Arch laptop. It’s a little faster, a little smaller and a little quite more secure. I’m also running custom kernel which enables adiantum encryption on old phone with postmarketOS.
How did you conduct this speed test? Where are the results? 😂
Sorry, I think this any time someone says their computer is faster or mod X on Android is “snappier”
I used geekbench 5. My CPU is AMD Ryzen 5 5500U. I tested a few prebuild kernels and custom compiled the fastest one.
prebuild linux kernel:
- singlethread: 1170
- multithread score: 4604
prebuild linux-zen kernel:
- singlethread: 1156
- multithread score: 4593
prebuild linux-xanmod kernel:
- singlethread: 1164
- multithread score: 4594
prebuild linux-hardened kernel:
- singlethread: 1156
- multithread score: 4841
custom linux-hardened kernel:
- singlethread: 1160
- multithread score: 4977
Not for myself but a client who was running a game server. He wanted to tweak the number of ticks/second that the kernel interacted with CPU. Didn’t even know that this was a parameter and after a few attempts, according to him, never went on that server myself, made a huge difference and he claimed having grabbed a good part of the market because of that.
After that familiarized myself more with the stuff in there. But that was a good while ago, before most of you guys were born.
Filesystem level encryption enabled on RHEL. For some damn reason, they turn it off in their kernel.
A gentoo install once upon a time… and learning how to configure a kernel. Also a slightly better understanding of kernel module configuration for custom or odd ball hardware and a vague idea of what to look for in hardware support if I want to dig deeper.
camera drivers. the patch was submitted, but hadn’t been merged yet, and I didn’t want to wait.
I have multiple PCs. One is running a kernel that is mostly monolithic. That means it has only one module (a third party driver).
This made a lot if things more easy and faster, for example, it doesn’t need to load an initial RAM disk (initrd) at boot, because it already has all it needs built in and can just mount the root FS and start init. Also all crypto modules are already present when I need them.
The drawback is, I can’t unload a module and then load it with different parameters. If I had to change a module param, I would have to change it in the bootloader config and restart (or kexec)
Knowledge and time forced to not be on the computer
Wow, I never thought of that as a good thing until now. I bet Gentoo users are more well-rounded than Arch users
Well, lots of time to practice sword fighting in office chairs
Or to scroll through XKCD, apparently :P
I don’t know if this is considered as custom kernel, but I run Guix using non-libre Linux, with Intel Wi-Fi firmware blob. Since it does not have other firmware, it is pretty light, and I’m saving around 200-300MB.
Does that have any appreciable difference in day to day computing?
Compiling kernels makes no sense anymore.
Back in the days - Linux versions 2 and below - the kernel was much less modular, and resources wasn’t as plentiful. So it often made sense to build kernels with the stuff you needed statically compiled for speed, and the rest left out fo save memory and shorten boot time. Not to mention, Lilo (the thing we used before Grub) had limitations with respect to kernel size.
Nowadays, Grub can load a kernel of any size from anywhere on the disk. There’s plenty enough memory and CPU to leave the kernel core slightly bloated with stuff almost nobody needs with zero practical impact on boot time and memory usage, and most everything else is compiled as modules and loaded as needed - again with next to no boot time or running speed impact.
If you custom-build a kernel today, you’ll boot a tiny bit faster and it’ll run a tiny bit faster, and you’ll have a tiny bit more free memory - all of which you will never notice. What you will notice however is that kernel updates are a PITA on a regular basis.
Kernel updates are extremely easy when custom compiling, not sure what you are doing to make them a pain. Custom compiling is a great way to sort of passively absorb knowledge about kernel changes and new features or features you didn’t know about as they change and make oldconfig brings up questions about them.
Years ago (2006-ish), I ran Gentoo on a 300mhz ultra low power system I used for an irc & web server. I gained LOTS of speed and lowered power draw even further while also enabling the hardware acceleration the board had for ssl encryption and video encoding. The whole thing would pull <5 watts and be super stable. It was well worth it.
But now days a Pi zero would trounce it in both low power draw and speed with stock kernels and I don’t really care enough to try to squeeze more out.
Customising the kernel just means something works properly in rare hardware configurations like you described. It’s something which he who uses the general hardware (like an X86 desktop) can’t easily see or understand because the ‘stock’ kernel is already working properly.
I have configured custom Android kernel builds to enable more USB drivers, enable module support, and tweak various other things. For one tangible example of the result: I could plug in a USB Wi-Fi adapter and use it to simultaneously connect to another Wi-Fi network with the internal NIC while also sharing my own AP over USB. On an Android device of all things. I have also adjusted kernel builds for SBCs (like Pi clones) to get things working at all.
I have never seen any reason to configure a custom kernel for my own desktop/laptop systems. Default builds for the distros I’ve used have been fine for me; if I’m ever dissatisfied with anything it’s the version number rather than the defconfig. The RHEL/Rocky kernel omits a few features I want (like btrfs) but I’d rather stick to other distros on personal systems than tweak a distro that isn’t even meant for tweaking.
I run linux-xanmod-anbox for root support in Waydroid (Android on Linux).
And I configured my kernel to support VFIO (Virtual Function Input Output).
So I can fully pass through one of my GPUs to my Ameliorated Windows KVM,
which I use for both work and gaming.Root Waydroid lol, thats basically hell.
Waydroid without SELinux already removes all the Android sandboxing. Now its rooted!
Root on Android is a necessity for me.
I’ve been rooting all droids I use for the past 10 years or so.Imagine using Linux as a power user,
without being able to use sudo/su.Also, Magisk does not just allow any application to access root, you have to manually allow apps to make use of it.
Just like administrator rights on any other OS,
things only go wrong if you don’t know what you’re doing, and then grant rights to something malicious.Yes but Waydroid is not an Android phone. Have a look at this
https://github.com/waydroid/waydroid/issues/1136#issuecomment-2016948867
Hows the perf in the VM?
Amazing, basically native speeds,
currently playing Horizon Forbidden West with maxed out graphics and DRS disabled at a steady 60-80 FPS.Previously I also played Horizon Zero Dawn in it, also maxed out graphics, steady locked 100 FPS,
below is a benchmark comparison of HZD in the Linux host OS and the Windows KVM guest OS:
Has this gotten any easier to do? I set it up a few years ago, it was painful to do and maintain so I let it slide. You were writing all sorts of scripts to specify the passthrough devices and then they’d stop working so you had to track down what was failing and update. Then there was iommu so you had to be careful which groups you added devices to.
Gotta admit, it was very hard to setup initially.
However it’s been working perfectly ever since I did.
Been using it for about a year or 2 now.Also when I linked the Arch wiki,
I noticed in it’s article that there’s now a gpu-passthrough-manager,
which will likely make the process of setting up a little bit easier.
Amazing. Does Photoshop work ?
Yush, it does under the KVM :)
Is there an easy way to run this for photoshop? GUI if possible
No easy way to set it up I’m afraid.
But if you’re interested,
I posted all the bookmarks I made, with tutorials and tools, when I set mine up here:
https://discuss.tchncs.de/comment/9245159
I suppose the most tangible benefit I get out of it is embedding a custom initramfs into the kernel and using it as an EFI stub. And I usually disable module loading and compile in everything I need, which feels cleaner. Also I make sure to tune the settings for my CPU and GPU, enable various virtualization options, and force SELinux to always remain active, among other things.
A kernel that fits my hardware and supports things the original kernel doesn’t. Then again, i use gentoo.
What did the original kernel not support?
Having / on ZFS, but that went into an initrd i think… don’t remember, but not hardware related.