diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-01-18 12:37:14 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-18 12:37:14 -0500 |
commit | b2b062b8163391c42b3219d466ca1ac9742b9c7b (patch) | |
tree | f3f920c09b8de694b1bc1d4b878cfd2b0b98c913 /init | |
parent | a9de18eb761f7c1c860964b2e5addc1a35c7e861 (diff) | |
parent | 99937d6455cea95405ac681c86a857d0fcd530bd (diff) |
Merge branch 'core/percpu' into stackprotector
Conflicts:
arch/x86/include/asm/pda.h
arch/x86/include/asm/system.h
Also, moved include/asm-x86/stackprotector.h to arch/x86/include/asm.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'init')
-rw-r--r-- | init/Kconfig | 205 | ||||
-rw-r--r-- | init/do_mounts.c | 6 | ||||
-rw-r--r-- | init/do_mounts_md.c | 2 | ||||
-rw-r--r-- | init/do_mounts_rd.c | 14 | ||||
-rw-r--r-- | init/initramfs.c | 1 | ||||
-rw-r--r-- | init/main.c | 48 |
6 files changed, 154 insertions, 122 deletions
diff --git a/init/Kconfig b/init/Kconfig index 13627191a60d..a724a149bf3f 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -271,59 +271,6 @@ config LOG_BUF_SHIFT | |||
271 | 13 => 8 KB | 271 | 13 => 8 KB |
272 | 12 => 4 KB | 272 | 12 => 4 KB |
273 | 273 | ||
274 | config CGROUPS | ||
275 | bool "Control Group support" | ||
276 | help | ||
277 | This option will let you use process cgroup subsystems | ||
278 | such as Cpusets | ||
279 | |||
280 | Say N if unsure. | ||
281 | |||
282 | config CGROUP_DEBUG | ||
283 | bool "Example debug cgroup subsystem" | ||
284 | depends on CGROUPS | ||
285 | default n | ||
286 | help | ||
287 | This option enables a simple cgroup subsystem that | ||
288 | exports useful debugging information about the cgroups | ||
289 | framework | ||
290 | |||
291 | Say N if unsure | ||
292 | |||
293 | config CGROUP_NS | ||
294 | bool "Namespace cgroup subsystem" | ||
295 | depends on CGROUPS | ||
296 | help | ||
297 | Provides a simple namespace cgroup subsystem to | ||
298 | provide hierarchical naming of sets of namespaces, | ||
299 | for instance virtual servers and checkpoint/restart | ||
300 | jobs. | ||
301 | |||
302 | config CGROUP_FREEZER | ||
303 | bool "control group freezer subsystem" | ||
304 | depends on CGROUPS | ||
305 | help | ||
306 | Provides a way to freeze and unfreeze all tasks in a | ||
307 | cgroup. | ||
308 | |||
309 | config CGROUP_DEVICE | ||
310 | bool "Device controller for cgroups" | ||
311 | depends on CGROUPS && EXPERIMENTAL | ||
312 | help | ||
313 | Provides a cgroup implementing whitelists for devices which | ||
314 | a process in the cgroup can mknod or open. | ||
315 | |||
316 | config CPUSETS | ||
317 | bool "Cpuset support" | ||
318 | depends on SMP && CGROUPS | ||
319 | help | ||
320 | This option will let you create and manage CPUSETs which | ||
321 | allow dynamically partitioning a system into sets of CPUs and | ||
322 | Memory Nodes and assigning tasks to run only within those sets. | ||
323 | This is primarily useful on large SMP or NUMA systems. | ||
324 | |||
325 | Say N if unsure. | ||
326 | |||
327 | # | 274 | # |
328 | # Architectures with an unreliable sched_clock() should select this: | 275 | # Architectures with an unreliable sched_clock() should select this: |
329 | # | 276 | # |
@@ -337,6 +284,8 @@ config GROUP_SCHED | |||
337 | help | 284 | help |
338 | This feature lets CPU scheduler recognize task groups and control CPU | 285 | This feature lets CPU scheduler recognize task groups and control CPU |
339 | bandwidth allocation to such task groups. | 286 | bandwidth allocation to such task groups. |
287 | In order to create a group from arbitrary set of processes, use | ||
288 | CONFIG_CGROUPS. (See Control Group support.) | ||
340 | 289 | ||
341 | config FAIR_GROUP_SCHED | 290 | config FAIR_GROUP_SCHED |
342 | bool "Group scheduling for SCHED_OTHER" | 291 | bool "Group scheduling for SCHED_OTHER" |
@@ -379,6 +328,66 @@ config CGROUP_SCHED | |||
379 | 328 | ||
380 | endchoice | 329 | endchoice |
381 | 330 | ||
331 | menu "Control Group support" | ||
332 | config CGROUPS | ||
333 | bool "Control Group support" | ||
334 | help | ||
335 | This option add support for grouping sets of processes together, for | ||
336 | use with process control subsystems such as Cpusets, CFS, memory | ||
337 | controls or device isolation. | ||
338 | See | ||
339 | - Documentation/cpusets.txt (Cpusets) | ||
340 | - Documentation/scheduler/sched-design-CFS.txt (CFS) | ||
341 | - Documentation/cgroups/ (features for grouping, isolation) | ||
342 | - Documentation/controllers/ (features for resource control) | ||
343 | |||
344 | Say N if unsure. | ||
345 | |||
346 | config CGROUP_DEBUG | ||
347 | bool "Example debug cgroup subsystem" | ||
348 | depends on CGROUPS | ||
349 | default n | ||
350 | help | ||
351 | This option enables a simple cgroup subsystem that | ||
352 | exports useful debugging information about the cgroups | ||
353 | framework | ||
354 | |||
355 | Say N if unsure | ||
356 | |||
357 | config CGROUP_NS | ||
358 | bool "Namespace cgroup subsystem" | ||
359 | depends on CGROUPS | ||
360 | help | ||
361 | Provides a simple namespace cgroup subsystem to | ||
362 | provide hierarchical naming of sets of namespaces, | ||
363 | for instance virtual servers and checkpoint/restart | ||
364 | jobs. | ||
365 | |||
366 | config CGROUP_FREEZER | ||
367 | bool "control group freezer subsystem" | ||
368 | depends on CGROUPS | ||
369 | help | ||
370 | Provides a way to freeze and unfreeze all tasks in a | ||
371 | cgroup. | ||
372 | |||
373 | config CGROUP_DEVICE | ||
374 | bool "Device controller for cgroups" | ||
375 | depends on CGROUPS && EXPERIMENTAL | ||
376 | help | ||
377 | Provides a cgroup implementing whitelists for devices which | ||
378 | a process in the cgroup can mknod or open. | ||
379 | |||
380 | config CPUSETS | ||
381 | bool "Cpuset support" | ||
382 | depends on SMP && CGROUPS | ||
383 | help | ||
384 | This option will let you create and manage CPUSETs which | ||
385 | allow dynamically partitioning a system into sets of CPUs and | ||
386 | Memory Nodes and assigning tasks to run only within those sets. | ||
387 | This is primarily useful on large SMP or NUMA systems. | ||
388 | |||
389 | Say N if unsure. | ||
390 | |||
382 | config CGROUP_CPUACCT | 391 | config CGROUP_CPUACCT |
383 | bool "Simple CPU accounting cgroup subsystem" | 392 | bool "Simple CPU accounting cgroup subsystem" |
384 | depends on CGROUPS | 393 | depends on CGROUPS |
@@ -393,9 +402,6 @@ config RESOURCE_COUNTERS | |||
393 | infrastructure that works with cgroups | 402 | infrastructure that works with cgroups |
394 | depends on CGROUPS | 403 | depends on CGROUPS |
395 | 404 | ||
396 | config MM_OWNER | ||
397 | bool | ||
398 | |||
399 | config CGROUP_MEM_RES_CTLR | 405 | config CGROUP_MEM_RES_CTLR |
400 | bool "Memory Resource Controller for Control Groups" | 406 | bool "Memory Resource Controller for Control Groups" |
401 | depends on CGROUPS && RESOURCE_COUNTERS | 407 | depends on CGROUPS && RESOURCE_COUNTERS |
@@ -414,36 +420,68 @@ config CGROUP_MEM_RES_CTLR | |||
414 | sure you need the memory resource controller. Even when you enable | 420 | sure you need the memory resource controller. Even when you enable |
415 | this, you can set "cgroup_disable=memory" at your boot option to | 421 | this, you can set "cgroup_disable=memory" at your boot option to |
416 | disable memory resource controller and you can avoid overheads. | 422 | disable memory resource controller and you can avoid overheads. |
417 | (and lose benefits of memory resource contoller) | 423 | (and lose benefits of memory resource controller) |
418 | 424 | ||
419 | This config option also selects MM_OWNER config option, which | 425 | This config option also selects MM_OWNER config option, which |
420 | could in turn add some fork/exit overhead. | 426 | could in turn add some fork/exit overhead. |
421 | 427 | ||
428 | config MM_OWNER | ||
429 | bool | ||
430 | |||
431 | config CGROUP_MEM_RES_CTLR_SWAP | ||
432 | bool "Memory Resource Controller Swap Extension(EXPERIMENTAL)" | ||
433 | depends on CGROUP_MEM_RES_CTLR && SWAP && EXPERIMENTAL | ||
434 | help | ||
435 | Add swap management feature to memory resource controller. When you | ||
436 | enable this, you can limit mem+swap usage per cgroup. In other words, | ||
437 | when you disable this, memory resource controller has no cares to | ||
438 | usage of swap...a process can exhaust all of the swap. This extension | ||
439 | is useful when you want to avoid exhaustion swap but this itself | ||
440 | adds more overheads and consumes memory for remembering information. | ||
441 | Especially if you use 32bit system or small memory system, please | ||
442 | be careful about enabling this. When memory resource controller | ||
443 | is disabled by boot option, this will be automatically disabled and | ||
444 | there will be no overhead from this. Even when you set this config=y, | ||
445 | if boot option "noswapaccount" is set, swap will not be accounted. | ||
446 | |||
447 | |||
448 | endmenu | ||
449 | |||
422 | config SYSFS_DEPRECATED | 450 | config SYSFS_DEPRECATED |
423 | bool | 451 | bool |
424 | 452 | ||
425 | config SYSFS_DEPRECATED_V2 | 453 | config SYSFS_DEPRECATED_V2 |
426 | bool "Create deprecated sysfs files" | 454 | bool "Create deprecated sysfs layout for older userspace tools" |
427 | depends on SYSFS | 455 | depends on SYSFS |
428 | default y | 456 | default y |
429 | select SYSFS_DEPRECATED | 457 | select SYSFS_DEPRECATED |
430 | help | 458 | help |
431 | This option creates deprecated symlinks such as the | 459 | This option switches the layout of sysfs to the deprecated |
432 | "device"-link, the <subsystem>:<name>-link, and the | 460 | version. |
433 | "bus"-link. It may also add deprecated key in the | 461 | |
434 | uevent environment. | 462 | The current sysfs layout features a unified device tree at |
435 | None of these features or values should be used today, as | 463 | /sys/devices/, which is able to express a hierarchy between |
436 | they export driver core implementation details to userspace | 464 | class devices. If the deprecated option is set to Y, the |
437 | or export properties which can't be kept stable across kernel | 465 | unified device tree is split into a bus device tree at |
438 | releases. | 466 | /sys/devices/ and several individual class device trees at |
439 | 467 | /sys/class/. The class and bus devices will be connected by | |
440 | If enabled, this option will also move any device structures | 468 | "<subsystem>:<name>" and the "device" links. The "block" |
441 | that belong to a class, back into the /sys/class hierarchy, in | 469 | class devices, will not show up in /sys/class/block/. Some |
442 | order to support older versions of udev and some userspace | 470 | subsystems will suppress the creation of some devices which |
443 | programs. | 471 | depend on the unified device tree. |
444 | 472 | ||
445 | If you are using a distro with the most recent userspace | 473 | This option is not a pure compatibility option that can |
446 | packages, it should be safe to say N here. | 474 | be safely enabled on newer distributions. It will change the |
475 | layout of sysfs to the non-extensible deprecated version, | ||
476 | and disable some features, which can not be exported without | ||
477 | confusing older userspace tools. Since 2007/2008 all major | ||
478 | distributions do not enable this option, and ship no tools which | ||
479 | depend on the deprecated layout or this option. | ||
480 | |||
481 | If you are using a new kernel on an older distribution, or use | ||
482 | older userspace tools, you might need to say Y here. Do not say Y, | ||
483 | if the original kernel, that came with your distribution, has | ||
484 | this option set to N. | ||
447 | 485 | ||
448 | config PROC_PID_CPUSET | 486 | config PROC_PID_CPUSET |
449 | bool "Include legacy /proc/<pid>/cpuset file" | 487 | bool "Include legacy /proc/<pid>/cpuset file" |
@@ -838,10 +876,6 @@ config RT_MUTEXES | |||
838 | boolean | 876 | boolean |
839 | select PLIST | 877 | select PLIST |
840 | 878 | ||
841 | config TINY_SHMEM | ||
842 | default !SHMEM | ||
843 | bool | ||
844 | |||
845 | config BASE_SMALL | 879 | config BASE_SMALL |
846 | int | 880 | int |
847 | default 0 if BASE_FULL | 881 | default 0 if BASE_FULL |
@@ -916,14 +950,17 @@ config MODULE_SRCVERSION_ALL | |||
916 | the version). With this option, such a "srcversion" field | 950 | the version). With this option, such a "srcversion" field |
917 | will be created for all modules. If unsure, say N. | 951 | will be created for all modules. If unsure, say N. |
918 | 952 | ||
919 | config KMOD | ||
920 | def_bool y | ||
921 | help | ||
922 | This is being removed soon. These days, CONFIG_MODULES | ||
923 | implies CONFIG_KMOD, so use that instead. | ||
924 | |||
925 | endif # MODULES | 953 | endif # MODULES |
926 | 954 | ||
955 | config INIT_ALL_POSSIBLE | ||
956 | bool | ||
957 | help | ||
958 | Back when each arch used to define their own cpu_online_map and | ||
959 | cpu_possible_map, some of them chose to initialize cpu_possible_map | ||
960 | with all 1s, and others with all 0s. When they were centralised, | ||
961 | it was better to provide this option than to break all the archs | ||
962 | and have several arch maintainers persuing me down dark alleys. | ||
963 | |||
927 | config STOP_MACHINE | 964 | config STOP_MACHINE |
928 | bool | 965 | bool |
929 | default y | 966 | default y |
diff --git a/init/do_mounts.c b/init/do_mounts.c index d055b1914c3d..708105e163df 100644 --- a/init/do_mounts.c +++ b/init/do_mounts.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/init.h> | 13 | #include <linux/init.h> |
14 | #include <linux/fs.h> | 14 | #include <linux/fs.h> |
15 | #include <linux/initrd.h> | 15 | #include <linux/initrd.h> |
16 | #include <linux/async.h> | ||
16 | 17 | ||
17 | #include <linux/nfs_fs.h> | 18 | #include <linux/nfs_fs.h> |
18 | #include <linux/nfs_fs_sb.h> | 19 | #include <linux/nfs_fs_sb.h> |
@@ -220,10 +221,10 @@ static int __init do_mount_root(char *name, char *fs, int flags, void *data) | |||
220 | 221 | ||
221 | sys_chdir("/root"); | 222 | sys_chdir("/root"); |
222 | ROOT_DEV = current->fs->pwd.mnt->mnt_sb->s_dev; | 223 | ROOT_DEV = current->fs->pwd.mnt->mnt_sb->s_dev; |
223 | printk("VFS: Mounted root (%s filesystem)%s.\n", | 224 | printk("VFS: Mounted root (%s filesystem)%s on device %u:%u.\n", |
224 | current->fs->pwd.mnt->mnt_sb->s_type->name, | 225 | current->fs->pwd.mnt->mnt_sb->s_type->name, |
225 | current->fs->pwd.mnt->mnt_sb->s_flags & MS_RDONLY ? | 226 | current->fs->pwd.mnt->mnt_sb->s_flags & MS_RDONLY ? |
226 | " readonly" : ""); | 227 | " readonly" : "", MAJOR(ROOT_DEV), MINOR(ROOT_DEV)); |
227 | return 0; | 228 | return 0; |
228 | } | 229 | } |
229 | 230 | ||
@@ -372,6 +373,7 @@ void __init prepare_namespace(void) | |||
372 | /* wait for the known devices to complete their probing */ | 373 | /* wait for the known devices to complete their probing */ |
373 | while (driver_probe_done() != 0) | 374 | while (driver_probe_done() != 0) |
374 | msleep(100); | 375 | msleep(100); |
376 | async_synchronize_full(); | ||
375 | 377 | ||
376 | md_run_setup(); | 378 | md_run_setup(); |
377 | 379 | ||
diff --git a/init/do_mounts_md.c b/init/do_mounts_md.c index d6da5cdd3c38..ff95e3192884 100644 --- a/init/do_mounts_md.c +++ b/init/do_mounts_md.c | |||
@@ -271,7 +271,7 @@ static int __init raid_setup(char *str) | |||
271 | __setup("raid=", raid_setup); | 271 | __setup("raid=", raid_setup); |
272 | __setup("md=", md_setup); | 272 | __setup("md=", md_setup); |
273 | 273 | ||
274 | static void autodetect_raid(void) | 274 | static void __init autodetect_raid(void) |
275 | { | 275 | { |
276 | int fd; | 276 | int fd; |
277 | 277 | ||
diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c index a7c748fa977a..0f0f0cf3ba9a 100644 --- a/init/do_mounts_rd.c +++ b/init/do_mounts_rd.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/string.h> | 9 | #include <linux/string.h> |
10 | 10 | ||
11 | #include "do_mounts.h" | 11 | #include "do_mounts.h" |
12 | #include "../fs/squashfs/squashfs_fs.h" | ||
12 | 13 | ||
13 | int __initdata rd_prompt = 1;/* 1 = prompt for RAM disk, 0 = don't prompt */ | 14 | int __initdata rd_prompt = 1;/* 1 = prompt for RAM disk, 0 = don't prompt */ |
14 | 15 | ||
@@ -41,6 +42,7 @@ static int __init crd_load(int in_fd, int out_fd); | |||
41 | * ext2 | 42 | * ext2 |
42 | * romfs | 43 | * romfs |
43 | * cramfs | 44 | * cramfs |
45 | * squashfs | ||
44 | * gzip | 46 | * gzip |
45 | */ | 47 | */ |
46 | static int __init | 48 | static int __init |
@@ -51,6 +53,7 @@ identify_ramdisk_image(int fd, int start_block) | |||
51 | struct ext2_super_block *ext2sb; | 53 | struct ext2_super_block *ext2sb; |
52 | struct romfs_super_block *romfsb; | 54 | struct romfs_super_block *romfsb; |
53 | struct cramfs_super *cramfsb; | 55 | struct cramfs_super *cramfsb; |
56 | struct squashfs_super_block *squashfsb; | ||
54 | int nblocks = -1; | 57 | int nblocks = -1; |
55 | unsigned char *buf; | 58 | unsigned char *buf; |
56 | 59 | ||
@@ -62,6 +65,7 @@ identify_ramdisk_image(int fd, int start_block) | |||
62 | ext2sb = (struct ext2_super_block *) buf; | 65 | ext2sb = (struct ext2_super_block *) buf; |
63 | romfsb = (struct romfs_super_block *) buf; | 66 | romfsb = (struct romfs_super_block *) buf; |
64 | cramfsb = (struct cramfs_super *) buf; | 67 | cramfsb = (struct cramfs_super *) buf; |
68 | squashfsb = (struct squashfs_super_block *) buf; | ||
65 | memset(buf, 0xe5, size); | 69 | memset(buf, 0xe5, size); |
66 | 70 | ||
67 | /* | 71 | /* |
@@ -99,6 +103,16 @@ identify_ramdisk_image(int fd, int start_block) | |||
99 | goto done; | 103 | goto done; |
100 | } | 104 | } |
101 | 105 | ||
106 | /* squashfs is at block zero too */ | ||
107 | if (le32_to_cpu(squashfsb->s_magic) == SQUASHFS_MAGIC) { | ||
108 | printk(KERN_NOTICE | ||
109 | "RAMDISK: squashfs filesystem found at block %d\n", | ||
110 | start_block); | ||
111 | nblocks = (le64_to_cpu(squashfsb->bytes_used) + BLOCK_SIZE - 1) | ||
112 | >> BLOCK_SIZE_BITS; | ||
113 | goto done; | ||
114 | } | ||
115 | |||
102 | /* | 116 | /* |
103 | * Read block 1 to test for minix and ext2 superblock | 117 | * Read block 1 to test for minix and ext2 superblock |
104 | */ | 118 | */ |
diff --git a/init/initramfs.c b/init/initramfs.c index 4f5ba75aaa7c..d9c941c0c3ca 100644 --- a/init/initramfs.c +++ b/init/initramfs.c | |||
@@ -317,6 +317,7 @@ static int __init do_name(void) | |||
317 | if (wfd >= 0) { | 317 | if (wfd >= 0) { |
318 | sys_fchown(wfd, uid, gid); | 318 | sys_fchown(wfd, uid, gid); |
319 | sys_fchmod(wfd, mode); | 319 | sys_fchmod(wfd, mode); |
320 | sys_ftruncate(wfd, body_len); | ||
320 | vcollected = kstrdup(collected, GFP_KERNEL); | 321 | vcollected = kstrdup(collected, GFP_KERNEL); |
321 | state = CopyFile; | 322 | state = CopyFile; |
322 | } | 323 | } |
diff --git a/init/main.c b/init/main.c index 07da4dea50c3..bfe4fb0c9842 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -51,7 +51,6 @@ | |||
51 | #include <linux/rmap.h> | 51 | #include <linux/rmap.h> |
52 | #include <linux/mempolicy.h> | 52 | #include <linux/mempolicy.h> |
53 | #include <linux/key.h> | 53 | #include <linux/key.h> |
54 | #include <linux/unwind.h> | ||
55 | #include <linux/buffer_head.h> | 54 | #include <linux/buffer_head.h> |
56 | #include <linux/page_cgroup.h> | 55 | #include <linux/page_cgroup.h> |
57 | #include <linux/debug_locks.h> | 56 | #include <linux/debug_locks.h> |
@@ -64,6 +63,7 @@ | |||
64 | #include <linux/signal.h> | 63 | #include <linux/signal.h> |
65 | #include <linux/idr.h> | 64 | #include <linux/idr.h> |
66 | #include <linux/ftrace.h> | 65 | #include <linux/ftrace.h> |
66 | #include <linux/async.h> | ||
67 | #include <trace/boot.h> | 67 | #include <trace/boot.h> |
68 | 68 | ||
69 | #include <asm/io.h> | 69 | #include <asm/io.h> |
@@ -76,15 +76,6 @@ | |||
76 | #include <asm/smp.h> | 76 | #include <asm/smp.h> |
77 | #endif | 77 | #endif |
78 | 78 | ||
79 | /* | ||
80 | * This is one of the first .c files built. Error out early if we have compiler | ||
81 | * trouble. | ||
82 | */ | ||
83 | |||
84 | #if __GNUC__ == 4 && __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ == 0 | ||
85 | #warning gcc-4.1.0 is known to miscompile the kernel. A different compiler version is recommended. | ||
86 | #endif | ||
87 | |||
88 | static int kernel_init(void *); | 79 | static int kernel_init(void *); |
89 | 80 | ||
90 | extern void init_IRQ(void); | 81 | extern void init_IRQ(void); |
@@ -118,7 +109,7 @@ EXPORT_SYMBOL(system_state); | |||
118 | 109 | ||
119 | extern void time_init(void); | 110 | extern void time_init(void); |
120 | /* Default late time init is NULL. archs can override this later. */ | 111 | /* Default late time init is NULL. archs can override this later. */ |
121 | void (*late_time_init)(void); | 112 | void (*__initdata late_time_init)(void); |
122 | extern void softirq_init(void); | 113 | extern void softirq_init(void); |
123 | 114 | ||
124 | /* Untouched command line saved by arch-specific code. */ | 115 | /* Untouched command line saved by arch-specific code. */ |
@@ -381,12 +372,7 @@ EXPORT_SYMBOL(nr_cpu_ids); | |||
381 | /* An arch may set nr_cpu_ids earlier if needed, so this would be redundant */ | 372 | /* An arch may set nr_cpu_ids earlier if needed, so this would be redundant */ |
382 | static void __init setup_nr_cpu_ids(void) | 373 | static void __init setup_nr_cpu_ids(void) |
383 | { | 374 | { |
384 | int cpu, highest_cpu = 0; | 375 | nr_cpu_ids = find_last_bit(cpumask_bits(cpu_possible_mask),NR_CPUS) + 1; |
385 | |||
386 | for_each_possible_cpu(cpu) | ||
387 | highest_cpu = cpu; | ||
388 | |||
389 | nr_cpu_ids = highest_cpu + 1; | ||
390 | } | 376 | } |
391 | 377 | ||
392 | #ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA | 378 | #ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA |
@@ -462,7 +448,7 @@ static void __init setup_command_line(char *command_line) | |||
462 | * gcc-3.4 accidentally inlines this function, so use noinline. | 448 | * gcc-3.4 accidentally inlines this function, so use noinline. |
463 | */ | 449 | */ |
464 | 450 | ||
465 | static void noinline __init_refok rest_init(void) | 451 | static noinline void __init_refok rest_init(void) |
466 | __releases(kernel_lock) | 452 | __releases(kernel_lock) |
467 | { | 453 | { |
468 | int pid; | 454 | int pid; |
@@ -528,9 +514,9 @@ static void __init boot_cpu_init(void) | |||
528 | { | 514 | { |
529 | int cpu = smp_processor_id(); | 515 | int cpu = smp_processor_id(); |
530 | /* Mark the boot cpu "present", "online" etc for SMP and UP case */ | 516 | /* Mark the boot cpu "present", "online" etc for SMP and UP case */ |
531 | cpu_set(cpu, cpu_online_map); | 517 | set_cpu_online(cpu, true); |
532 | cpu_set(cpu, cpu_present_map); | 518 | set_cpu_present(cpu, true); |
533 | cpu_set(cpu, cpu_possible_map); | 519 | set_cpu_possible(cpu, true); |
534 | } | 520 | } |
535 | 521 | ||
536 | void __init __weak smp_setup_processor_id(void) | 522 | void __init __weak smp_setup_processor_id(void) |
@@ -541,15 +527,6 @@ void __init __weak thread_info_cache_init(void) | |||
541 | { | 527 | { |
542 | } | 528 | } |
543 | 529 | ||
544 | void __init __weak arch_early_irq_init(void) | ||
545 | { | ||
546 | } | ||
547 | |||
548 | void __init __weak early_irq_init(void) | ||
549 | { | ||
550 | arch_early_irq_init(); | ||
551 | } | ||
552 | |||
553 | asmlinkage void __init start_kernel(void) | 530 | asmlinkage void __init start_kernel(void) |
554 | { | 531 | { |
555 | char * command_line; | 532 | char * command_line; |
@@ -561,7 +538,6 @@ asmlinkage void __init start_kernel(void) | |||
561 | * Need to run as early as possible, to initialize the | 538 | * Need to run as early as possible, to initialize the |
562 | * lockdep hash: | 539 | * lockdep hash: |
563 | */ | 540 | */ |
564 | unwind_init(); | ||
565 | lockdep_init(); | 541 | lockdep_init(); |
566 | debug_objects_early_init(); | 542 | debug_objects_early_init(); |
567 | 543 | ||
@@ -589,7 +565,6 @@ asmlinkage void __init start_kernel(void) | |||
589 | setup_arch(&command_line); | 565 | setup_arch(&command_line); |
590 | mm_init_owner(&init_mm, &init_task); | 566 | mm_init_owner(&init_mm, &init_task); |
591 | setup_command_line(command_line); | 567 | setup_command_line(command_line); |
592 | unwind_setup(); | ||
593 | setup_per_cpu_areas(); | 568 | setup_per_cpu_areas(); |
594 | setup_nr_cpu_ids(); | 569 | setup_nr_cpu_ids(); |
595 | smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */ | 570 | smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */ |
@@ -632,7 +607,8 @@ asmlinkage void __init start_kernel(void) | |||
632 | sched_clock_init(); | 607 | sched_clock_init(); |
633 | profile_init(); | 608 | profile_init(); |
634 | if (!irqs_disabled()) | 609 | if (!irqs_disabled()) |
635 | printk("start_kernel(): bug: interrupts were enabled early\n"); | 610 | printk(KERN_CRIT "start_kernel(): bug: interrupts were " |
611 | "enabled early\n"); | ||
636 | early_boot_irqs_on(); | 612 | early_boot_irqs_on(); |
637 | local_irq_enable(); | 613 | local_irq_enable(); |
638 | 614 | ||
@@ -717,7 +693,7 @@ asmlinkage void __init start_kernel(void) | |||
717 | rest_init(); | 693 | rest_init(); |
718 | } | 694 | } |
719 | 695 | ||
720 | static int initcall_debug; | 696 | int initcall_debug; |
721 | core_param(initcall_debug, initcall_debug, bool, 0644); | 697 | core_param(initcall_debug, initcall_debug, bool, 0644); |
722 | 698 | ||
723 | int do_one_initcall(initcall_t fn) | 699 | int do_one_initcall(initcall_t fn) |
@@ -816,8 +792,10 @@ static void run_init_process(char *init_filename) | |||
816 | /* This is a non __init function. Force it to be noinline otherwise gcc | 792 | /* This is a non __init function. Force it to be noinline otherwise gcc |
817 | * makes it inline to init() and it becomes part of init.text section | 793 | * makes it inline to init() and it becomes part of init.text section |
818 | */ | 794 | */ |
819 | static int noinline init_post(void) | 795 | static noinline int init_post(void) |
820 | { | 796 | { |
797 | /* need to finish all async __init code before freeing the memory */ | ||
798 | async_synchronize_full(); | ||
821 | free_initmem(); | 799 | free_initmem(); |
822 | unlock_kernel(); | 800 | unlock_kernel(); |
823 | mark_rodata_ro(); | 801 | mark_rodata_ro(); |