• Thomas Gleixner's avatar
    genirq: Avoid summation loops for /proc/stat · c0ed0486
    Thomas Gleixner authored
    [ Upstream commit 1136b072 ]
    
    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.
    
    This can be largely avoided for interrupts which are not marked as
    'PER_CPU' interrupts by simply adding a per interrupt summation counter
    which is incremented along with the per interrupt per cpu counter.
    
    The PER_CPU interrupts need to avoid that and use only per cpu accounting
    because they share the interrupt number and the interrupt descriptor and
    concurrent updates would conflict or require unwanted synchronization.
    Reported-by: Waiman Long's avatarWaiman Long <longman@redhat.com>
    Signed-off-by: 's avatarThomas Gleixner <tglx@linutronix.de>
    Reviewed-by: Waiman Long's avatarWaiman Long <longman@redhat.com>
    Reviewed-by: 's avatarMarc Zyngier <marc.zyngier@arm.com>
    Reviewed-by: 's avatarDavidlohr Bueso <dbueso@suse.de>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: Alexey Dobriyan <adobriyan@gmail.com>
    Cc: Kees Cook <keescook@chromium.org>
    Cc: linux-fsdevel@vger.kernel.org
    Cc: Davidlohr Bueso <dave@stgolabs.net>
    Cc: Miklos Szeredi <miklos@szeredi.hu>
    Cc: Daniel Colascione <dancol@google.com>
    Cc: Dave Chinner <david@fromorbit.com>
    Cc: Randy Dunlap <rdunlap@infradead.org>
    Link: https://lkml.kernel.org/r/20190208135020.925487496@linutronix.de
    
    8<-------------
    
    v2: Undo the unintentional layout change of struct irq_desc.
    
     include/linux/irqdesc.h |    1 +
     kernel/irq/chip.c       |   12 ++++++++++--
     kernel/irq/internals.h  |    8 +++++++-
     kernel/irq/irqdesc.c    |    7 ++++++-
     4 files changed, 24 insertions(+), 4 deletions(-)
    Signed-off-by: 's avatarSasha Levin <sashal@kernel.org>
    c0ed0486
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
affinity.c Loading commit data...
autoprobe.c Loading commit data...
chip.c Loading commit data...
cpuhotplug.c Loading commit data...
debug.h Loading commit data...
debugfs.c Loading commit data...
devres.c Loading commit data...
dummychip.c Loading commit data...
generic-chip.c Loading commit data...
handle.c Loading commit data...
internals.h Loading commit data...
ipi.c Loading commit data...
irq_sim.c Loading commit data...
irqdesc.c Loading commit data...
irqdomain.c Loading commit data...
manage.c Loading commit data...
matrix.c Loading commit data...
migration.c Loading commit data...
msi.c Loading commit data...
pm.c Loading commit data...
proc.c Loading commit data...
resend.c Loading commit data...
settings.h Loading commit data...
spurious.c Loading commit data...
timings.c Loading commit data...