diff options
-rw-r--r-- | include/linux/irq.h | 4 | ||||
-rw-r--r-- | include/linux/kernel_stat.h | 10 | ||||
-rw-r--r-- | kernel/irq/chip.c | 21 | ||||
-rw-r--r-- | kernel/irq/handle.c | 10 |
4 files changed, 40 insertions, 5 deletions
diff --git a/include/linux/irq.h b/include/linux/irq.h index 2445d2b3d5dc..93fe9a943e71 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -161,8 +161,6 @@ struct irq_desc { | |||
161 | #endif | 161 | #endif |
162 | #ifdef CONFIG_HAVE_DYN_ARRAY | 162 | #ifdef CONFIG_HAVE_DYN_ARRAY |
163 | unsigned int *kstat_irqs; | 163 | unsigned int *kstat_irqs; |
164 | #else | ||
165 | unsigned int kstat_irqs[NR_CPUS]; | ||
166 | #endif | 164 | #endif |
167 | #if defined(CONFIG_INTR_REMAP) && defined(CONFIG_HAVE_SPARSE_IRQ) | 165 | #if defined(CONFIG_INTR_REMAP) && defined(CONFIG_HAVE_SPARSE_IRQ) |
168 | struct irq_2_iommu *irq_2_iommu; | 166 | struct irq_2_iommu *irq_2_iommu; |
@@ -219,8 +217,10 @@ extern struct irq_desc *sparse_irqs; | |||
219 | 217 | ||
220 | #endif | 218 | #endif |
221 | 219 | ||
220 | #ifdef CONFIG_HAVE_DYN_ARRAY | ||
222 | #define kstat_irqs_this_cpu(DESC) \ | 221 | #define kstat_irqs_this_cpu(DESC) \ |
223 | ((DESC)->kstat_irqs[smp_processor_id()]) | 222 | ((DESC)->kstat_irqs[smp_processor_id()]) |
223 | #endif | ||
224 | 224 | ||
225 | /* | 225 | /* |
226 | * Migration helpers for obsolete names, they will go away: | 226 | * Migration helpers for obsolete names, they will go away: |
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index f10616712de5..21249d8c1293 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h | |||
@@ -28,7 +28,7 @@ struct cpu_usage_stat { | |||
28 | 28 | ||
29 | struct kernel_stat { | 29 | struct kernel_stat { |
30 | struct cpu_usage_stat cpustat; | 30 | struct cpu_usage_stat cpustat; |
31 | #ifndef CONFIG_GENERIC_HARDIRQS | 31 | #ifndef CONFIG_HAVE_DYN_ARRAY |
32 | unsigned int irqs[NR_IRQS]; | 32 | unsigned int irqs[NR_IRQS]; |
33 | #endif | 33 | #endif |
34 | }; | 34 | }; |
@@ -41,7 +41,13 @@ DECLARE_PER_CPU(struct kernel_stat, kstat); | |||
41 | 41 | ||
42 | extern unsigned long long nr_context_switches(void); | 42 | extern unsigned long long nr_context_switches(void); |
43 | 43 | ||
44 | #ifndef CONFIG_GENERIC_HARDIRQS | 44 | #ifndef CONFIG_HAVE_DYN_ARRAY |
45 | #define kstat_irqs_this_cpu(irq) \ | ||
46 | (kstat_this_cpu.irqs[irq]) | ||
47 | #endif | ||
48 | |||
49 | |||
50 | #ifndef CONFIG_HAVE_DYN_ARRAY | ||
45 | static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) | 51 | static inline unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) |
46 | { | 52 | { |
47 | return kstat_cpu(cpu).irqs[irq]; | 53 | return kstat_cpu(cpu).irqs[irq]; |
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 9fc5e69213de..4ef555c50db8 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c | |||
@@ -327,7 +327,11 @@ handle_simple_irq(unsigned int irq, struct irq_desc *desc) | |||
327 | if (unlikely(desc->status & IRQ_INPROGRESS)) | 327 | if (unlikely(desc->status & IRQ_INPROGRESS)) |
328 | goto out_unlock; | 328 | goto out_unlock; |
329 | desc->status &= ~(IRQ_REPLAY | IRQ_WAITING); | 329 | desc->status &= ~(IRQ_REPLAY | IRQ_WAITING); |
330 | #ifdef CONFIG_HAVE_DYN_ARRAY | ||
330 | kstat_irqs_this_cpu(desc)++; | 331 | kstat_irqs_this_cpu(desc)++; |
332 | #else | ||
333 | kstat_irqs_this_cpu(irq)++; | ||
334 | #endif | ||
331 | 335 | ||
332 | action = desc->action; | 336 | action = desc->action; |
333 | if (unlikely(!action || (desc->status & IRQ_DISABLED))) | 337 | if (unlikely(!action || (desc->status & IRQ_DISABLED))) |
@@ -368,7 +372,11 @@ handle_level_irq(unsigned int irq, struct irq_desc *desc) | |||
368 | if (unlikely(desc->status & IRQ_INPROGRESS)) | 372 | if (unlikely(desc->status & IRQ_INPROGRESS)) |
369 | goto out_unlock; | 373 | goto out_unlock; |
370 | desc->status &= ~(IRQ_REPLAY | IRQ_WAITING); | 374 | desc->status &= ~(IRQ_REPLAY | IRQ_WAITING); |
375 | #ifdef CONFIG_HAVE_DYN_ARRAY | ||
371 | kstat_irqs_this_cpu(desc)++; | 376 | kstat_irqs_this_cpu(desc)++; |
377 | #else | ||
378 | kstat_irqs_this_cpu(irq)++; | ||
379 | #endif | ||
372 | 380 | ||
373 | /* | 381 | /* |
374 | * If its disabled or no action available | 382 | * If its disabled or no action available |
@@ -415,7 +423,11 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc) | |||
415 | goto out; | 423 | goto out; |
416 | 424 | ||
417 | desc->status &= ~(IRQ_REPLAY | IRQ_WAITING); | 425 | desc->status &= ~(IRQ_REPLAY | IRQ_WAITING); |
426 | #ifdef CONFIG_HAVE_DYN_ARRAY | ||
418 | kstat_irqs_this_cpu(desc)++; | 427 | kstat_irqs_this_cpu(desc)++; |
428 | #else | ||
429 | kstat_irqs_this_cpu(irq)++; | ||
430 | #endif | ||
419 | 431 | ||
420 | /* | 432 | /* |
421 | * If its disabled or no action available | 433 | * If its disabled or no action available |
@@ -479,8 +491,11 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc) | |||
479 | mask_ack_irq(desc, irq); | 491 | mask_ack_irq(desc, irq); |
480 | goto out_unlock; | 492 | goto out_unlock; |
481 | } | 493 | } |
482 | 494 | #ifdef CONFIG_HAVE_DYN_ARRAY | |
483 | kstat_irqs_this_cpu(desc)++; | 495 | kstat_irqs_this_cpu(desc)++; |
496 | #else | ||
497 | kstat_irqs_this_cpu(irq)++; | ||
498 | #endif | ||
484 | 499 | ||
485 | /* Start handling the irq */ | 500 | /* Start handling the irq */ |
486 | desc->chip->ack(irq); | 501 | desc->chip->ack(irq); |
@@ -535,7 +550,11 @@ handle_percpu_irq(unsigned int irq, struct irq_desc *desc) | |||
535 | { | 550 | { |
536 | irqreturn_t action_ret; | 551 | irqreturn_t action_ret; |
537 | 552 | ||
553 | #ifdef CONFIG_HAVE_DYN_ARRAY | ||
538 | kstat_irqs_this_cpu(desc)++; | 554 | kstat_irqs_this_cpu(desc)++; |
555 | #else | ||
556 | kstat_irqs_this_cpu(irq)++; | ||
557 | #endif | ||
539 | 558 | ||
540 | if (desc->chip->ack) | 559 | if (desc->chip->ack) |
541 | desc->chip->ack(irq); | 560 | desc->chip->ack(irq); |
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c index d638a911cbc1..eae69373a9c6 100644 --- a/kernel/irq/handle.c +++ b/kernel/irq/handle.c | |||
@@ -34,7 +34,11 @@ void | |||
34 | handle_bad_irq(unsigned int irq, struct irq_desc *desc) | 34 | handle_bad_irq(unsigned int irq, struct irq_desc *desc) |
35 | { | 35 | { |
36 | print_irq_desc(irq, desc); | 36 | print_irq_desc(irq, desc); |
37 | #ifdef CONFIG_HAVE_DYN_ARRAY | ||
37 | kstat_irqs_this_cpu(desc)++; | 38 | kstat_irqs_this_cpu(desc)++; |
39 | #else | ||
40 | kstat_irqs_this_cpu(irq)++; | ||
41 | #endif | ||
38 | ack_bad_irq(irq); | 42 | ack_bad_irq(irq); |
39 | } | 43 | } |
40 | 44 | ||
@@ -401,7 +405,11 @@ unsigned int __do_IRQ(unsigned int irq) | |||
401 | struct irqaction *action; | 405 | struct irqaction *action; |
402 | unsigned int status; | 406 | unsigned int status; |
403 | 407 | ||
408 | #ifdef CONFIG_HAVE_DYN_ARRAY | ||
404 | kstat_irqs_this_cpu(desc)++; | 409 | kstat_irqs_this_cpu(desc)++; |
410 | #else | ||
411 | kstat_irqs_this_cpu(irq)++; | ||
412 | #endif | ||
405 | if (CHECK_IRQ_PER_CPU(desc->status)) { | 413 | if (CHECK_IRQ_PER_CPU(desc->status)) { |
406 | irqreturn_t action_ret; | 414 | irqreturn_t action_ret; |
407 | 415 | ||
@@ -501,10 +509,12 @@ void early_init_irq_lock_class(void) | |||
501 | } | 509 | } |
502 | #endif | 510 | #endif |
503 | 511 | ||
512 | #ifdef CONFIG_HAVE_DYN_ARRAY | ||
504 | unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) | 513 | unsigned int kstat_irqs_cpu(unsigned int irq, int cpu) |
505 | { | 514 | { |
506 | struct irq_desc *desc = irq_to_desc(irq); | 515 | struct irq_desc *desc = irq_to_desc(irq); |
507 | return desc->kstat_irqs[cpu]; | 516 | return desc->kstat_irqs[cpu]; |
508 | } | 517 | } |
518 | #endif | ||
509 | EXPORT_SYMBOL(kstat_irqs_cpu); | 519 | EXPORT_SYMBOL(kstat_irqs_cpu); |
510 | 520 | ||