Skip to content

Commit

Permalink
irq: make irqs in kernel stat use per_cpu_dyn_array
Browse files Browse the repository at this point in the history
Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Oct 16, 2008
1 parent fa42d10 commit d17a55d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions include/linux/kernel_stat.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ struct cpu_usage_stat {

struct kernel_stat {
struct cpu_usage_stat cpustat;
#ifdef CONFIG_HAVE_DYN_ARRAY
unsigned int *irqs;
#else
unsigned int irqs[NR_IRQS];
#endif
};

DECLARE_PER_CPU(struct kernel_stat, kstat);
Expand Down
5 changes: 4 additions & 1 deletion kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -4048,9 +4048,12 @@ static inline void idle_balance(int cpu, struct rq *rq)
#endif

DEFINE_PER_CPU(struct kernel_stat, kstat);

EXPORT_PER_CPU_SYMBOL(kstat);

#ifdef CONFIG_HAVE_DYN_ARRAY
DEFINE_PER_CPU_DYN_ARRAY_ADDR(per_cpu__kstat_irqs, per_cpu__kstat.irqs, sizeof(unsigned int), nr_irqs, sizeof(unsigned long), NULL);
#endif

/*
* Return p->sum_exec_runtime plus any more ns on the sched_clock
* that have not yet been banked in case the task is currently running.
Expand Down

0 comments on commit d17a55d

Please sign in to comment.