IRQ(interrupt request)

  • 投稿者:
  • 投稿カテゴリー:Linux

IRQとは

割り込み要求信号
パソコンの周辺機器に即時処理しなければならない事態が生じたとき、CPUへ送られる割り込み処理を要求する信号のこと

確認方法

現在までの割り込み発生数を確認する

root@hostname:/home/shimizu# cat /proc/interrupts
           CPU0       CPU1
  0:         31          0   IO-APIC-edge      timer
  1:          9          0   IO-APIC-edge      i8042
  4:        682          0   IO-APIC-edge      serial
  6:          2          0   IO-APIC-edge      floppy
  8:          8          0   IO-APIC-edge      rtc0
  9:          0          0   IO-APIC-fasteoi   acpi
 10:          0          0   IO-APIC-fasteoi   virtio2
 11:         23          0   IO-APIC-fasteoi   uhci_hcd:usb1
 12:        142          0   IO-APIC-edge      i8042
 14:          0          0   IO-APIC-edge      ata_piix
 15:        131          0   IO-APIC-edge      ata_piix
 40:          0          0   PCI-MSI-edge      virtio0-config
 41:  202476885          0   PCI-MSI-edge      virtio0-input
 42:         82          0   PCI-MSI-edge      virtio0-output
 43:          0          0   PCI-MSI-edge      virtio1-config
 44:    3290049          0   PCI-MSI-edge      virtio1-requests
NMI:      56205      43082   Non-maskable interrupts
LOC:  284668650  190261695   Local timer interrupts
SPU:          0          0   Spurious interrupts
PMI:      56205      43082   Performance monitoring interrupts
IWI:          0          0   IRQ work interrupts
RES:   34405406   33792271   Rescheduling interrupts
CAL:        297        605   Function call interrupts
TLB:     967908     974682   TLB shootdowns
TRM:          0          0   Thermal event interrupts
THR:          0          0   Threshold APIC interrupts
MCE:          0          0   Machine check exceptions
MCP:      30804      30804   Machine check polls
ERR:          0
MIS:          0
root@hostname:/home/shimizu# cat /proc/irq/0/smp_affinity
3

IRQは、0~15の16種類用意されている
0 システムタイマー
1 キーボード
2 スレーブの割り込みを転送
3 シリアルポート(COM2)
4 シリアルポート(COM1)
5 パラレルポート(LPT2)
6 フロッピーディスクドライブ
7 パラレルポート(LPT1)
8 リアルタイムクロック
9 未使用
10 未使用
11 未使用
12 PS/2マウス
13 数値演算プロセッサ
14 プライマリIDE
15 セカンダリIDE

であり、利用されていないもの(シリアルポートやパラレルポート)は表示されない

参考URL

COMとLPT
http://www.linux-beginner.com/lpic_level1_3.html
ハードウェア割り込み処理
http://sourceforge.jp/projects/linux-kernel-docs/wiki/2.3%E3%80%80%E3%83%8F%E3%83%BC%E3%83%89%E3%82%A6%E3%82%A7%E3%82%A2%E5%89%B2%E3%82%8A%E8%BE%BC%E3%81%BF%E5%87%A6%E7%90%86
4.3. 割り込みおよび IRQ チューニング
https://access.redhat.com/documentation/ja-JP/Red_Hat_Enterprise_Linux/6/html/Performance_Tuning_Guide/s-cpu-irq.html