aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-03-05 15:21:47 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2019-03-05 15:21:47 -0500
commit78f860135433a8bba406352fbdcea8e8980583bf (patch)
tree0b7a9ba320e38b5d6eb0fb982bc2d9449aaf57f3 /fs/proc
parent18483190e7a2a6761b67c6824a31adf5b2b7be51 (diff)
parenta324ca9cad4736252c33c1e28cffe1d87f262d03 (diff)
Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull irq updates from Thomas Gleixner: "The interrupt departement delivers this time: - New infrastructure to manage NMIs on platforms which have a sane NMI delivery, i.e. identifiable NMI vectors instead of a single lump. - Simplification of the interrupt affinity management so drivers don't have to implement ugly loops around the PCI/MSI enablement. - Speedup for interrupt statistics in /proc/stat - Provide a function to retrieve the default irq domain - A new interrupt controller for the Loongson LS1X platform - Affinity support for the SiFive PLIC - Better support for the iMX irqsteer driver - NUMA aware memory allocations for GICv3 - The usual small fixes, improvements and cleanups all over the place" * 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (36 commits) irqchip/imx-irqsteer: Add multi output interrupts support irqchip/imx-irqsteer: Change to use reg_num instead of irq_group dt-bindings: irq: imx-irqsteer: Add multi output interrupts support dt-binding: irq: imx-irqsteer: Use irq number instead of group number irqchip/brcmstb-l2: Use _irqsave locking variants in non-interrupt code irqchip/gicv3-its: Use NUMA aware memory allocation for ITS tables irqdomain: Allow the default irq domain to be retrieved irqchip/sifive-plic: Implement irq_set_affinity() for SMP host irqchip/sifive-plic: Differentiate between PLIC handler and context irqchip/sifive-plic: Add warning in plic_init() if handler already present irqchip/sifive-plic: Pre-compute context hart base and enable base PCI/MSI: Remove obsolete sanity checks for multiple interrupt sets genirq/affinity: Remove the leftovers of the original set support nvme-pci: Simplify interrupt allocation genirq/affinity: Add new callback for (re)calculating interrupt sets genirq/affinity: Store interrupt sets size in struct irq_affinity genirq/affinity: Code consolidation irqchip/irq-sifive-plic: Check and continue in case of an invalid cpuid. irqchip/i8259: Fix shutdown order by moving syscore_ops registration dt-bindings: interrupt-controller: loongson ls1x intc ...
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/stat.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/fs/proc/stat.c b/fs/proc/stat.c
index 535eda7857cf..76175211b304 100644
--- a/fs/proc/stat.c
+++ b/fs/proc/stat.c
@@ -79,6 +79,31 @@ static u64 get_iowait_time(int cpu)
79 79
80#endif 80#endif
81 81
82static void show_irq_gap(struct seq_file *p, unsigned int gap)
83{
84 static const char zeros[] = " 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0";
85
86 while (gap > 0) {
87 unsigned int inc;
88
89 inc = min_t(unsigned int, gap, ARRAY_SIZE(zeros) / 2);
90 seq_write(p, zeros, 2 * inc);
91 gap -= inc;
92 }
93}
94
95static void show_all_irqs(struct seq_file *p)
96{
97 unsigned int i, next = 0;
98
99 for_each_active_irq(i) {
100 show_irq_gap(p, i - next);
101 seq_put_decimal_ull(p, " ", kstat_irqs_usr(i));
102 next = i + 1;
103 }
104 show_irq_gap(p, nr_irqs - next);
105}
106
82static int show_stat(struct seq_file *p, void *v) 107static int show_stat(struct seq_file *p, void *v)
83{ 108{
84 int i, j; 109 int i, j;
@@ -156,9 +181,7 @@ static int show_stat(struct seq_file *p, void *v)
156 } 181 }
157 seq_put_decimal_ull(p, "intr ", (unsigned long long)sum); 182 seq_put_decimal_ull(p, "intr ", (unsigned long long)sum);
158 183
159 /* sum again ? it could be updated? */ 184 show_all_irqs(p);
160 for_each_irq_nr(j)
161 seq_put_decimal_ull(p, " ", kstat_irqs_usr(j));
162 185
163 seq_printf(p, 186 seq_printf(p,
164 "\nctxt %llu\n" 187 "\nctxt %llu\n"