Is there any benefit from custom kernels

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


    Arch linux

    Let's start with the Arch Linux test on a netbook.
    UnixBench test results on the standard core (3.0-ARCH):
    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):
    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%.

    Now the results of the same tests, but the same for Ubuntu.
    On the standard kernel (2.6.38-11-generic):
    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 core (2.6.38-pf8):

    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 conducted on x86_64 and in the standard kernel there were more optimizations for the processor architecture than with the core assembled for Pentium Pro on Intel Atom (SSE and others).

    As you can see from all this, there is a point in assembling your kernel. The results are approximately 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 it will not be difficult for its users.

    Build and install pf-kernel for Ubuntu

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

    Copy your config to the kernel folder.
    cp / boot / config-`uname -r` .config

    If you wish, you can make localmodconfig, which will disable all unnecessary modules, this can greatly accelerate the assembly of the kernel.

    make localmodconfig
    if it swears that there is no / sbin / lsmod
    ln -s / bin / lsmod / sbin / lsmod We configure

    the make menuconfig kernel

    Нужно включить BFS, BFQ и tuxonice при желании, а также во вкладке о процессоре стоит выбрать оптимизацию под свой процессор.

    Ставим патч для ядер с
    sed -rie 's/echo "\+"/#echo "\+"/' scripts/setlocalversion

    Очищаем директорию
    make-kpkg clean

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

    Вот собственно и все. Ставим ядро командой dpkg -i *.deb, перезагружаемся и выбираем его в загрузчике.

    Zen Kernel показал практически идентичный результат, местами чуть лучше, но в общем не более чем на 5%, а затем скрашился даже не завершив все тесты (время теста около 40 минут).
    Некто Mr.z I very much 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, and not just the index increase. The numbers came out almost exactly the same.
    For IoGa , WiseLord and gnomeby - Comparison of a vanilla kernel with a vanilla assembled for its architecture, if it showed a performance increase, it is not more than the level of error, almost no difference.

    Also popular now: