aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig190
-rw-r--r--init/do_mounts.c6
-rw-r--r--init/do_mounts_md.c2
-rw-r--r--init/do_mounts_rd.c14
-rw-r--r--init/initramfs.c1
-rw-r--r--init/main.c17
6 files changed, 141 insertions, 89 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 52847eec7398..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
274config 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
282config 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
293config 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
302config 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
309config 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
316config 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
341config FAIR_GROUP_SCHED 290config 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
380endchoice 329endchoice
381 330
331menu "Control Group support"
332config 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
346config 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
357config 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
366config 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
373config 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
380config 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
382config CGROUP_CPUACCT 391config 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
396config MM_OWNER
397 bool
398
399config CGROUP_MEM_RES_CTLR 405config 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
428config MM_OWNER
429 bool
430
431config 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
448endmenu
449
422config SYSFS_DEPRECATED 450config SYSFS_DEPRECATED
423 bool 451 bool
424 452
425config SYSFS_DEPRECATED_V2 453config 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
448config PROC_PID_CPUSET 486config 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
841config TINY_SHMEM
842 default !SHMEM
843 bool
844
845config BASE_SMALL 879config BASE_SMALL
846 int 880 int
847 default 0 if BASE_FULL 881 default 0 if BASE_FULL
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
274static void autodetect_raid(void) 274static 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
13int __initdata rd_prompt = 1;/* 1 = prompt for RAM disk, 0 = don't prompt */ 14int __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 */
46static int __init 48static 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 72a521c0da07..db7974ff7a0a 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>
@@ -109,7 +109,7 @@ EXPORT_SYMBOL(system_state);
109 109
110extern void time_init(void); 110extern void time_init(void);
111/* Default late time init is NULL. archs can override this later. */ 111/* Default late time init is NULL. archs can override this later. */
112void (*late_time_init)(void); 112void (*__initdata late_time_init)(void);
113extern void softirq_init(void); 113extern void softirq_init(void);
114 114
115/* Untouched command line saved by arch-specific code. */ 115/* Untouched command line saved by arch-specific code. */
@@ -448,7 +448,7 @@ static void __init setup_command_line(char *command_line)
448 * gcc-3.4 accidentally inlines this function, so use noinline. 448 * gcc-3.4 accidentally inlines this function, so use noinline.
449 */ 449 */
450 450
451static void noinline __init_refok rest_init(void) 451static noinline void __init_refok rest_init(void)
452 __releases(kernel_lock) 452 __releases(kernel_lock)
453{ 453{
454 int pid; 454 int pid;
@@ -538,7 +538,6 @@ asmlinkage void __init start_kernel(void)
538 * Need to run as early as possible, to initialize the 538 * Need to run as early as possible, to initialize the
539 * lockdep hash: 539 * lockdep hash:
540 */ 540 */
541 unwind_init();
542 lockdep_init(); 541 lockdep_init();
543 debug_objects_early_init(); 542 debug_objects_early_init();
544 cgroup_init_early(); 543 cgroup_init_early();
@@ -560,7 +559,6 @@ asmlinkage void __init start_kernel(void)
560 setup_arch(&command_line); 559 setup_arch(&command_line);
561 mm_init_owner(&init_mm, &init_task); 560 mm_init_owner(&init_mm, &init_task);
562 setup_command_line(command_line); 561 setup_command_line(command_line);
563 unwind_setup();
564 setup_per_cpu_areas(); 562 setup_per_cpu_areas();
565 setup_nr_cpu_ids(); 563 setup_nr_cpu_ids();
566 smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */ 564 smp_prepare_boot_cpu(); /* arch-specific boot-cpu hooks */
@@ -603,7 +601,8 @@ asmlinkage void __init start_kernel(void)
603 sched_clock_init(); 601 sched_clock_init();
604 profile_init(); 602 profile_init();
605 if (!irqs_disabled()) 603 if (!irqs_disabled())
606 printk("start_kernel(): bug: interrupts were enabled early\n"); 604 printk(KERN_CRIT "start_kernel(): bug: interrupts were "
605 "enabled early\n");
607 early_boot_irqs_on(); 606 early_boot_irqs_on();
608 local_irq_enable(); 607 local_irq_enable();
609 608
@@ -689,7 +688,7 @@ asmlinkage void __init start_kernel(void)
689 rest_init(); 688 rest_init();
690} 689}
691 690
692static int initcall_debug; 691int initcall_debug;
693core_param(initcall_debug, initcall_debug, bool, 0644); 692core_param(initcall_debug, initcall_debug, bool, 0644);
694 693
695int do_one_initcall(initcall_t fn) 694int do_one_initcall(initcall_t fn)
@@ -788,8 +787,10 @@ static void run_init_process(char *init_filename)
788/* This is a non __init function. Force it to be noinline otherwise gcc 787/* This is a non __init function. Force it to be noinline otherwise gcc
789 * makes it inline to init() and it becomes part of init.text section 788 * makes it inline to init() and it becomes part of init.text section
790 */ 789 */
791static int noinline init_post(void) 790static noinline int init_post(void)
792{ 791{
792 /* need to finish all async __init code before freeing the memory */
793 async_synchronize_full();
793 free_initmem(); 794 free_initmem();
794 unlock_kernel(); 795 unlock_kernel();
795 mark_rodata_ro(); 796 mark_rodata_ro();