Re: [PATCH 0/7] proc/stat: Maintain monotonicity of "intr" and "softirq"

Alexey Dobriyan
2021-09-12T09:30:13Z

On Sat, Sep 11, 2021 at 12:48:01PM +0900, Alexei Lozovsky wrote:
> Here's a patch set that makes /proc/stat report total interrupt counts
> as monotonically increasing values, just like individual counters for
> interrupt types and CPUs are.
>
> This is as if the sum was a shared counter that all CPUs increment
> atomically together with their individual counters, with the sum
> correctly and expectedly wrapping around to zero once it reaches
> UINT_MAX.
>
> I've also added some documentation bits to codify this behavior and make
> it explicit that wrap-arounds must be expected and handled if userspace
> wants to maintain accurate total interrupt count for whatever reasons.

How about making everything "unsigned long" or even "u64" like NIC
drivers do?