diff options
Diffstat (limited to 'init')
-rw-r--r-- | init/Kconfig | 291 | ||||
-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 | 41 |
6 files changed, 239 insertions, 116 deletions
diff --git a/init/Kconfig b/init/Kconfig index c38ae71a5e19..a588cdc274bc 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" |
@@ -868,10 +906,6 @@ config RT_MUTEXES | |||
868 | boolean | 906 | boolean |
869 | select PLIST | 907 | select PLIST |
870 | 908 | ||
871 | config TINY_SHMEM | ||
872 | default !SHMEM | ||
873 | bool | ||
874 | |||
875 | config BASE_SMALL | 909 | config BASE_SMALL |
876 | int | 910 | int |
877 | default 0 if BASE_FULL | 911 | default 0 if BASE_FULL |
@@ -946,14 +980,17 @@ config MODULE_SRCVERSION_ALL | |||
946 | the version). With this option, such a "srcversion" field | 980 | the version). With this option, such a "srcversion" field |
947 | will be created for all modules. If unsure, say N. | 981 | will be created for all modules. If unsure, say N. |
948 | 982 | ||
949 | config KMOD | ||
950 | def_bool y | ||
951 | help | ||
952 | This is being removed soon. These days, CONFIG_MODULES | ||
953 | implies CONFIG_KMOD, so use that instead. | ||
954 | |||
955 | endif # MODULES | 983 | endif # MODULES |
956 | 984 | ||
985 | config INIT_ALL_POSSIBLE | ||
986 | bool | ||
987 | help | ||
988 | Back when each arch used to define their own cpu_online_map and | ||
989 | cpu_possible_map, some of them chose to initialize cpu_possible_map | ||
990 | with all 1s, and others with all 0s. When they were centralised, | ||
991 | it was better to provide this option than to break all the archs | ||
992 | and have several arch maintainers persuing me down dark alleys. | ||
993 | |||
957 | config STOP_MACHINE | 994 | config STOP_MACHINE |
958 | bool | 995 | bool |
959 | default y | 996 | default y |
@@ -966,10 +1003,90 @@ source "block/Kconfig" | |||
966 | config PREEMPT_NOTIFIERS | 1003 | config PREEMPT_NOTIFIERS |
967 | bool | 1004 | bool |
968 | 1005 | ||
1006 | choice | ||
1007 | prompt "RCU Implementation" | ||
1008 | default CLASSIC_RCU | ||
1009 | |||
969 | config CLASSIC_RCU | 1010 | config CLASSIC_RCU |
970 | def_bool !PREEMPT_RCU | 1011 | bool "Classic RCU" |
971 | help | 1012 | help |
972 | This option selects the classic RCU implementation that is | 1013 | This option selects the classic RCU implementation that is |
973 | designed for best read-side performance on non-realtime | 1014 | designed for best read-side performance on non-realtime |
974 | systems. Classic RCU is the default. Note that the | 1015 | systems. |
975 | PREEMPT_RCU symbol is used to select/deselect this option. | 1016 | |
1017 | Select this option if you are unsure. | ||
1018 | |||
1019 | config TREE_RCU | ||
1020 | bool "Tree-based hierarchical RCU" | ||
1021 | help | ||
1022 | This option selects the RCU implementation that is | ||
1023 | designed for very large SMP system with hundreds or | ||
1024 | thousands of CPUs. | ||
1025 | |||
1026 | config PREEMPT_RCU | ||
1027 | bool "Preemptible RCU" | ||
1028 | depends on PREEMPT | ||
1029 | help | ||
1030 | This option reduces the latency of the kernel by making certain | ||
1031 | RCU sections preemptible. Normally RCU code is non-preemptible, if | ||
1032 | this option is selected then read-only RCU sections become | ||
1033 | preemptible. This helps latency, but may expose bugs due to | ||
1034 | now-naive assumptions about each RCU read-side critical section | ||
1035 | remaining on a given CPU through its execution. | ||
1036 | |||
1037 | endchoice | ||
1038 | |||
1039 | config RCU_TRACE | ||
1040 | bool "Enable tracing for RCU" | ||
1041 | depends on TREE_RCU || PREEMPT_RCU | ||
1042 | help | ||
1043 | This option provides tracing in RCU which presents stats | ||
1044 | in debugfs for debugging RCU implementation. | ||
1045 | |||
1046 | Say Y here if you want to enable RCU tracing | ||
1047 | Say N if you are unsure. | ||
1048 | |||
1049 | config RCU_FANOUT | ||
1050 | int "Tree-based hierarchical RCU fanout value" | ||
1051 | range 2 64 if 64BIT | ||
1052 | range 2 32 if !64BIT | ||
1053 | depends on TREE_RCU | ||
1054 | default 64 if 64BIT | ||
1055 | default 32 if !64BIT | ||
1056 | help | ||
1057 | This option controls the fanout of hierarchical implementations | ||
1058 | of RCU, allowing RCU to work efficiently on machines with | ||
1059 | large numbers of CPUs. This value must be at least the cube | ||
1060 | root of NR_CPUS, which allows NR_CPUS up to 32,768 for 32-bit | ||
1061 | systems and up to 262,144 for 64-bit systems. | ||
1062 | |||
1063 | Select a specific number if testing RCU itself. | ||
1064 | Take the default if unsure. | ||
1065 | |||
1066 | config RCU_FANOUT_EXACT | ||
1067 | bool "Disable tree-based hierarchical RCU auto-balancing" | ||
1068 | depends on TREE_RCU | ||
1069 | default n | ||
1070 | help | ||
1071 | This option forces use of the exact RCU_FANOUT value specified, | ||
1072 | regardless of imbalances in the hierarchy. This is useful for | ||
1073 | testing RCU itself, and might one day be useful on systems with | ||
1074 | strong NUMA behavior. | ||
1075 | |||
1076 | Without RCU_FANOUT_EXACT, the code will balance the hierarchy. | ||
1077 | |||
1078 | Say N if unsure. | ||
1079 | |||
1080 | config TREE_RCU_TRACE | ||
1081 | def_bool RCU_TRACE && TREE_RCU | ||
1082 | select DEBUG_FS | ||
1083 | help | ||
1084 | This option provides tracing for the TREE_RCU implementation, | ||
1085 | permitting Makefile to trivially select kernel/rcutree_trace.c. | ||
1086 | |||
1087 | config PREEMPT_RCU_TRACE | ||
1088 | def_bool RCU_TRACE && PREEMPT_RCU | ||
1089 | select DEBUG_FS | ||
1090 | help | ||
1091 | This option provides tracing for the PREEMPT_RCU implementation, | ||
1092 | permitting Makefile to trivially select kernel/rcupreempt_trace.c. | ||
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 17e9757bfde2..844209453c02 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -50,7 +50,6 @@ | |||
50 | #include <linux/rmap.h> | 50 | #include <linux/rmap.h> |
51 | #include <linux/mempolicy.h> | 51 | #include <linux/mempolicy.h> |
52 | #include <linux/key.h> | 52 | #include <linux/key.h> |
53 | #include <linux/unwind.h> | ||
54 | #include <linux/buffer_head.h> | 53 | #include <linux/buffer_head.h> |
55 | #include <linux/page_cgroup.h> | 54 | #include <linux/page_cgroup.h> |
56 | #include <linux/debug_locks.h> | 55 | #include <linux/debug_locks.h> |
@@ -63,6 +62,7 @@ | |||
63 | #include <linux/signal.h> | 62 | #include <linux/signal.h> |
64 | #include <linux/idr.h> | 63 | #include <linux/idr.h> |
65 | #include <linux/ftrace.h> | 64 | #include <linux/ftrace.h> |
65 | #include <linux/async.h> | ||
66 | #include <trace/boot.h> | 66 | #include <trace/boot.h> |
67 | 67 | ||
68 | #include <asm/io.h> | 68 | #include <asm/io.h> |
@@ -75,15 +75,6 @@ | |||
75 | #include <asm/smp.h> | 75 | #include <asm/smp.h> |
76 | #endif | 76 | #endif |
77 | 77 | ||
78 | /* | ||
79 | * This is one of the first .c files built. Error out early if we have compiler | ||
80 | * trouble. | ||
81 | */ | ||
82 | |||
83 | #if __GNUC__ == 4 && __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ == 0 | ||
84 | #warning gcc-4.1.0 is known to miscompile the kernel. A different compiler version is recommended. | ||
85 | #endif | ||
86 | |||
87 | static int kernel_init(void *); | 78 | static int kernel_init(void *); |
88 | 79 | ||
89 | extern void init_IRQ(void); | 80 | extern void init_IRQ(void); |
@@ -117,7 +108,7 @@ EXPORT_SYMBOL(system_state); | |||
117 | 108 | ||
118 | extern void time_init(void); | 109 | extern void time_init(void); |
119 | /* Default late time init is NULL. archs can override this later. */ | 110 | /* Default late time init is NULL. archs can override this later. */ |
120 | void (*late_time_init)(void); | 111 | void (*__initdata late_time_init)(void); |
121 | extern void softirq_init(void); | 112 | extern void softirq_init(void); |
122 | 113 | ||
123 | /* Untouched command line saved by arch-specific code. */ | 114 | /* Untouched command line saved by arch-specific code. */ |
@@ -380,12 +371,7 @@ EXPORT_SYMBOL(nr_cpu_ids); | |||
380 | /* An arch may set nr_cpu_ids earlier if needed, so this would be redundant */ | 371 | /* An arch may set nr_cpu_ids earlier if needed, so this would be redundant */ |
381 | static void __init setup_nr_cpu_ids(void) | 372 | static void __init setup_nr_cpu_ids(void) |
382 | { | 373 | { |
383 | int cpu, highest_cpu = 0; | 374 | nr_cpu_ids = find_last_bit(cpumask_bits(cpu_possible_mask),NR_CPUS) + 1; |
384 | |||
385 | for_each_possible_cpu(cpu) | ||
386 | highest_cpu = cpu; | ||
387 | |||
388 | nr_cpu_ids = highest_cpu + 1; | ||
389 | } | 375 | } |
390 | 376 | ||
391 | #ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA | 377 | #ifndef CONFIG_HAVE_SETUP_PER_CPU_AREA |
@@ -461,7 +447,7 @@ static void __init setup_command_line(char *command_line) | |||
461 | * gcc-3.4 accidentally inlines this function, so use noinline. | 447 | * gcc-3.4 accidentally inlines this function, so use noinline. |
462 | */ | 448 | */ |
463 | 449 | ||
464 | static void noinline __init_refok rest_init(void) | 450 | static noinline void __init_refok rest_init(void) |
465 | __releases(kernel_lock) | 451 | __releases(kernel_lock) |
466 | { | 452 | { |
467 | int pid; | 453 | int pid; |
@@ -527,9 +513,9 @@ static void __init boot_cpu_init(void) | |||
527 | { | 513 | { |
528 | int cpu = smp_processor_id(); | 514 | int cpu = smp_processor_id(); |
529 | /* Mark the boot cpu "present", "online" etc for SMP and UP case */ | 515 | /* Mark the boot cpu "present", "online" etc for SMP and UP case */ |
530 | cpu_set(cpu, cpu_online_map); | 516 | set_cpu_online(cpu, true); |
531 | cpu_set(cpu, cpu_present_map); | 517 | set_cpu_present(cpu, true); |
532 | cpu_set(cpu, cpu_possible_map); | 518 | set_cpu_possible(cpu, true); |
533 | } | 519 | } |
534 | 520 | ||
535 | void __init __weak smp_setup_processor_id(void) | 521 | void __init __weak smp_setup_processor_id(void) |
@@ -551,7 +537,6 @@ asmlinkage void __init start_kernel(void) | |||
551 | * Need to run as early as possible, to initialize the | 537 | * Need to run as early as possible, to initialize the |
552 | * lockdep hash: | 538 | * lockdep hash: |
553 | */ | 539 | */ |
554 | unwind_init(); | ||
555 | lockdep_init(); | 540 | lockdep_init(); |
556 | debug_objects_early_init(); | 541 | debug_objects_early_init(); |
557 | cgroup_init_early(); | 542 | cgroup_init_early(); |
@@ -573,7 +558,6 @@ asmlinkage void __init start_kernel(void) | |||
573 | setup_arch(&command_line); | 558 | setup_arch(&command_line); |
574 | mm_init_owner(&init_mm, &init_task); | 559 | mm_init_owner(&init_mm, &init_task); |
575 | setup_command_line(command_line); | 560 | setup_command_line(command_line); |
576 | unwind_setup(); | ||
577 | setup_per_cpu_areas(); | 561 | setup_per_cpu_areas(); |
578 | setup_nr_cpu_ids(); | 562 | setup_nr_cpu_ids(); |
579 | smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */ | 563 | smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */ |
@@ -604,6 +588,8 @@ asmlinkage void __init start_kernel(void) | |||
604 | sort_main_extable(); | 588 | sort_main_extable(); |
605 | trap_init(); | 589 | trap_init(); |
606 | rcu_init(); | 590 | rcu_init(); |
591 | /* init some links before init_ISA_irqs() */ | ||
592 | early_irq_init(); | ||
607 | init_IRQ(); | 593 | init_IRQ(); |
608 | pidhash_init(); | 594 | pidhash_init(); |
609 | init_timers(); | 595 | init_timers(); |
@@ -614,7 +600,8 @@ asmlinkage void __init start_kernel(void) | |||
614 | sched_clock_init(); | 600 | sched_clock_init(); |
615 | profile_init(); | 601 | profile_init(); |
616 | if (!irqs_disabled()) | 602 | if (!irqs_disabled()) |
617 | printk("start_kernel(): bug: interrupts were enabled early\n"); | 603 | printk(KERN_CRIT "start_kernel(): bug: interrupts were " |
604 | "enabled early\n"); | ||
618 | early_boot_irqs_on(); | 605 | early_boot_irqs_on(); |
619 | local_irq_enable(); | 606 | local_irq_enable(); |
620 | 607 | ||
@@ -699,7 +686,7 @@ asmlinkage void __init start_kernel(void) | |||
699 | rest_init(); | 686 | rest_init(); |
700 | } | 687 | } |
701 | 688 | ||
702 | static int initcall_debug; | 689 | int initcall_debug; |
703 | core_param(initcall_debug, initcall_debug, bool, 0644); | 690 | core_param(initcall_debug, initcall_debug, bool, 0644); |
704 | 691 | ||
705 | int do_one_initcall(initcall_t fn) | 692 | int do_one_initcall(initcall_t fn) |
@@ -798,8 +785,10 @@ static void run_init_process(char *init_filename) | |||
798 | /* This is a non __init function. Force it to be noinline otherwise gcc | 785 | /* This is a non __init function. Force it to be noinline otherwise gcc |
799 | * makes it inline to init() and it becomes part of init.text section | 786 | * makes it inline to init() and it becomes part of init.text section |
800 | */ | 787 | */ |
801 | static int noinline init_post(void) | 788 | static noinline int init_post(void) |
802 | { | 789 | { |
790 | /* need to finish all async __init code before freeing the memory */ | ||
791 | async_synchronize_full(); | ||
803 | free_initmem(); | 792 | free_initmem(); |
804 | unlock_kernel(); | 793 | unlock_kernel(); |
805 | mark_rodata_ro(); | 794 | mark_rodata_ro(); |