カーネルのビルドオプションを確認する

  • 投稿日:
  • by
  • カテゴリ:



configファイルをみりゃすぐに分かることでして。


例えば、以下のようなことが書いてあったとして、確認するにはどうすれば良いかという。


Linux guests may cause a high CPU load


http://www.virtualbox.org/manual/ch12.html#id2770280



Some Linux guests may cause a high CPU load even if the guest system appears to be idle. This can be caused by a high timer frequency of the guest kernel. Some Linux distributions, for example Fedora, ship a Linux kernel configured for a timer frequency of 1000Hz. We recommend to recompile the guest kernel and to select a timer frequency of 100Hz.


(超訳)


いくつかのLinuxゲストは、ゲストシステムがアイドル状態であっても、高いCPU負荷を引き起こすことがあります。これはゲストカーネルの高いタイマ周波数が原因だったりします。いくつかのLinuxディストリビューション、例えばFedoraは、タイマ周波数を1000Hzに設定したLinuxカーネルを出荷しています。我々は、ゲストカーネルを再構築して、タイマ周波数として100Hzを選択することを推奨しています。



# これって何年も前に知れ渡ったことだと思うんですけどね。



問題のカーネルがどういうconfigでビルドされたかを見るには、こんな感じで良いわけです。



[syasuda@localhost boot]$ pwd
/boot
[syasuda@localhost boot]$ uname -r
2.6.35.6-45.fc14.i686
[syasuda@localhost boot]$ ls -al
total 19070
dr-xr-xr-x. 5 root root 1024 Dec 11 17:42 .
dr-xr-xr-x. 23 root root 4096 Dec 12 22:34 ..
-rw-r--r--. 1 root root 114968 Oct 19 09:01 config-2.6.35.6-45.fc14.i686
drwxr-xr-x. 3 root root 1024 Oct 23 03:18 efi
-rw-r--r--. 1 root root 166756 May 25 2010 elf-memtest86+-4.10
drwxr-xr-x. 2 root root 1024 Dec 11 17:42 grub
-rw-r--r--. 1 root root 12561913 Dec 11 17:42 initramfs-2.6.35.6-45.fc14.i686.img
-rw-r--r--. 1 root root 1106254 Oct 23 03:21 initrd-plymouth.img
drwx------. 2 root root 12288 Dec 11 17:38 lost+found
-rw-r--r--. 1 root root 165080 May 25 2010 memtest86+-4.10
-rw-r--r--. 1 root root 1681526 Oct 19 09:01 System.map-2.6.35.6-45.fc14.i686
-rwxr-xr-x. 1 root root 3696448 Oct 19 09:01 vmlinuz-2.6.35.6-45.fc14.i686
[syasuda@localhost boot]$ cat config-2.6.35.6-45.fc14.i686 |grep CONFIG_HZ
# CONFIG_HZ_100 is not set
# CONFIG_HZ_250 is not set
# CONFIG_HZ_300 is not set
CONFIG_HZ_1000=y
CONFIG_HZ=1000
[syasuda@localhost boot]$

動いているカーネルと対応したconfigファイルを見るだけのことで。


手でconfigファイルが書き換えられてたら、もちろんあきませんわな。日付くらいはポカよけで確認したらええんとちゃいますか。


手抜き野郎が、カーネルイメージだけ差し替えたりしてたらアテにはならんわけで。



参考:


http://www.atmarkit.co.jp/flinux/rensai/watch2007/watch03a.html



2.6.21-rc1でマージされた面白い機能として、dyntick/NO_HZがあります。Linuxカーネルは、通常1秒間に100回(現在はCONFIG_HZとして250、300、1000、1024回などから選択できる)程度以上のタイマー割り込みが発生することを前提に設計されています。その割り込みが発生するタイミングで、jiffies(注)と呼ばれるカウンターが増えたり、タスクの切り替えなどが発生します。



How To Check What Kernel Build Options Enabled In The Linux Kernel?


http://www.walkernews.net/2008/11/21/how-to-check-what-kernel-build-options-enabled-in-the-linux-kernel/


最近この手のカーネル本の新著が出ないようですが、ブームが去った?