3

/proc/softirq is softirq stats. Is /proc/interrupt both hard and soft interrupts or hard only?

I want to measure the rate of hard and soft irq's per second roughly using watch -n 1 grep 'foo' /proc/softirq and watch -n 1 grep 'bar' /proc/interrupt so I can compare the rate of hardware interrupt increase to software interrupt.

I'm wondering if I need to subtract /proc/softirq counts from /proc/interrupt to get the count of hardware IRQs because it counts both kinds or if /proc/interrupt is hardware only?

1 Answer 1

3

softirqs aren't directly related to hardware interrupts, they're the successor to "bottom halves" and the predecessor of tasklets. The (old) Unreliable Guide to Hacking the Linux Kernel has a brief section on the topic; I dare say there are better resources elsewhere. The list of softirqs is defined in include/linux/interrupt.h; you'll see they don't correspond to single hardware interrupts.

Thus you shouldn't subtract /proc/softirq counts from /proc/interrupts. The latter only counts hardware interrupts; these of course may result in softirqs being used too, but there's no easy way of determining the correlation (e.g. between hardware interrupts on your network adapter and NET_RX or NET_TX softirqs).

1
  • Thanks for the response. I'm not trying to correlate them only measure them. I am aware that soft irqs and hard irqs are not directly related. I need to perf some software that uses both, so I want to see when it is running what the rate of hard and soft irq's are so I just wanted to make sure that /proc/softirq is soft only and /proc/interrupt is hard irqs only. You have confirmed this (which is what I thought to be the case).
    – Baldrick
    Commented Feb 2, 2017 at 9:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .