Skip to contentSkip to conversation

s390: earlier initialization of cpu_possible_map

PATCH In review Heiko Carstens 2 participants 2 messages Feb 8, 2006 s390

lore
Share & tools
lore
#0 lore raw

PATCH 3/10 s390: earlier initialization of cpu_possible_map

From: Heiko Carstens <[email protected]>

Initiliazing of cpu_possible_map was done in smp_prepare_cpus which is way too late. Therefore assign a static value to cpu_possible_map, since we don't have access to max_cpus in setup_arch.

---

 arch/s390/kernel/smp.c |    6 +-----
 1 files changed, 1 insertion(+), 5 deletions(-)
arch/s390/kernel/smp.c +1 -5
diff -urpN linux-2.6/arch/s390/kernel/smp.c linux-2.6-patched/arch/s390/kernel/smp.c
@@ -52,7 +52,7 @@ extern volatile int __cpu_logical_map[];
 struct _lowcore *lowcore_ptr[NR_CPUS];
 
 cpumask_t cpu_online_map;
-cpumask_t cpu_possible_map;
+cpumask_t cpu_possible_map = CPU_MASK_ALL;
 
 static struct task_struct *current_set[NR_CPUS];
 
@@ -514,9 +514,6 @@ __init smp_check_cpus(unsigned int max_c
 		num_cpus++;
 	}
 
-	for (cpu = 1; cpu < max_cpus; cpu++)
-		cpu_set(cpu, cpu_possible_map);
-
 	printk("Detected %d CPU's\n",(int) num_cpus);
 	printk("Boot cpu address %2X\n", boot_cpu_addr);
 }
@@ -810,7 +807,6 @@ void __devinit smp_prepare_boot_cpu(void
 
 	cpu_set(0, cpu_online_map);
 	cpu_set(0, cpu_present_map);
-	cpu_set(0, cpu_possible_map);
 	S390_lowcore.percpu_offset = __per_cpu_offset[0];
 	current_set[0] = current;
 }
#1 lore raw
Quoted 5 lines · Heiko Carstens

From: Heiko Carstens <[email protected]>

Initiliazing of cpu_possible_map was done in smp_prepare_cpus which is way too late. Therefore assign a static value to cpu_possible_map, since we don't have access to max_cpus in setup_arch.

With this and Ivan's alpha fix, it should now be safe to use for_each_cpu() in vfs_caches_init() path as done by the merged patch from Eric. I have done a quick check and couldn't find any other late initialization of cpu_possible_map, but arch maintainers probably can say for sure.

Thanks
Dipankar