Kernel Samepage Merging

In the past, I sometimes noticed that after updating and rebooting my cloud server that runs around 12 virtual machines, memory use would decrease a few hours after reboot. The reason for this is that the kernel looks for duplicate pages and combines them. And when running 12 virtual machines, most with the same operating system and applications, a lot of optimization is possible. But that’s about all I knew about it so far. Recently, however, I stumbled across the kernel feature that perform this optimization and reports interesting details to userspace upon request: The Kernel Samepage Merging.

Continue reading Kernel Samepage Merging

Book Review: Linux Kernel Programming – Kaiwan N Billimoria

From today’s perspective, one of the most important courses during my computer science education in college was the one that taught me about how operating systems work. And while many things that I learned at college are no longer relevant, the material of that course is still as relevant today as it was then. Sure, everything has become much more sophisticated, and operating systems now manage resources that are orders of magnitudes beyond what was available at that time. However, the fundamentals of how an operating system works when it comes to multitasking, memory management, file system handling, etc. are still the same. I find this knowledge absolutely essential in my everyday work and every couple of years, I have to compile a Linux kernel on my own, just for the fun of it. These days, it was time again, and after having expanded my knowledge a lot around Docker, Kubernetes, ‘the cloud’, CI/CD and other related things over the past year, I now went into the opposite direction for a while and had a look at the software that makes all of this work: The Linux kernel. To my surprise, quite a number of books on Linux kernel and driver development have recently been published, and I chose ‘Linux Kernel Programming’ by Kaiwan N Billimoria as my guide.

Continue reading Book Review: Linux Kernel Programming – Kaiwan N Billimoria

Patching the FN-Key on an External Lenovo Keyboard

Many years ago I bought an external USB Lenovo Thinkpad keyboard because it’s small, which is great for traveling in combination an external screen. Also, the keyboard is very quiet and works and feels exactly like the keyboard in my Lenovo notebook. The only problem plaguing me with it for many years now is that the FN and CTRL keys can’t be swapped. As a result, I came to only use it when I had no other choice, i.e. to turn down the keyboard typing noise level at home. Quite a shame, but the FN key being at the far right just ruins any 10 finger typing efficiency for me.

But with a bit of a thrill, you can patch the firmware to swap the FN+CTRL key.

Continue reading Patching the FN-Key on an External Lenovo Keyboard

Ubuntu 20.04 on a Lenovo Thinkpad E14

Over the past couple of weeks, I’ve installed Ubuntu 20.04 on quite a number on new notebooks. This week’s challenge was to find a notebook that meets the following requirements: A 14″ display, a sturdy casing because it’s mostly used mobile, and ultra reliable operation, including Suspend to RAM. Suspend to Idle would not do, as one of the use cases is keep the notebook in the backpack overnight. Especially Suspend to RAM requires good BIOS and ACPI support, so I kept my eyes firmly in the Lenovo notebook camp, as they have a reputation for good Linux support. Also, the price should be below 1000 euros. In the end, I chose a Lenovo E14 for 689 euros with a 10th generation Intel i5-10210U, 16 GB of RAM and a small 256 GB SSD that will be replaced anyway. I’d say that’s a very good price for an E14 model.

Continue reading Ubuntu 20.04 on a Lenovo Thinkpad E14

Effects of Hyper-threading and Dual Channel RAM

This post is a follow up to a recent post in which I compared the ffmpeg video transcoding performance of a number of notebook-, workstation- and cloud server CPUs. Having done that, I’ve wondered a few days later what effect hyper-threading and dual channel RAM have on such a workload. The results are pretty interesting.

Continue reading Effects of Hyper-threading and Dual Channel RAM

Wi-Fi Exploration Tools

You might have noticed that I had quite a number of Wi-Fi related posts lately. In the process, I have discovered a number of new Linux command line tools to find out more about the capabilities of the Wi-Fi network adapter in a device, the capabilities of the Access Point my device is connected to, and about the capabilities of all other Access Points in the area. So here’s a cheat sheet with a summary of those commands:

Continue reading Wi-Fi Exploration Tools

A New Kernel for Suspend to RAM – Will It Help?

In the previous post I’ve had a look the differences between Suspend to Idle and Suspend to RAM when the lid is closed. While Ubuntu 20.04 runs great on the 650 euro consumer grade notebook I bought a few weeks ago with the latest 11th generation Intel i5 processor, the Linux kernel would not support the much more power efficient Suspend to RAM and opted to go for Suspend to Idle instead. That suits me just fine for the purpose, but just for the fun of it, I was wondering if there is a way to get Suspend to RAM to work after all.

Continue reading A New Kernel for Suspend to RAM – Will It Help?

Linux – Suspend to Idle or to RAM?

In a recent post, I was quite happy to report that by and large, I had no big issue running Ubuntu 20.04 with a Linux 5.11 kernel on the latest notebook hardware in 2021 with an 11th generation Intel i5 processor. Everything except the cheap Wi-Fi card ran out of the box and there’s a fix for that Wi-Fi as well. In addition, suspend/resume worked out of the box as well, which was one of my biggest worries. A week or so later, I noticed, however, that when I unplug the computer while suspended, the battery would drain very quickly and is empty after half a day. Hm, could the power efficiency of the suspend mode be so bad on that platform?

Continue reading Linux – Suspend to Idle or to RAM?