tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: RFC: IRQ affinity (aka interrupt routing)



Kengo NAKAHARA <k-nakahara%iij.ad.jp@localhost> wrote:
> The implementation is consist of following three pathes:
> <...>
>     (2) new kernfs file to show interrupt numbers per cpu
>         "vmstat -i" cannot show interrupt numbers per cpu. So I
>         implement new kernfs file to show per cpu. The usage is "cat
>         /kern/interrupts". For example, we can see below output
>         which is like linux's /proc/interrupts
>         ====================
>          IRQ      CPU#00          CPU#01
>            1           0*              0
>            3           0*              0
>            4           0*              0
>            6           0*              0
>            7           0*              0
>            9           0*              0
>           12           0*              0
>           14           0*              0
>           15           0*              0
>           16         108*              0
>           17     1193055*              0
>           18      680358             150*
>         ====================
>         "*" mean the cpu is routed the IRQ number interrupts.
>             
> https://github.com/knakahara/netbsd-src/commit/dc7c17dd2f0cd78a03983849feb8fdd8cbe0d9c6

Agree with Martin that vmstat -i could grow per-CPU counters, but it might
be a bit more work than you want to do.  So, up to you. :)

> <...>
> 
> Above implementation works well, but I think the UI is not so good.
> So, I am going to implement new command intrctl(8). The usage is consist
> of below two sub command.
>     (A) "intrctl list"
>         This sub command show interrupt numbers per cpu (like
>         /kern/interrupts).
> 
>     (B) "intrctl -i 18 -c 1"
>         This sub command let interrupts route other cpu. "18" is IRQ
>         number, "1" is cpuid (like "sysctl -w kern.cpu_affinity.irq=18:1").
> 
> Could you comment which UI is good, current "sysctl and /kern/interrupts"
> or new "intrctl"?

I do not really like /kern/interrupts.  intrctl(8) seems like a good
interface.  Note that cpuctl(8) has intr/nointr commands which are not
enabled at this moment.  They should move to intrctl(8).

-- 
Mindaugas


Home | Main Index | Thread Index | Old Index