Don't alter the nr_cpu_ids value used outside the scheduler. -ck --- kernel/sched/bfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Index: linux-3.15-ck1/kernel/sched/bfs.c =================================================================== --- linux-3.15-ck1.orig/kernel/sched/bfs.c 2014-07-03 23:13:25.558679430 +0300 +++ linux-3.15-ck1/kernel/sched/bfs.c 2014-07-09 00:32:35.808654895 +0300 @@ -6814,7 +6814,7 @@ void __init sched_init(void) { - int i; + int i, cpu_ids; struct rq *rq; prio_ratios[0] = 128; @@ -6854,7 +6854,7 @@ } #ifdef CONFIG_SMP - nr_cpu_ids = i; + cpu_ids = i; /* * Set the base locality for cpu cache distance calculation to * "distant" (3). Make sure the distance from a CPU to itself is 0. @@ -6869,7 +6869,7 @@ #ifdef CONFIG_SCHED_MC rq->cache_idle = sole_cpu_idle; #endif - rq->cpu_locality = kmalloc(nr_cpu_ids * sizeof(int *), GFP_ATOMIC); + rq->cpu_locality = kmalloc(cpu_ids * sizeof(int *), GFP_ATOMIC); for_each_possible_cpu(j) { if (i == j) rq->cpu_locality[j] = 0;