From: Rusty Russell Some well-meaning person put a notifier in for CPUs to update the kstat structures in sched.c. However, it does nothing, and even with the full hotplug CPU patch, it still does nothing. Simple counters very rarely need anything done when CPUs come up or go down. If you have per-cpu caches, or per-cpu threads, you need to do something. But very rarely for stats. --- kernel/sched.c | 34 ---------------------------------- 1 files changed, 34 deletions(-) diff -puN kernel/sched.c~remove-kstat-cpu-notifiers kernel/sched.c --- 25/kernel/sched.c~remove-kstat-cpu-notifiers 2004-02-06 20:55:30.000000000 -0800 +++ 25-akpm/kernel/sched.c 2004-02-06 20:55:30.000000000 -0800 @@ -3178,38 +3178,6 @@ int __init migration_init(void) spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED; EXPORT_SYMBOL(kernel_flag); -static void kstat_init_cpu(int cpu) -{ - /* Add any initialisation to kstat here */ - /* Useful when cpu offlining logic is added.. */ -} - -static int __devinit kstat_cpu_notify(struct notifier_block *self, - unsigned long action, void *hcpu) -{ - int cpu = (unsigned long)hcpu; - switch(action) { - case CPU_UP_PREPARE: - kstat_init_cpu(cpu); - break; - default: - break; - } - return NOTIFY_OK; -} - -static struct notifier_block __devinitdata kstat_nb = { - .notifier_call = kstat_cpu_notify, - .next = NULL, -}; - -static void __init init_kstat(void) -{ - kstat_cpu_notify(&kstat_nb, (unsigned long)CPU_UP_PREPARE, - (void *)(long)smp_processor_id()); - register_cpu_notifier(&kstat_nb); -} - #ifdef CONFIG_SMP #ifdef ARCH_HAS_SCHED_DOMAIN extern void __init arch_init_sched_domains(void); @@ -3416,8 +3384,6 @@ void __init sched_init(void) runqueue_t *rq; int i, j, k; - /* Init the kstat counters */ - init_kstat(); for (i = 0; i < NR_CPUS; i++) { prio_array_t *array; #ifdef CONFIG_SMP _