📜 ⬆️ ⬇️

Is there any benefit from custom kernels?

Many have heard of various optimized and improved kernels, this is the Zen Kernel and pf-kernel I’ve known. In addition to adding new features (TuxOnIce, support for aufs), they can improve performance thanks to an improved task manager (BFS) and scheduler (BFQ). In this topic, I want to compare the performance of the pf-kernel with the standard kernels in Ubuntu and Arch Linux, as well as describe the process of building and installing pf-kernel for Ubuntu. I don’t see much point in testing Zen Kernel. firstly, the project looks abandoned, and secondly, the set of patches is both very similar there and there.

Tests


Arch linux

Let's start with the Arch Linux test on a netbook.
UnixBench test results on the standard kernel (3.0-ARCH):
TestScoreUnitTimeIters.BaselineIndex
Dhrystone 2 using register variables3432673.5lps10.0 s7116700.0294.1
Double-Precision Whetstone821.7MWIPS10.2 s755.0149.4
Execl throughput1048.3lps29.7 s243.0243.8
File Copy 1024 bufsize 2000 maxblocks120834.3KBps30.0 s23960.0305.1
File Copy 256 bufsize 500 maxblocks36417.8KBps30.0 s21655.0220.0
File Copy 4096 bufsize 8000 maxblocks290993.0KBps30.0 s25800.0501.7
Pipe throughput240124.9lps10.0 s712440.0193.0
Pipe-based Context Switching21672.7lps10.0 s74000.054.2
Process Creation2885.9lps30.0 s2126.0229.0
Shell Scripts (1 concurrent)738.5lpm60.0 s242.4174.2
Shell Scripts (8 concurrent)135.6lpm60.4 s26.0226.1
System call overhead600176.7lps10.0 s715000.0400.1
System Benchmarks Index Score:221.1

And here is the same test for pf-kernel (3.0-pf):
TestScoreUnitTimeIters.BaselineIndex
Dhrystone 2 using register variables3700926.6lps10.0 s7116700.0317.1
Double-Precision Whetstone846.1MWIPS10.2 s755.0153.8
Execl throughput1343.2lps29.6 s243.0312.4
File Copy 1024 bufsize 2000 maxblocks127468.0KBps30.0 s23960.0321.9
File Copy 256 bufsize 500 maxblocks37622.9KBps30.0 s21655.0227.3
File Copy 4096 bufsize 8000 maxblocks342606.2KBps30.0 s25800.0590.7
Pipe throughput296672.7lps10.0 s712440.0238.5
Pipe-based Context Switching41227.5lps10.0 s74000.0103.1
Process Creation3969.3lps30.0 s2126.0315.0
Shell Scripts (1 concurrent)861.1lpm60.1 s242.4203.1
Shell Scripts (8 concurrent)159.4lpm60.2 s26.0265.6
System call overhead642005.3lps10.0 s715000.0428.0
System Benchmarks Index Score:264.6


As you can see, the overall performance increase was 20%.
Ubuntu

Now the results of the same tests, but the same for Ubuntu.
On the standard kernel (2.6.38-11-generic):
TestScoreUnitTimeIters.BaselineIndex
Dhrystone 2 using register variables39162082.2lps10.0 s7116700.03355.8
Double-Precision Whetstone9143.1MWIPS9.9 s755.01662.4
Execl throughput11472.2lps29.8 s243.02668.0
File Copy 1024 bufsize 2000 maxblocks1041722.3KBps30.0 s23960.02630.6
File Copy 256 bufsize 500 maxblocks327345.4KBps30.0 s21655.01977.9
File Copy 4096 bufsize 8000 maxblocks1730411.9KBps30.0 s25800.02983.5
Pipe throughput4204868.3lps10.0 s712440.03380.1
Pipe-based Context Switching738528.0lps10.0 s74000.01846.3
Process Creation32309.9lps30.0 s2126.02564.3
Shell Scripts (1 concurrent)11023.5lpm60.0 s242.42599.9
Shell Scripts (8 concurrent)1425.4lpm60.0 s26.02375.7
System call overhead5723850.3lps10.0 s715000.03815.9
System Benchmarks Index Score:2580.4


On the pf kernel (2.6.38-pf8):
')
TestScoreUnitTimeIters.BaselineIndex
Dhrystone 2 using register variables71269301.5lps10.0 s7116700.06107.1
Double-Precision Whetstone9175.2MWIPS9.9 s755.01668.2
Execl throughput12014.6lps30.0 s243.02794.1
File Copy 1024 bufsize 2000 maxblocks1580881.5KBps30.0 s23960.03992.1
File Copy 256 bufsize 500 maxblocks428842.2KBps30.0 s21655.02591.2
File Copy 4096 bufsize 8000 maxblocks2315055.5KBps30.0 s25800.03991.5
Pipe throughput4389021.4lps10.0 s712440.03528.2
Pipe-based Context Switching831655.8lps10.0 s74000.02079.1
Process Creation34789.6lps30.0 s2126.02761.1
Shell Scripts (1 concurrent)11890.9lpm60.0 s242.42804.5
Shell Scripts (8 concurrent)1506.4lpm60.0 s26.02510.7
System call overhead5815793.6lps10.0 s715000.03877.2
System Benchmarks Index Score:3050.7


The increase was 18%, which in my opinion is quite noticeable. Why did the second test produce a slightly lower result? Most likely, the fact is that the test was performed on x86_64 and in the standard core there were more optimizations for the processor architecture than with the core compiled for the Pentium Pro on Intel Atom (SSE and others).

As you can see from this, there’s a point in building your kernel. The results are about the same on two fairly different processors: Intel Atom N270 and Core 2 Duo E8500.

I will not describe the kernel installation process for ARCH, it is as simple as possible. I am sure that for its users it is not difficult.

Build and install pf-kernel for Ubuntu


We download the kernel of our version with kernel.org. Attention: you need to download the version without stabilization patches (in the case of 2.6.38.11, you just need to download 2.6.38).
We download pf-kernel for this version of a kernel from here .
Unpack the archives and install the patch.
patch -p1 <(pfkernel patch address)

We copy the config in a folder with a kernel.
cp / boot / config-`uname -r` .config

If desired, you can make localmodconfig, which disables all unnecessary modules, this can greatly speed up the kernel build.

make localmodconfig
if it scolds that there is no / sbin / lsmod
ln -s / bin / lsmod / sbin / lsmod

Configure the core
make menuconfig
You need to enable BFS, BFQ and tuxonice if you wish, as well as in the tab about the processor, you should choose the optimization for your processor.

We put a patch for kernels with kernel.org
sed -rie 's / echo "\ +" / # echo "\ +" /' scripts / setlocalversion

Clearing the directory
make-kpkg clean

We collect
CONCURRENCY_LEVEL = `getconf _NPROCESSORS_ONLN` fakeroot make-kpkg --initrd --append-to-version = -pf kernel_image kernel_headers

That's all. We put the kernel with the dpkg command -i * .deb, reboot and select it in the bootloader.

UPDATE:
Zen Kernel showed almost identical results, in some places a little better, but in general no more than 5%, and then brightened up without even completing all the tests (test time is about 40 minutes).
Somebody Mr.z very strongly doubted the correctness of the calculations, here in the table you can see the increase in indicators for each test, as well as the average increase, not just the increase in the index. The numbers came out almost completely the same.
For IoGa , WiseLord and gnomeby - Comparing the vanilla core with the vanilla core assembled for its architecture, if it showed a performance boost, it is no more than the level of error, almost no difference whatsoever.

Source: https://habr.com/ru/post/131263/


All Articles