aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-23 23:44:19 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-23 23:44:19 -0500
commit1ebbe2b20091d306453a5cf480a87e6cd28ae76f (patch)
treef5cd7a0fa69b8b1938cb5a0faed2e7b0628072a5 /init
parentac58c9059da8886b5e8cde012a80266b18ca146e (diff)
parent674a396c6d2ba0341ebdd7c1c9950f32f018e2dd (diff)
Merge branch 'linus'
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig11
-rw-r--r--init/do_mounts_initrd.c1
-rw-r--r--init/main.c26
3 files changed, 28 insertions, 10 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 38416a199def..1d19fd25204b 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -214,6 +214,17 @@ config CPUSETS
214 214
215 Say N if unsure. 215 Say N if unsure.
216 216
217config RELAY
218 bool "Kernel->user space relay support (formerly relayfs)"
219 help
220 This option enables support for relay interface support in
221 certain file systems (such as debugfs).
222 It is designed to provide an efficient mechanism for tools and
223 facilities to relay large amounts of data from kernel space to
224 user space.
225
226 If unsure, say N.
227
217source "usr/Kconfig" 228source "usr/Kconfig"
218 229
219config UID16 230config UID16
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
328unsigned long __per_cpu_offset[NR_CPUS]; 328unsigned long __per_cpu_offset[NR_CPUS] __read_mostly;
329 329
330EXPORT_SYMBOL(__per_cpu_offset); 330EXPORT_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
442static 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
441asmlinkage void __init start_kernel(void) 451asmlinkage 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