Linux 4.1 kernel: Finally, a movement in the upwards direction

Playing around with the new Linux 4.1 kernel and some benchmarks on a MacBook Pro for comparison.

No musings yesterday because I was having quite a time getting Linux to play well. I spent yesterday configuring the rest of the kernel until around 21:00, when I started searching for and applying all the patches I wanted. Found a small bug in the CPU optimisation patch that Gentoo uses (via grsecurity); namely, it doesn’t enable P6_NOP for anything higher than a Core 2. I manually edited the patch and applied it.

I built the kernel, ran # emerge @module-rebuild, signed the newly built modules, and rebooted in to my new system… Or I would have, if it had been able to read the init RAM disk. Doing the Apple EFI dance to switch between 3.18 to rebuild and 4.1 to test was not my idea of a good time, but after a while, I found the issue. There’s something broken somewhere and it would not read XZ-compressed ones. I used my fallback algorithm, LZO (chosen because it’s free and very fast), and it booted right up. Only now, I couldn’t start KDE.

Typically, I start KDE by using $ X_SESSION=KDE-4 startx; I don’t use KDM or XDM because I regularly test breaking changes to i915 that may cause X to hardlock, rendering my laptop useless. This time, however, it complained ‘xterm: command not found’. Unsure why it was trying to load xterm, I checked around and I found no answer. I still haven’t figured this out. The workaround I’m using is $ XINITRC=/etc/X11/Sessions/KDE-4 xinit which acts the same as the old command, only it’s longer and less readable.

Then I had a world of i915 bugs that I will omit from my blog mainly because they were mostly configuration error and the ones that weren’t were resolved by re-merging media-libs/mesa.

After all of that was over, I checked on my wireless chip. Lo and behold, for the first time since I’ve started using draft-n wireless networking on Linux in 2009, it was actually associating successfully to a 5GHz 802.11n AP! The speed is only 150mbit/s; the chip supports 300mbit, so I am not sure why that is, but I am still happy to be finally untethered from my Ethernet cord!

Some benchmarks.

Running emerge -1 openssl

Kernel / Sched Wall Time System Time
3.18 / CFQ 5m 3s 59s
4.1 / CFQ 4m 57s 55s
4.1 / BFQ 4m 53s 52s

That’s a pretty nice win for BFQ, and a huge improvement over 3.18. Note this is all on the same hardware, on a fresh boot, with nothing in fscache.

Playing 720p MPEG-4 video in VLC

Kernel On-Die Temperature CPU % used
3.18 71° C 31.2%
4.1 63° C 46.3%

Each measurement was taken at 2 minutes into playing the video. Not sure why the CPU’s a bit more active, but wow, that temperature reduction is serious!

Overall, I am very, very happy with this upgrade. The Linux 4 series seems to be all about making things smoother, faster, and more battery-friendly. I’ll update later with a benchmark of battery life.

If you have a MacBook Pro from the 2011 era (or you’re just curious), you can view my config file online. Special thanks to Elly and Horst for guidance, patchsets, and keeping me company while I was going insane with menuconfig. 🙂

Musings: Just another lazy Sunday.

Okay, I guess I’m doing this daily. Sundays are usually pretty lazy for me, so this will be short.

Found more interesting tidbits, still configuring the 4.1 kernel for my laptop. RC8 came out before I even finished, so now I have some oldconfiging to do.

Still felt dizzy from yesterday, so spent 20 minutes on the treadmill. Blew all the cobwebs out of my blood, I suppose. Almost completely better afterwards, so that’s a good thing.

Found a really intricate resource pack for Minecraft, S&K Photo Realism. I’ll have to try it out the next time I’m on the desktop with the Radeon 5700HD. My laptop can’t handle resource packs; the poor little Sandy Bridge HD Graphics is too overwhelmed.

Helped Horst debug an i915_drm driver issue on 4.0.5. Not sure the root cause, will have to probe further tomorrow.

Started planning how to install Foxtoo, my own little brand of Gentoo, on to my Pentium-100 laptop. I think I have a way and it’s going to make for quite an article if I manage to make it happen.

Actually excited for work tomorrow. Lots of cool things in the works there.

 

Musings: libxo, Python code quality, and Linux kernel shenanigans

I’ve been inspired to actually make this in to an actual bloggy journal thing instead of just writing occasional long-winded well thought out articles. I still want to do long-winded well thought out articles, but the entire reason I got this thing in the first place is to share my knowledge and experiences with the world. Might as well.

Caught up on the backlog of happenings on the freebsd-current mailing list. Lots of people are upset about libxo, including myself. May mean a Linux migration in my professional future. Disappointing, especially since there is a lot of opposition, but it’s understandable that it’s going forward anyway. Juniper pays to keep the lights on at the FreeBSD foundation, so they have a lot of pull. Sad to see they don’t really care about the community or what we have to say.

Looked harder at GCC 5.1 code output. Then looked harder at switching default compiler from GCC to Clang on Gentoo. 😉 It’s not all there yet but it seems to be improving every day. Looking forward to trying out a Clang-compiled kernel if that patchset advances.

Played with Pylint and Pyflakes. Ran it on a few of the projects I work on and a few of the ones I write with Elly. PyIRC 3 got a rating of 8.5 out of 10. Really impressive. I hope to show Pylint to the people at work in the coming week and improve the quality and process there too.

Tried playing Minecraft. Already felt a bit dizzy before playing, so that was a mistake. Logged off after about 20 minutes from the ill feeling. Perhaps tomorrow.

Found out about a lovely years-old DoS vulnerability in the Linux kernel’s UDP stack. Ran netstat on my servers to make sure they had no UDP listeners. Not sure what to do about the Minecraft server, perhaps the DDoS protection we already have on it is good enough.

Read a hilarious article comparing the Pentium 4 Northwood to various new CPUs, where the AMD “accelerated” notebook CPUs performed worse. I can’t believe AMD has gone so downhill that a Pentium 4 from 2002 can spank its brand new designs.

Decided to start configuring a 4.1-rc7 kernel for my laptop. 3.18 is so old (by my own standards) and I really want to get off of this line since my checkout is still affected by that stupid exit race bug which sometimes causes Firefox to die. Found an interesting knob, CONFIG_EXT4_ENCRPYTION, which is apparently the same encryption stuff Android “M” will be using. Pretty neat but seems useless for my needs. Might try it on the Pentium II for the hilarity.

Tried to tinker with the internals of OS X Server 5.0 beta 1 before bed, but it’s compressed with a weird algorithm (ADC?) that none of my Linux utilities can break open. I’ll need to investigate that more tomorrow.

 

FreeBSD on Apple MacBook Pro 8,2: Epilogue.

Why I left FreeBSD.

It is with a fairly heavy heart that I write I am no longer running FreeBSD on my MacBook Pro.

What happened to improving?

Part of the problem is that I finally received gainful employment in March, and that work is almost impossible to do on FreeBSD. A lot of it involves Chrome (which I still have been unable to run on FreeBSD), Qt5-based applications (which crash due to known bugs in libv8 that Google do not care to resolve), and some Python libraries that have truly terrible performance on FreeBSD.

Why not run Linux in a VM for work?

Sure, I could have, if VirtualBox ever worked…

Weren’t you excited to fix up FreeBSD?

I was. I still am, but something just feels different. For over a decade, FreeBSD has for me been the go-to operating system for any use case: servers, embedded projects, desktop systems, and more. But the current heading of development seems to strongly suggest this is no longer encouraged or desired.

When I first started out with Gentoo nine years ago, they were pretty much bent on making it for newer hardware only. Back then, Pentium computers were like the Pentium 4s of now – something you give your grandma or little sister for web browsing, but nothing too serious. And Gentoo developers did not really care if they broke compatibility with these older systems. I can understand that, given that compiling the entire system by hand is something that is pretty taxing for older hardware.

The nice thing about FreeBSD was their community never looked down on you for using these older machines, and realised they still have use. My first interactions with #FreeBSDHelp on EFnet were in 2006 and related to getting SLIP support working in sysinstall so I could remotely install FreeBSD 6 on my Pentium 90 laptop. They were happy to help.

The roles have largely reversed now. Running into issues with older hardware get me looks of disdain and “great, upgrade your hardware and try again” from the FreeBSD community. Meanwhile, the Gentoo team was happy to help me with an issue regarding my retro Intel486 box, in 2015. This computer has no business still functioning, and they were still willing to help me configure a kernel that would boot on it with its anaemic 20 MB RAM.

The other thing I have noticed is that even now, months later, none of my Ports bugs have been handled. In the same amount of time, I have filed three bugs against Portage packages… and all of them were closed within one week of being opened. I feel like my contributions matter to the Gentoo Linux team.

What have you learned?

FreeBSD is more fun to hack on than Gentoo. FreeBSD is harder to get things done on than Gentoo.

FreeBSD is lighter on resources than Gentoo. FreeBSD is heavier on bug backlog than Gentoo.