• Yinghai Lu's avatar
    add per_cpu_dyn_array support · 1f3fcd4b
    Yinghai Lu authored
    allow dyn-array in per_cpu area, allocated dynamically.
    
    usage:
    
    |  /* in .h */
    | struct kernel_stat {
    |        struct cpu_usage_stat   cpustat;
    |        unsigned int *irqs;
    | };
    |
    |  /* in .c */
    | DEFINE_PER_CPU(struct kernel_stat, kstat);
    |
    | DEFINE_PER_CPU_DYN_ARRAY_ADDR(per_cpu__kstat_irqs, per_cpu__kstat.irqs, sizeof(unsigned int), nr_irqs, sizeof(unsigned long), NULL);
    
    after setup_percpu()/per_cpu_alloc_dyn_array(), the dyn_array in
    per_cpu area is ready to use.
    Signed-off-by: default avatarYinghai Lu <yhlu.kernel@gmail.com>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    1f3fcd4b
main.c 23.1 KB