diff options
Diffstat (limited to 'init')
-rw-r--r-- | init/do_mounts_initrd.c | 1 | ||||
-rw-r--r-- | init/main.c | 26 |
2 files changed, 17 insertions, 10 deletions
diff --git a/init/do_mounts_initrd.c b/init/do_mounts_initrd.c index a05cabd0fd10..405f9031af87 100644 --- a/init/do_mounts_initrd.c +++ b/init/do_mounts_initrd.c | |||
@@ -56,6 +56,7 @@ static void __init handle_initrd(void) | |||
56 | sys_chroot("."); | 56 | sys_chroot("."); |
57 | mount_devfs_fs (); | 57 | mount_devfs_fs (); |
58 | 58 | ||
59 | current->flags |= PF_NOFREEZE; | ||
59 | pid = kernel_thread(do_linuxrc, "/linuxrc", SIGCHLD); | 60 | pid = kernel_thread(do_linuxrc, "/linuxrc", SIGCHLD); |
60 | if (pid > 0) { | 61 | if (pid > 0) { |
61 | while (pid != sys_wait4(-1, NULL, 0, NULL)) | 62 | while (pid != sys_wait4(-1, NULL, 0, NULL)) |
diff --git a/init/main.c b/init/main.c index 4c194c47395f..2714e0e7cfec 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -325,7 +325,7 @@ static inline void smp_prepare_cpus(unsigned int maxcpus) { } | |||
325 | #else | 325 | #else |
326 | 326 | ||
327 | #ifdef __GENERIC_PER_CPU | 327 | #ifdef __GENERIC_PER_CPU |
328 | unsigned long __per_cpu_offset[NR_CPUS]; | 328 | unsigned long __per_cpu_offset[NR_CPUS] __read_mostly; |
329 | 329 | ||
330 | EXPORT_SYMBOL(__per_cpu_offset); | 330 | EXPORT_SYMBOL(__per_cpu_offset); |
331 | 331 | ||
@@ -333,6 +333,7 @@ static void __init setup_per_cpu_areas(void) | |||
333 | { | 333 | { |
334 | unsigned long size, i; | 334 | unsigned long size, i; |
335 | char *ptr; | 335 | char *ptr; |
336 | unsigned long nr_possible_cpus = num_possible_cpus(); | ||
336 | 337 | ||
337 | /* Copy section for each CPU (we discard the original) */ | 338 | /* Copy section for each CPU (we discard the original) */ |
338 | size = ALIGN(__per_cpu_end - __per_cpu_start, SMP_CACHE_BYTES); | 339 | size = ALIGN(__per_cpu_end - __per_cpu_start, SMP_CACHE_BYTES); |
@@ -340,12 +341,12 @@ static void __init setup_per_cpu_areas(void) | |||
340 | if (size < PERCPU_ENOUGH_ROOM) | 341 | if (size < PERCPU_ENOUGH_ROOM) |
341 | size = PERCPU_ENOUGH_ROOM; | 342 | size = PERCPU_ENOUGH_ROOM; |
342 | #endif | 343 | #endif |
344 | ptr = alloc_bootmem(size * nr_possible_cpus); | ||
343 | 345 | ||
344 | ptr = alloc_bootmem(size * NR_CPUS); | 346 | for_each_cpu(i) { |
345 | |||
346 | for (i = 0; i < NR_CPUS; i++, ptr += size) { | ||
347 | __per_cpu_offset[i] = ptr - __per_cpu_start; | 347 | __per_cpu_offset[i] = ptr - __per_cpu_start; |
348 | memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start); | 348 | memcpy(ptr, __per_cpu_start, __per_cpu_end - __per_cpu_start); |
349 | ptr += size; | ||
349 | } | 350 | } |
350 | } | 351 | } |
351 | #endif /* !__GENERIC_PER_CPU */ | 352 | #endif /* !__GENERIC_PER_CPU */ |
@@ -438,6 +439,15 @@ void __init parse_early_param(void) | |||
438 | * Activate the first processor. | 439 | * Activate the first processor. |
439 | */ | 440 | */ |
440 | 441 | ||
442 | static void __init boot_cpu_init(void) | ||
443 | { | ||
444 | int cpu = smp_processor_id(); | ||
445 | /* Mark the boot cpu "present", "online" etc for SMP and UP case */ | ||
446 | cpu_set(cpu, cpu_online_map); | ||
447 | cpu_set(cpu, cpu_present_map); | ||
448 | cpu_set(cpu, cpu_possible_map); | ||
449 | } | ||
450 | |||
441 | asmlinkage void __init start_kernel(void) | 451 | asmlinkage void __init start_kernel(void) |
442 | { | 452 | { |
443 | char * command_line; | 453 | char * command_line; |
@@ -447,17 +457,13 @@ asmlinkage void __init start_kernel(void) | |||
447 | * enable them | 457 | * enable them |
448 | */ | 458 | */ |
449 | lock_kernel(); | 459 | lock_kernel(); |
460 | boot_cpu_init(); | ||
450 | page_address_init(); | 461 | page_address_init(); |
451 | printk(KERN_NOTICE); | 462 | printk(KERN_NOTICE); |
452 | printk(linux_banner); | 463 | printk(linux_banner); |
453 | setup_arch(&command_line); | 464 | setup_arch(&command_line); |
454 | setup_per_cpu_areas(); | 465 | setup_per_cpu_areas(); |
455 | 466 | smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */ | |
456 | /* | ||
457 | * Mark the boot cpu "online" so that it can call console drivers in | ||
458 | * printk() and can access its per-cpu storage. | ||
459 | */ | ||
460 | smp_prepare_boot_cpu(); | ||
461 | 467 | ||
462 | /* | 468 | /* |
463 | * Set up the scheduler prior starting any interrupts (such as the | 469 | * Set up the scheduler prior starting any interrupts (such as the |