diff options
author | Ivan Kokshaysky <ink@jurassic.park.msu.ru> | 2006-02-08 03:55:06 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-02-08 10:57:37 -0500 |
commit | 328c2a8a39e1ba43a6e54e43fc752f7035779561 (patch) | |
tree | 4d59799c3208fe2c08ceb0faad7a6f3db0e975df /arch | |
parent | 9934a7939e1cdce62ece9ef7d25ebb3c55547fac (diff) |
[PATCH] alpha: set cpu_possible_map much earlier
All the percpu data structure walkers want cpu_possible_map to be
initialized early, but alpha instead populated "hwrpb_cpu_present_mask"
early in setup_smp(), and then initialized cpu_possible_map only much
later.
Thanks go to Heiko Carstens and Dipankar Sarma for noticing.
This fixes it and we can get rid of hwrpb_cpu_present_mask entirely.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/alpha/kernel/smp.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c index 4b873527ce1c..02c2db08114a 100644 --- a/arch/alpha/kernel/smp.c +++ b/arch/alpha/kernel/smp.c | |||
@@ -73,9 +73,6 @@ cpumask_t cpu_online_map; | |||
73 | 73 | ||
74 | EXPORT_SYMBOL(cpu_online_map); | 74 | EXPORT_SYMBOL(cpu_online_map); |
75 | 75 | ||
76 | /* cpus reported in the hwrpb */ | ||
77 | static unsigned long hwrpb_cpu_present_mask __initdata = 0; | ||
78 | |||
79 | int smp_num_probed; /* Internal processor count */ | 76 | int smp_num_probed; /* Internal processor count */ |
80 | int smp_num_cpus = 1; /* Number that came online. */ | 77 | int smp_num_cpus = 1; /* Number that came online. */ |
81 | 78 | ||
@@ -442,7 +439,7 @@ setup_smp(void) | |||
442 | if ((cpu->flags & 0x1cc) == 0x1cc) { | 439 | if ((cpu->flags & 0x1cc) == 0x1cc) { |
443 | smp_num_probed++; | 440 | smp_num_probed++; |
444 | /* Assume here that "whami" == index */ | 441 | /* Assume here that "whami" == index */ |
445 | hwrpb_cpu_present_mask |= (1UL << i); | 442 | cpu_set(i, cpu_possible_map); |
446 | cpu->pal_revision = boot_cpu_palrev; | 443 | cpu->pal_revision = boot_cpu_palrev; |
447 | } | 444 | } |
448 | 445 | ||
@@ -453,12 +450,12 @@ setup_smp(void) | |||
453 | } | 450 | } |
454 | } else { | 451 | } else { |
455 | smp_num_probed = 1; | 452 | smp_num_probed = 1; |
456 | hwrpb_cpu_present_mask = (1UL << boot_cpuid); | 453 | cpu_set(boot_cpuid, cpu_possible_map); |
457 | } | 454 | } |
458 | cpu_present_mask = cpumask_of_cpu(boot_cpuid); | 455 | cpu_present_mask = cpumask_of_cpu(boot_cpuid); |
459 | 456 | ||
460 | printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_mask = %lx\n", | 457 | printk(KERN_INFO "SMP: %d CPUs probed -- cpu_present_mask = %lx\n", |
461 | smp_num_probed, hwrpb_cpu_present_mask); | 458 | smp_num_probed, cpu_possible_map.bits[0]); |
462 | } | 459 | } |
463 | 460 | ||
464 | /* | 461 | /* |
@@ -467,8 +464,6 @@ setup_smp(void) | |||
467 | void __init | 464 | void __init |
468 | smp_prepare_cpus(unsigned int max_cpus) | 465 | smp_prepare_cpus(unsigned int max_cpus) |
469 | { | 466 | { |
470 | int cpu_count, i; | ||
471 | |||
472 | /* Take care of some initial bookkeeping. */ | 467 | /* Take care of some initial bookkeeping. */ |
473 | memset(ipi_data, 0, sizeof(ipi_data)); | 468 | memset(ipi_data, 0, sizeof(ipi_data)); |
474 | 469 | ||
@@ -486,19 +481,7 @@ smp_prepare_cpus(unsigned int max_cpus) | |||
486 | 481 | ||
487 | printk(KERN_INFO "SMP starting up secondaries.\n"); | 482 | printk(KERN_INFO "SMP starting up secondaries.\n"); |
488 | 483 | ||
489 | cpu_count = 1; | 484 | smp_num_cpus = smp_num_probed; |
490 | for (i = 0; (i < NR_CPUS) && (cpu_count < max_cpus); i++) { | ||
491 | if (i == boot_cpuid) | ||
492 | continue; | ||
493 | |||
494 | if (((hwrpb_cpu_present_mask >> i) & 1) == 0) | ||
495 | continue; | ||
496 | |||
497 | cpu_set(i, cpu_possible_map); | ||
498 | cpu_count++; | ||
499 | } | ||
500 | |||
501 | smp_num_cpus = cpu_count; | ||
502 | } | 485 | } |
503 | 486 | ||
504 | void __devinit | 487 | void __devinit |