Messages in this thread Patch in this message | | | From | Rusty Russell <> | Subject | [PATCH] Remove kstat.c CPU notifiers | Date | Sat, 24 Jan 2004 23:14:18 +1100 |
| |
Hi Andrew,
Another cleanup extracted from the hotplug CPU patch.
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.
Name: Remove kstat CPU Notifier Author: Rusty Russell Status: Trivial
D: Some well-meaning person put a notifier in for CPUs to update the D: kstat structures in sched.c. However, it does nothing, and even D: with the full hotplug CPU patch, it still does nothing. D: D: Simple counters very rarely need anything done when CPUs come up D: or go down. If you have per-cpu caches, or per-cpu threads, you D: need to do something. But very rarely for stats.
diff -urpN --exclude TAGS -X /home/rusty/devel/kernel/kernel-patches/current-dontdiff --minimal .31530-linux-2.6.1-bk6/kernel/sched.c .31530-linux-2.6.1-bk6.updated/kernel/sched.c --- .31530-linux-2.6.1-bk6/kernel/sched.c 2004-01-21 10:02:33.000000000 +1100 +++ .31530-linux-2.6.1-bk6.updated/kernel/sched.c 2004-01-21 10:07:44.000000000 +1100 @@ -2848,45 +2999,11 @@ spinlock_t kernel_flag __cacheline_align EXPORT_SYMBOL(kernel_flag); #endif -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, -}; - -__init static void init_kstat(void) -{ - kstat_cpu_notify(&kstat_nb, (unsigned long)CPU_UP_PREPARE, - (void *)(long)smp_processor_id()); - register_cpu_notifier(&kstat_nb); -} - 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; -- Anyone who quotes me in their sig is an idiot. -- Rusty Russell. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |