Commit 35651c8c authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Remove kstat cpu notifiers

From: Rusty Russell <rusty@rustcorp.com.au>

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.
parent 933ba102
...@@ -2850,45 +2850,11 @@ __init int migration_init(void) ...@@ -2850,45 +2850,11 @@ __init int migration_init(void)
spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED; spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
EXPORT_SYMBOL(kernel_flag); 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,
};
__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) void __init sched_init(void)
{ {
runqueue_t *rq; runqueue_t *rq;
int i, j, k; int i, j, k;
/* Init the kstat counters */
init_kstat();
for (i = 0; i < NR_CPUS; i++) { for (i = 0; i < NR_CPUS; i++) {
prio_array_t *array; prio_array_t *array;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment