aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-20 16:22:50 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-20 16:23:01 -0400
commit9301975ec251bab1ad7cfcb84a688b26187e4e4a (patch)
tree91e48be0bdc67cbcb75bc8a299a3dcf168e0a814 /fs/proc
parent7110879cf2afbfb7af79675f5ff109e63d631c25 (diff)
parentdd3a1db900f2a215a7d7dd71b836e149a6cf5fed (diff)
Merge branch 'genirq-v28-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
This merges branches irq/genirq, irq/sparseirq-v4, timers/hpet-percpu and x86/uv. The sparseirq branch is just preliminary groundwork: no sparse IRQs are actually implemented by this tree anymore - just the new APIs are added while keeping the old way intact as well (the new APIs map 1:1 to irq_desc[]). The 'real' sparse IRQ support will then be a relatively small patch ontop of this - with a v2.6.29 merge target. * 'genirq-v28-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (178 commits) genirq: improve include files intr_remapping: fix typo io_apic: make irq_mis_count available on 64-bit too genirq: fix name space collisions of nr_irqs in arch/* genirq: fix name space collision of nr_irqs in autoprobe.c genirq: use iterators for irq_desc loops proc: fixup irq iterator genirq: add reverse iterator for irq_desc x86: move ack_bad_irq() to irq.c x86: unify show_interrupts() and proc helpers x86: cleanup show_interrupts genirq: cleanup the sparseirq modifications genirq: remove artifacts from sparseirq removal genirq: revert dynarray genirq: remove irq_to_desc_alloc genirq: remove sparse irq code genirq: use inline function for irq_to_desc genirq: consolidate nr_irqs and for_each_irq_desc() x86: remove sparse irq from Kconfig genirq: define nr_irqs for architectures with GENERIC_HARDIRQS=n ...
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/proc_misc.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index 61b25f4eabe6..7ea52c79b2da 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -30,6 +30,7 @@
30#include <linux/mm.h> 30#include <linux/mm.h>
31#include <linux/mmzone.h> 31#include <linux/mmzone.h>
32#include <linux/pagemap.h> 32#include <linux/pagemap.h>
33#include <linux/irq.h>
33#include <linux/interrupt.h> 34#include <linux/interrupt.h>
34#include <linux/swap.h> 35#include <linux/swap.h>
35#include <linux/slab.h> 36#include <linux/slab.h>
@@ -521,17 +522,13 @@ static const struct file_operations proc_vmalloc_operations = {
521 522
522static int show_stat(struct seq_file *p, void *v) 523static int show_stat(struct seq_file *p, void *v)
523{ 524{
524 int i; 525 int i, j;
525 unsigned long jif; 526 unsigned long jif;
526 cputime64_t user, nice, system, idle, iowait, irq, softirq, steal; 527 cputime64_t user, nice, system, idle, iowait, irq, softirq, steal;
527 cputime64_t guest; 528 cputime64_t guest;
528 u64 sum = 0; 529 u64 sum = 0;
529 struct timespec boottime; 530 struct timespec boottime;
530 unsigned int *per_irq_sum; 531 unsigned int per_irq_sum;
531
532 per_irq_sum = kzalloc(sizeof(unsigned int)*NR_IRQS, GFP_KERNEL);
533 if (!per_irq_sum)
534 return -ENOMEM;
535 532
536 user = nice = system = idle = iowait = 533 user = nice = system = idle = iowait =
537 irq = softirq = steal = cputime64_zero; 534 irq = softirq = steal = cputime64_zero;
@@ -540,8 +537,6 @@ static int show_stat(struct seq_file *p, void *v)
540 jif = boottime.tv_sec; 537 jif = boottime.tv_sec;
541 538
542 for_each_possible_cpu(i) { 539 for_each_possible_cpu(i) {
543 int j;
544
545 user = cputime64_add(user, kstat_cpu(i).cpustat.user); 540 user = cputime64_add(user, kstat_cpu(i).cpustat.user);
546 nice = cputime64_add(nice, kstat_cpu(i).cpustat.nice); 541 nice = cputime64_add(nice, kstat_cpu(i).cpustat.nice);
547 system = cputime64_add(system, kstat_cpu(i).cpustat.system); 542 system = cputime64_add(system, kstat_cpu(i).cpustat.system);
@@ -551,11 +546,10 @@ static int show_stat(struct seq_file *p, void *v)
551 softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq); 546 softirq = cputime64_add(softirq, kstat_cpu(i).cpustat.softirq);
552 steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal); 547 steal = cputime64_add(steal, kstat_cpu(i).cpustat.steal);
553 guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest); 548 guest = cputime64_add(guest, kstat_cpu(i).cpustat.guest);
554 for (j = 0; j < NR_IRQS; j++) { 549
555 unsigned int temp = kstat_cpu(i).irqs[j]; 550 for_each_irq_nr(j)
556 sum += temp; 551 sum += kstat_irqs_cpu(j, i);
557 per_irq_sum[j] += temp; 552
558 }
559 sum += arch_irq_stat_cpu(i); 553 sum += arch_irq_stat_cpu(i);
560 } 554 }
561 sum += arch_irq_stat(); 555 sum += arch_irq_stat();
@@ -597,8 +591,15 @@ static int show_stat(struct seq_file *p, void *v)
597 } 591 }
598 seq_printf(p, "intr %llu", (unsigned long long)sum); 592 seq_printf(p, "intr %llu", (unsigned long long)sum);
599 593
600 for (i = 0; i < NR_IRQS; i++) 594 /* sum again ? it could be updated? */
601 seq_printf(p, " %u", per_irq_sum[i]); 595 for_each_irq_nr(j) {
596 per_irq_sum = 0;
597
598 for_each_possible_cpu(i)
599 per_irq_sum += kstat_irqs_cpu(j, i);
600
601 seq_printf(p, " %u", per_irq_sum);
602 }
602 603
603 seq_printf(p, 604 seq_printf(p,
604 "\nctxt %llu\n" 605 "\nctxt %llu\n"
@@ -612,7 +613,6 @@ static int show_stat(struct seq_file *p, void *v)
612 nr_running(), 613 nr_running(),
613 nr_iowait()); 614 nr_iowait());
614 615
615 kfree(per_irq_sum);
616 return 0; 616 return 0;
617} 617}
618 618
@@ -651,15 +651,14 @@ static const struct file_operations proc_stat_operations = {
651 */ 651 */
652static void *int_seq_start(struct seq_file *f, loff_t *pos) 652static void *int_seq_start(struct seq_file *f, loff_t *pos)
653{ 653{
654 return (*pos <= NR_IRQS) ? pos : NULL; 654 return (*pos <= nr_irqs) ? pos : NULL;
655} 655}
656 656
657
657static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos) 658static void *int_seq_next(struct seq_file *f, void *v, loff_t *pos)
658{ 659{
659 (*pos)++; 660 (*pos)++;
660 if (*pos > NR_IRQS) 661 return (*pos <= nr_irqs) ? pos : NULL;
661 return NULL;
662 return pos;
663} 662}
664 663
665static void int_seq_stop(struct seq_file *f, void *v) 664static void int_seq_stop(struct seq_file *f, void *v)
@@ -667,7 +666,6 @@ static void int_seq_stop(struct seq_file *f, void *v)
667 /* Nothing to do */ 666 /* Nothing to do */
668} 667}
669 668
670
671static const struct seq_operations int_seq_ops = { 669static const struct seq_operations int_seq_ops = {
672 .start = int_seq_start, 670 .start = int_seq_start,
673 .next = int_seq_next, 671 .next = int_seq_next,