mbox series

[V2,0/2] genirq, proc: Speedup /proc/stat interrupt statistics

Message ID 20190208134802.218483159@linutronix.de (mailing list archive)
Headers show
Series genirq, proc: Speedup /proc/stat interrupt statistics | expand

Message

Thomas Gleixner Feb. 8, 2019, 1:48 p.m. UTC
Waiman reported that on large systems with a large amount of interrupts the
readout of /proc/stat takes a long time to sum up the interrupt
statistics. In principle this is not a problem. but for unknown reasons
some enterprise quality software reads /proc/stat with a high frequency.

The reason for this is that interrupt statistics are accounted per cpu. So
the /proc/stat logic has to sum up the interrupt stats for each interrupt.

The following series addresses this by making the interrupt statitics code
in the core generate the sum directly and by making the loop in the
/proc/stat read function smarter.

V1 -> V2: Address review feedback: undo struct layout changes, make
      	  variables unsigned and add test results to the changelog.

Thanks,

        tglx

8<----------------
 fs/proc/stat.c          |   29 ++++++++++++++++++++++++++---
 include/linux/irqdesc.h |    1 +
 kernel/irq/chip.c       |   12 ++++++++++--
 kernel/irq/internals.h  |    8 +++++++-
 kernel/irq/irqdesc.c    |    7 ++++++-
 5 files changed, 50 insertions(+), 7 deletions(-)

Comments

Waiman Long Feb. 8, 2019, 3:20 p.m. UTC | #1
On 02/08/2019 08:48 AM, Thomas Gleixner wrote:
> Waiman reported that on large systems with a large amount of interrupts the
> readout of /proc/stat takes a long time to sum up the interrupt
> statistics. In principle this is not a problem. but for unknown reasons
> some enterprise quality software reads /proc/stat with a high frequency.
>
> The reason for this is that interrupt statistics are accounted per cpu. So
> the /proc/stat logic has to sum up the interrupt stats for each interrupt.
>
> The following series addresses this by making the interrupt statitics code
> in the core generate the sum directly and by making the loop in the
> /proc/stat read function smarter.
>
> V1 -> V2: Address review feedback: undo struct layout changes, make
>       	  variables unsigned and add test results to the changelog.
>
> Thanks,
>
>         tglx
>
> 8<----------------
>  fs/proc/stat.c          |   29 ++++++++++++++++++++++++++---
>  include/linux/irqdesc.h |    1 +
>  kernel/irq/chip.c       |   12 ++++++++++--
>  kernel/irq/internals.h  |    8 +++++++-
>  kernel/irq/irqdesc.c    |    7 ++++++-
>  5 files changed, 50 insertions(+), 7 deletions(-)
>
Thanks for the patch.

Reviewed-by: Waiman Long <longman@redhat.com>

-Longman
Davidlohr Bueso Feb. 8, 2019, 5:01 p.m. UTC | #2
On Fri, 08 Feb 2019, Thomas Gleixner wrote:

>Waiman reported that on large systems with a large amount of interrupts the
>readout of /proc/stat takes a long time to sum up the interrupt
>statistics. In principle this is not a problem. but for unknown reasons
>some enterprise quality software reads /proc/stat with a high frequency.

:)

>
>The reason for this is that interrupt statistics are accounted per cpu. So
>the /proc/stat logic has to sum up the interrupt stats for each interrupt.
>
>The following series addresses this by making the interrupt statitics code
>in the core generate the sum directly and by making the loop in the
>/proc/stat read function smarter.
>
>V1 -> V2: Address review feedback: undo struct layout changes, make
>      	  variables unsigned and add test results to the changelog.
>
>Thanks,
>
>        tglx
>
>8<----------------
> fs/proc/stat.c          |   29 ++++++++++++++++++++++++++---
> include/linux/irqdesc.h |    1 +
> kernel/irq/chip.c       |   12 ++++++++++--
> kernel/irq/internals.h  |    8 +++++++-
> kernel/irq/irqdesc.c    |    7 ++++++-
> 5 files changed, 50 insertions(+), 7 deletions(-)

Reviewed-by: Davidlohr Bueso <dbueso@suse.de>
Marc Zyngier Feb. 8, 2019, 5:40 p.m. UTC | #3
On 08/02/2019 13:48, Thomas Gleixner wrote:
> Waiman reported that on large systems with a large amount of interrupts the
> readout of /proc/stat takes a long time to sum up the interrupt
> statistics. In principle this is not a problem. but for unknown reasons
> some enterprise quality software reads /proc/stat with a high frequency.
> 
> The reason for this is that interrupt statistics are accounted per cpu. So
> the /proc/stat logic has to sum up the interrupt stats for each interrupt.
> 
> The following series addresses this by making the interrupt statitics code
> in the core generate the sum directly and by making the loop in the
> /proc/stat read function smarter.
> 
> V1 -> V2: Address review feedback: undo struct layout changes, make
>       	  variables unsigned and add test results to the changelog.
> 
> Thanks,
> 
>         tglx
> 
> 8<----------------
>  fs/proc/stat.c          |   29 ++++++++++++++++++++++++++---
>  include/linux/irqdesc.h |    1 +
>  kernel/irq/chip.c       |   12 ++++++++++--
>  kernel/irq/internals.h  |    8 +++++++-
>  kernel/irq/irqdesc.c    |    7 ++++++-
>  5 files changed, 50 insertions(+), 7 deletions(-)
> 

Reviewed-by: Marc Zyngier <marc.zyngier@arm.com>

Thanks,

	M.