おのたく日記 YouTubeも始めました→
2009-11-03(Tue) [長年日記]
■ [Debian]irqbalanceと
irqbalanceを入れてデーモンとして動かしているけど、本当にバランスしているのか不安だったが、「[debian-users:50212] Re: irqbalanceについて」などを読むと効果があるらしい。たしかに
# cat /proc/interrupts
CPU0 CPU1
0: 2293 0 IO-APIC-edge timer
1: 1689 109776 IO-APIC-edge i8042
4: 16 0 IO-APIC-edge
7: 157688 26245950 IO-APIC-edge parport0
8: 1380737328 0 IO-APIC-edge rtc0
9: 0 0 IO-APIC-fasteoi acpi
14: 6746 5642665 IO-APIC-edge ide0
15: 0 0 IO-APIC-edge ide1
16: 49288 2467766 IO-APIC-fasteoi i915@pci:0000:00:02.0
17: 35533 21518649 IO-APIC-fasteoi ata_piix, uhci_hcd:usb3
18: 0 0 IO-APIC-fasteoi uhci_hcd:usb4
19: 5765 294074 IO-APIC-fasteoi uhci_hcd:usb5, HDA Intel
20: 435 1033498 IO-APIC-fasteoi ehci_hcd:usb1, uhci_hcd:usb2
21: 10437 3296310 IO-APIC-fasteoi saa7130[0]
26: 23506 17061133 PCI-MSI-edge eth0
NMI: 0 0 Non-maskable interrupts
LOC: 265466524 252990560 Local timer interrupts
SPU: 0 0 Spurious interrupts
CNT: 0 0 Performance counter interrupts
PND: 0 0 Performance pending work
RES: 2421131 6191979 Rescheduling interrupts
CAL: 30986 5241435 Function call interrupts
TLB: 4606451 2164946 TLB shootdowns
TRM: 5810 58384 Thermal event interrupts
THR: 0 0 Threshold APIC interrupts
MCE: 0 0 Machine check exceptions
MCP: 2251 2250 Machine check polls
ERR: 0
MIS: 0
ということで、CPU0だけでなくてCPU1にも割り込みが振り分けられている。
■ CPUの動作周波数を動的に変更
てなことをしていたら、おうちサーバのPentiumD 940は、SpeedStepがサポートされていてCPUの周波数を2.4GHzから3.2GHzまで動的に変えられることを思い出した。
「パッケージ: cpufrequtils」のコマンドで確認してみると、
$ cpufreq-info
cpufrequtils 005: cpufreq-info (C) Dominik Brodowski 2004-2006
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
driver: acpi-cpufreq
CPUs which need to switch frequency at the same time: 0
hardware limits: 2.40 GHz - 3.20 GHz
available frequency steps: 3.20 GHz, 2.80 GHz, 2.40 GHz
available cpufreq governors: conservative, powersave, userspace, ondemand, performance
current policy: frequency should be within 2.40 GHz and 3.20 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 3.20 GHz (asserted by call to hardware).
cpufreq stats: 3.20 GHz:10.24%, 2.80 GHz:0.65%, 2.40 GHz:89.11% (3652847)
analyzing CPU 1:
driver: acpi-cpufreq
CPUs which need to switch frequency at the same time: 1
hardware limits: 2.40 GHz - 3.20 GHz
available frequency steps: 3.20 GHz, 2.80 GHz, 2.40 GHz
available cpufreq governors: conservative, powersave, userspace, ondemand, performance
current policy: frequency should be within 2.40 GHz and 3.20 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 3.20 GHz (asserted by call to hardware).
cpufreq stats: 3.20 GHz:15.01%, 2.80 GHz:0.54%, 2.40 GHz:84.45% (2823213)
と確かに変えられるようで cpufreq-set -f 2.8GHz などとすると変更が可能。
GNOME appletのCPU周波数の計測モニタで計測すると確かに負荷に応じてダイナミックにCPU動作周波数が変わっている(^_^)
#一瞬 powernowdパッケージもいれたけど cpufrequtilだけでもCPU負荷に応じて動的に変わっているような気がする。
■ governorは
ondemand: 負荷がかかるとクロックを上げ、負荷が下がるとクロックも下げる(値は急に大きく変動する)
conservative: 負荷がかかるとクロックを上げ、負荷が下がるとクロックも下げる(値はゆっくり段階的に変動する)
powersave: 負荷に関わらず、変動可能範囲内の最低のクロックで動作
performance: 負荷に関わらず、変動可能範囲内の最高のクロックで動作
|