aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig113
-rw-r--r--init/do_mounts.c70
-rw-r--r--init/main.c3
3 files changed, 143 insertions, 43 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 2de5b1cbadd9..3ae8ffe738eb 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -21,6 +21,13 @@ config CONSTRUCTORS
21 depends on !UML 21 depends on !UML
22 default y 22 default y
23 23
24config HAVE_IRQ_WORK
25 bool
26
27config IRQ_WORK
28 bool
29 depends on HAVE_IRQ_WORK
30
24menu "General setup" 31menu "General setup"
25 32
26config EXPERIMENTAL 33config EXPERIMENTAL
@@ -64,7 +71,7 @@ config BROKEN_ON_SMP
64 71
65config LOCK_KERNEL 72config LOCK_KERNEL
66 bool 73 bool
67 depends on SMP || PREEMPT 74 depends on (SMP || PREEMPT) && BKL
68 default y 75 default y
69 76
70config INIT_ENV_ARG_LIMIT 77config INIT_ENV_ARG_LIMIT
@@ -179,7 +186,7 @@ config KERNEL_LZO
179 depends on HAVE_KERNEL_LZO 186 depends on HAVE_KERNEL_LZO
180 help 187 help
181 Its compression ratio is the poorest among the 4. The kernel 188 Its compression ratio is the poorest among the 4. The kernel
182 size is about about 10% bigger than gzip; however its speed 189 size is about 10% bigger than gzip; however its speed
183 (both compression and decompression) is the fastest. 190 (both compression and decompression) is the fastest.
184 191
185endchoice 192endchoice
@@ -332,6 +339,8 @@ config AUDIT_TREE
332 depends on AUDITSYSCALL 339 depends on AUDITSYSCALL
333 select FSNOTIFY 340 select FSNOTIFY
334 341
342source "kernel/irq/Kconfig"
343
335menu "RCU Subsystem" 344menu "RCU Subsystem"
336 345
337choice 346choice
@@ -340,6 +349,7 @@ choice
340 349
341config TREE_RCU 350config TREE_RCU
342 bool "Tree-based hierarchical RCU" 351 bool "Tree-based hierarchical RCU"
352 depends on !PREEMPT && SMP
343 help 353 help
344 This option selects the RCU implementation that is 354 This option selects the RCU implementation that is
345 designed for very large SMP system with hundreds or 355 designed for very large SMP system with hundreds or
@@ -347,7 +357,7 @@ config TREE_RCU
347 smaller systems. 357 smaller systems.
348 358
349config TREE_PREEMPT_RCU 359config TREE_PREEMPT_RCU
350 bool "Preemptable tree-based hierarchical RCU" 360 bool "Preemptible tree-based hierarchical RCU"
351 depends on PREEMPT 361 depends on PREEMPT
352 help 362 help
353 This option selects the RCU implementation that is 363 This option selects the RCU implementation that is
@@ -365,8 +375,22 @@ config TINY_RCU
365 is not required. This option greatly reduces the 375 is not required. This option greatly reduces the
366 memory footprint of RCU. 376 memory footprint of RCU.
367 377
378config TINY_PREEMPT_RCU
379 bool "Preemptible UP-only small-memory-footprint RCU"
380 depends on !SMP && PREEMPT
381 help
382 This option selects the RCU implementation that is designed
383 for real-time UP systems. This option greatly reduces the
384 memory footprint of RCU.
385
368endchoice 386endchoice
369 387
388config PREEMPT_RCU
389 def_bool ( TREE_PREEMPT_RCU || TINY_PREEMPT_RCU )
390 help
391 This option enables preemptible-RCU code that is common between
392 the TREE_PREEMPT_RCU and TINY_PREEMPT_RCU implementations.
393
370config RCU_TRACE 394config RCU_TRACE
371 bool "Enable tracing for RCU" 395 bool "Enable tracing for RCU"
372 depends on TREE_RCU || TREE_PREEMPT_RCU 396 depends on TREE_RCU || TREE_PREEMPT_RCU
@@ -387,9 +411,12 @@ config RCU_FANOUT
387 help 411 help
388 This option controls the fanout of hierarchical implementations 412 This option controls the fanout of hierarchical implementations
389 of RCU, allowing RCU to work efficiently on machines with 413 of RCU, allowing RCU to work efficiently on machines with
390 large numbers of CPUs. This value must be at least the cube 414 large numbers of CPUs. This value must be at least the fourth
391 root of NR_CPUS, which allows NR_CPUS up to 32,768 for 32-bit 415 root of NR_CPUS, which allows NR_CPUS to be insanely large.
392 systems and up to 262,144 for 64-bit systems. 416 The default value of RCU_FANOUT should be used for production
417 systems, but if you are stress-testing the RCU implementation
418 itself, small RCU_FANOUT values allow you to test large-system
419 code paths on small(er) systems.
393 420
394 Select a specific number if testing RCU itself. 421 Select a specific number if testing RCU itself.
395 Take the default if unsure. 422 Take the default if unsure.
@@ -634,11 +661,14 @@ config BLK_CGROUP
634 661
635 Currently, CFQ IO scheduler uses it to recognize task groups and 662 Currently, CFQ IO scheduler uses it to recognize task groups and
636 control disk bandwidth allocation (proportional time slice allocation) 663 control disk bandwidth allocation (proportional time slice allocation)
637 to such task groups. 664 to such task groups. It is also used by bio throttling logic in
665 block layer to implement upper limit in IO rates on a device.
638 666
639 This option only enables generic Block IO controller infrastructure. 667 This option only enables generic Block IO controller infrastructure.
640 One needs to also enable actual IO controlling logic in CFQ for it 668 One needs to also enable actual IO controlling logic/policy. For
641 to take effect. (CONFIG_CFQ_GROUP_IOSCHED=y). 669 enabling proportional weight division of disk bandwidth in CFQ seti
670 CONFIG_CFQ_GROUP_IOSCHED=y and for enabling throttling policy set
671 CONFIG_BLK_THROTTLE=y.
642 672
643 See Documentation/cgroups/blkio-controller.txt for more information. 673 See Documentation/cgroups/blkio-controller.txt for more information.
644 674
@@ -656,40 +686,42 @@ config MM_OWNER
656 bool 686 bool
657 687
658config SYSFS_DEPRECATED 688config SYSFS_DEPRECATED
659 bool
660
661config SYSFS_DEPRECATED_V2
662 bool "enable deprecated sysfs features to support old userspace tools" 689 bool "enable deprecated sysfs features to support old userspace tools"
663 depends on SYSFS 690 depends on SYSFS
664 default n 691 default n
665 select SYSFS_DEPRECATED 692 help
666 help 693 This option adds code that switches the layout of the "block" class
667 This option switches the layout of sysfs to the deprecated 694 devices, to not show up in /sys/class/block/, but only in
668 version. Do not use it on recent distributions. 695 /sys/block/.
669 696
670 The current sysfs layout features a unified device tree at 697 This switch is only active when the sysfs.deprecated=1 boot option is
671 /sys/devices/, which is able to express a hierarchy between 698 passed or the SYSFS_DEPRECATED_V2 option is set.
672 class devices. If the deprecated option is set to Y, the 699
673 unified device tree is split into a bus device tree at 700 This option allows new kernels to run on old distributions and tools,
674 /sys/devices/ and several individual class device trees at 701 which might get confused by /sys/class/block/. Since 2007/2008 all
675 /sys/class/. The class and bus devices will be connected by 702 major distributions and tools handle this just fine.
676 "<subsystem>:<name>" and the "device" links. The "block" 703
677 class devices, will not show up in /sys/class/block/. Some 704 Recent distributions and userspace tools after 2009/2010 depend on
678 subsystems will suppress the creation of some devices which 705 the existence of /sys/class/block/, and will not work with this
679 depend on the unified device tree. 706 option enabled.
680 707
681 This option is not a pure compatibility option that can 708 Only if you are using a new kernel on an old distribution, you might
682 be safely enabled on newer distributions. It will change the 709 need to say Y here.
683 layout of sysfs to the non-extensible deprecated version, 710
684 and disable some features, which can not be exported without 711config SYSFS_DEPRECATED_V2
685 confusing older userspace tools. Since 2007/2008 all major 712 bool "enabled deprecated sysfs features by default"
686 distributions do not enable this option, and ship no tools which 713 default n
687 depend on the deprecated layout or this option. 714 depends on SYSFS
688 715 depends on SYSFS_DEPRECATED
689 If you are using a new kernel on an older distribution, or use 716 help
690 older userspace tools, you might need to say Y here. Do not say Y, 717 Enable deprecated sysfs by default.
691 if the original kernel, that came with your distribution, has 718
692 this option set to N. 719 See the CONFIG_SYSFS_DEPRECATED option for more details about this
720 option.
721
722 Only if you are using a new kernel on an old distribution, you might
723 need to say Y here. Even then, odds are you would not need it
724 enabled, you can always pass the boot option if absolutely necessary.
693 725
694config RELAY 726config RELAY
695 bool "Kernel->user space relay support (formerly relayfs)" 727 bool "Kernel->user space relay support (formerly relayfs)"
@@ -987,6 +1019,7 @@ config PERF_EVENTS
987 default y if (PROFILING || PERF_COUNTERS) 1019 default y if (PROFILING || PERF_COUNTERS)
988 depends on HAVE_PERF_EVENTS 1020 depends on HAVE_PERF_EVENTS
989 select ANON_INODES 1021 select ANON_INODES
1022 select IRQ_WORK
990 help 1023 help
991 Enable kernel support for various performance events provided 1024 Enable kernel support for various performance events provided
992 by software and hardware. 1025 by software and hardware.
diff --git a/init/do_mounts.c b/init/do_mounts.c
index 52387f14f9b4..62a47eafa8e9 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -58,6 +58,62 @@ static int __init readwrite(char *str)
58__setup("ro", readonly); 58__setup("ro", readonly);
59__setup("rw", readwrite); 59__setup("rw", readwrite);
60 60
61#ifdef CONFIG_BLOCK
62/**
63 * match_dev_by_uuid - callback for finding a partition using its uuid
64 * @dev: device passed in by the caller
65 * @data: opaque pointer to a 36 byte char array with a UUID
66 *
67 * Returns 1 if the device matches, and 0 otherwise.
68 */
69static int match_dev_by_uuid(struct device *dev, void *data)
70{
71 u8 *uuid = data;
72 struct hd_struct *part = dev_to_part(dev);
73
74 if (!part->info)
75 goto no_match;
76
77 if (memcmp(uuid, part->info->uuid, sizeof(part->info->uuid)))
78 goto no_match;
79
80 return 1;
81no_match:
82 return 0;
83}
84
85
86/**
87 * devt_from_partuuid - looks up the dev_t of a partition by its UUID
88 * @uuid: 36 byte char array containing a hex ascii UUID
89 *
90 * The function will return the first partition which contains a matching
91 * UUID value in its partition_meta_info struct. This does not search
92 * by filesystem UUIDs.
93 *
94 * Returns the matching dev_t on success or 0 on failure.
95 */
96static dev_t __init devt_from_partuuid(char *uuid_str)
97{
98 dev_t res = 0;
99 struct device *dev = NULL;
100 u8 uuid[16];
101
102 /* Pack the requested UUID in the expected format. */
103 part_pack_uuid(uuid_str, uuid);
104
105 dev = class_find_device(&block_class, NULL, uuid, &match_dev_by_uuid);
106 if (!dev)
107 goto done;
108
109 res = dev->devt;
110 put_device(dev);
111
112done:
113 return res;
114}
115#endif
116
61/* 117/*
62 * Convert a name into device number. We accept the following variants: 118 * Convert a name into device number. We accept the following variants:
63 * 119 *
@@ -68,6 +124,8 @@ __setup("rw", readwrite);
68 * of partition - device number of disk plus the partition number 124 * of partition - device number of disk plus the partition number
69 * 5) /dev/<disk_name>p<decimal> - same as the above, that form is 125 * 5) /dev/<disk_name>p<decimal> - same as the above, that form is
70 * used when disk name of partitioned disk ends on a digit. 126 * used when disk name of partitioned disk ends on a digit.
127 * 6) PARTUUID=00112233-4455-6677-8899-AABBCCDDEEFF representing the
128 * unique id of a partition if the partition table provides it.
71 * 129 *
72 * If name doesn't have fall into the categories above, we return (0,0). 130 * If name doesn't have fall into the categories above, we return (0,0).
73 * block_class is used to check if something is a disk name. If the disk 131 * block_class is used to check if something is a disk name. If the disk
@@ -82,6 +140,18 @@ dev_t name_to_dev_t(char *name)
82 dev_t res = 0; 140 dev_t res = 0;
83 int part; 141 int part;
84 142
143#ifdef CONFIG_BLOCK
144 if (strncmp(name, "PARTUUID=", 9) == 0) {
145 name += 9;
146 if (strlen(name) != 36)
147 goto fail;
148 res = devt_from_partuuid(name);
149 if (!res)
150 goto fail;
151 goto done;
152 }
153#endif
154
85 if (strncmp(name, "/dev/", 5) != 0) { 155 if (strncmp(name, "/dev/", 5) != 0) {
86 unsigned maj, min; 156 unsigned maj, min;
87 157
diff --git a/init/main.c b/init/main.c
index 94ab488039aa..e59af24a0b7c 100644
--- a/init/main.c
+++ b/init/main.c
@@ -424,7 +424,6 @@ static void __init setup_command_line(char *command_line)
424static __initdata DECLARE_COMPLETION(kthreadd_done); 424static __initdata DECLARE_COMPLETION(kthreadd_done);
425 425
426static noinline void __init_refok rest_init(void) 426static noinline void __init_refok rest_init(void)
427 __releases(kernel_lock)
428{ 427{
429 int pid; 428 int pid;
430 429
@@ -556,7 +555,6 @@ asmlinkage void __init start_kernel(void)
556 555
557 local_irq_disable(); 556 local_irq_disable();
558 early_boot_irqs_off(); 557 early_boot_irqs_off();
559 early_init_irq_lock_class();
560 558
561/* 559/*
562 * Interrupts are still disabled. Do necessary setups, then 560 * Interrupts are still disabled. Do necessary setups, then
@@ -819,7 +817,6 @@ static void run_init_process(const char *init_filename)
819 * makes it inline to init() and it becomes part of init.text section 817 * makes it inline to init() and it becomes part of init.text section
820 */ 818 */
821static noinline int init_post(void) 819static noinline int init_post(void)
822 __releases(kernel_lock)
823{ 820{
824 /* need to finish all async __init code before freeing the memory */ 821 /* need to finish all async __init code before freeing the memory */
825 async_synchronize_full(); 822 async_synchronize_full();