diff options
Diffstat (limited to 'init')
-rw-r--r-- | init/Kconfig | 196 | ||||
-rw-r--r-- | init/do_mounts.c | 6 | ||||
-rw-r--r-- | init/do_mounts_md.c | 2 | ||||
-rw-r--r-- | init/initramfs.c | 1 | ||||
-rw-r--r-- | init/main.c | 17 |
5 files changed, 127 insertions, 95 deletions
diff --git a/init/Kconfig b/init/Kconfig index f6281711166d..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,12 +950,6 @@ 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 | ||
927 | config INIT_ALL_POSSIBLE | 955 | config INIT_ALL_POSSIBLE |
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/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 cd168ebc5924..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> |
@@ -108,7 +108,7 @@ EXPORT_SYMBOL(system_state); | |||
108 | 108 | ||
109 | extern void time_init(void); | 109 | extern void time_init(void); |
110 | /* Default late time init is NULL. archs can override this later. */ | 110 | /* Default late time init is NULL. archs can override this later. */ |
111 | void (*late_time_init)(void); | 111 | void (*__initdata late_time_init)(void); |
112 | extern void softirq_init(void); | 112 | extern void softirq_init(void); |
113 | 113 | ||
114 | /* Untouched command line saved by arch-specific code. */ | 114 | /* Untouched command line saved by arch-specific code. */ |
@@ -447,7 +447,7 @@ static void __init setup_command_line(char *command_line) | |||
447 | * gcc-3.4 accidentally inlines this function, so use noinline. | 447 | * gcc-3.4 accidentally inlines this function, so use noinline. |
448 | */ | 448 | */ |
449 | 449 | ||
450 | static void noinline __init_refok rest_init(void) | 450 | static noinline void __init_refok rest_init(void) |
451 | __releases(kernel_lock) | 451 | __releases(kernel_lock) |
452 | { | 452 | { |
453 | int pid; | 453 | int pid; |
@@ -537,7 +537,6 @@ asmlinkage void __init start_kernel(void) | |||
537 | * Need to run as early as possible, to initialize the | 537 | * Need to run as early as possible, to initialize the |
538 | * lockdep hash: | 538 | * lockdep hash: |
539 | */ | 539 | */ |
540 | unwind_init(); | ||
541 | lockdep_init(); | 540 | lockdep_init(); |
542 | debug_objects_early_init(); | 541 | debug_objects_early_init(); |
543 | cgroup_init_early(); | 542 | cgroup_init_early(); |
@@ -559,7 +558,6 @@ asmlinkage void __init start_kernel(void) | |||
559 | setup_arch(&command_line); | 558 | setup_arch(&command_line); |
560 | mm_init_owner(&init_mm, &init_task); | 559 | mm_init_owner(&init_mm, &init_task); |
561 | setup_command_line(command_line); | 560 | setup_command_line(command_line); |
562 | unwind_setup(); | ||
563 | setup_per_cpu_areas(); | 561 | setup_per_cpu_areas(); |
564 | setup_nr_cpu_ids(); | 562 | setup_nr_cpu_ids(); |
565 | smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */ | 563 | smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */ |
@@ -602,7 +600,8 @@ asmlinkage void __init start_kernel(void) | |||
602 | sched_clock_init(); | 600 | sched_clock_init(); |
603 | profile_init(); | 601 | profile_init(); |
604 | if (!irqs_disabled()) | 602 | if (!irqs_disabled()) |
605 | printk("start_kernel(): bug: interrupts were enabled early\n"); | 603 | printk(KERN_CRIT "start_kernel(): bug: interrupts were " |
604 | "enabled early\n"); | ||
606 | early_boot_irqs_on(); | 605 | early_boot_irqs_on(); |
607 | local_irq_enable(); | 606 | local_irq_enable(); |
608 | 607 | ||
@@ -687,7 +686,7 @@ asmlinkage void __init start_kernel(void) | |||
687 | rest_init(); | 686 | rest_init(); |
688 | } | 687 | } |
689 | 688 | ||
690 | static int initcall_debug; | 689 | int initcall_debug; |
691 | core_param(initcall_debug, initcall_debug, bool, 0644); | 690 | core_param(initcall_debug, initcall_debug, bool, 0644); |
692 | 691 | ||
693 | int do_one_initcall(initcall_t fn) | 692 | int do_one_initcall(initcall_t fn) |
@@ -786,8 +785,10 @@ static void run_init_process(char *init_filename) | |||
786 | /* 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 |
787 | * 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 |
788 | */ | 787 | */ |
789 | static int noinline init_post(void) | 788 | static noinline int init_post(void) |
790 | { | 789 | { |
790 | /* need to finish all async __init code before freeing the memory */ | ||
791 | async_synchronize_full(); | ||
791 | free_initmem(); | 792 | free_initmem(); |
792 | unlock_kernel(); | 793 | unlock_kernel(); |
793 | mark_rodata_ro(); | 794 | mark_rodata_ro(); |