aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
authorGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
committerGlenn Elliott <gelliott@cs.unc.edu>2012-03-04 19:47:13 -0500
commitc71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch)
treeecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /init
parentea53c912f8a86a8567697115b6a0d8152beee5c8 (diff)
parent6a00f206debf8a5c8899055726ad127dbeeed098 (diff)
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts: litmus/sched_cedf.c
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig406
-rw-r--r--init/calibrate.c192
-rw-r--r--init/do_mounts.c91
-rw-r--r--init/do_mounts_md.c2
-rw-r--r--init/do_mounts_rd.c6
-rw-r--r--init/initramfs.c14
-rw-r--r--init/main.c130
-rw-r--r--init/noinitramfs.c6
-rw-r--r--init/version.c1
9 files changed, 527 insertions, 321 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 2de5b1cbadd9..412c21b00d51 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -19,7 +19,13 @@ config DEFCONFIG_LIST
19config CONSTRUCTORS 19config CONSTRUCTORS
20 bool 20 bool
21 depends on !UML 21 depends on !UML
22 default y 22
23config HAVE_IRQ_WORK
24 bool
25
26config IRQ_WORK
27 bool
28 depends on HAVE_IRQ_WORK
23 29
24menu "General setup" 30menu "General setup"
25 31
@@ -62,11 +68,6 @@ config BROKEN_ON_SMP
62 depends on BROKEN || !SMP 68 depends on BROKEN || !SMP
63 default y 69 default y
64 70
65config LOCK_KERNEL
66 bool
67 depends on SMP || PREEMPT
68 default y
69
70config INIT_ENV_ARG_LIMIT 71config INIT_ENV_ARG_LIMIT
71 int 72 int
72 default 32 if !UML 73 default 32 if !UML
@@ -123,13 +124,16 @@ config HAVE_KERNEL_BZIP2
123config HAVE_KERNEL_LZMA 124config HAVE_KERNEL_LZMA
124 bool 125 bool
125 126
127config HAVE_KERNEL_XZ
128 bool
129
126config HAVE_KERNEL_LZO 130config HAVE_KERNEL_LZO
127 bool 131 bool
128 132
129choice 133choice
130 prompt "Kernel compression mode" 134 prompt "Kernel compression mode"
131 default KERNEL_GZIP 135 default KERNEL_GZIP
132 depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA || HAVE_KERNEL_LZO 136 depends on HAVE_KERNEL_GZIP || HAVE_KERNEL_BZIP2 || HAVE_KERNEL_LZMA || HAVE_KERNEL_XZ || HAVE_KERNEL_LZO
133 help 137 help
134 The linux kernel is a kind of self-extracting executable. 138 The linux kernel is a kind of self-extracting executable.
135 Several compression algorithms are available, which differ 139 Several compression algorithms are available, which differ
@@ -174,16 +178,40 @@ config KERNEL_LZMA
174 two. Compression is slowest. The kernel size is about 33% 178 two. Compression is slowest. The kernel size is about 33%
175 smaller with LZMA in comparison to gzip. 179 smaller with LZMA in comparison to gzip.
176 180
181config KERNEL_XZ
182 bool "XZ"
183 depends on HAVE_KERNEL_XZ
184 help
185 XZ uses the LZMA2 algorithm and instruction set specific
186 BCJ filters which can improve compression ratio of executable
187 code. The size of the kernel is about 30% smaller with XZ in
188 comparison to gzip. On architectures for which there is a BCJ
189 filter (i386, x86_64, ARM, IA-64, PowerPC, and SPARC), XZ
190 will create a few percent smaller kernel than plain LZMA.
191
192 The speed is about the same as with LZMA: The decompression
193 speed of XZ is better than that of bzip2 but worse than gzip
194 and LZO. Compression is slow.
195
177config KERNEL_LZO 196config KERNEL_LZO
178 bool "LZO" 197 bool "LZO"
179 depends on HAVE_KERNEL_LZO 198 depends on HAVE_KERNEL_LZO
180 help 199 help
181 Its compression ratio is the poorest among the 4. The kernel 200 Its compression ratio is the poorest among the 4. The kernel
182 size is about about 10% bigger than gzip; however its speed 201 size is about 10% bigger than gzip; however its speed
183 (both compression and decompression) is the fastest. 202 (both compression and decompression) is the fastest.
184 203
185endchoice 204endchoice
186 205
206config DEFAULT_HOSTNAME
207 string "Default hostname"
208 default "(none)"
209 help
210 This option determines the default system hostname before userspace
211 calls sethostname(2). The kernel traditionally uses "(none)" here,
212 but you may wish to use a different default here to make a minimal
213 system more usable with less configuration.
214
187config SWAP 215config SWAP
188 bool "Support for paging of anonymous memory (swap)" 216 bool "Support for paging of anonymous memory (swap)"
189 depends on MMU && BLOCK 217 depends on MMU && BLOCK
@@ -262,6 +290,18 @@ config BSD_PROCESS_ACCT_V3
262 for processing it. A preliminary version of these tools is available 290 for processing it. A preliminary version of these tools is available
263 at <http://www.gnu.org/software/acct/>. 291 at <http://www.gnu.org/software/acct/>.
264 292
293config FHANDLE
294 bool "open by fhandle syscalls"
295 select EXPORTFS
296 help
297 If you say Y here, a user level program will be able to map
298 file names to handle and then later use the handle for
299 different file system operations. This is useful in implementing
300 userspace file servers, which now track files using handles instead
301 of names. The handle would remain the same even if file names
302 get renamed. Enables open_by_handle_at(2) and name_to_handle_at(2)
303 syscalls.
304
265config TASKSTATS 305config TASKSTATS
266 bool "Export task/process statistics through netlink (EXPERIMENTAL)" 306 bool "Export task/process statistics through netlink (EXPERIMENTAL)"
267 depends on NET 307 depends on NET
@@ -332,6 +372,8 @@ config AUDIT_TREE
332 depends on AUDITSYSCALL 372 depends on AUDITSYSCALL
333 select FSNOTIFY 373 select FSNOTIFY
334 374
375source "kernel/irq/Kconfig"
376
335menu "RCU Subsystem" 377menu "RCU Subsystem"
336 378
337choice 379choice
@@ -340,6 +382,7 @@ choice
340 382
341config TREE_RCU 383config TREE_RCU
342 bool "Tree-based hierarchical RCU" 384 bool "Tree-based hierarchical RCU"
385 depends on !PREEMPT && SMP
343 help 386 help
344 This option selects the RCU implementation that is 387 This option selects the RCU implementation that is
345 designed for very large SMP system with hundreds or 388 designed for very large SMP system with hundreds or
@@ -347,7 +390,7 @@ config TREE_RCU
347 smaller systems. 390 smaller systems.
348 391
349config TREE_PREEMPT_RCU 392config TREE_PREEMPT_RCU
350 bool "Preemptable tree-based hierarchical RCU" 393 bool "Preemptible tree-based hierarchical RCU"
351 depends on PREEMPT 394 depends on PREEMPT
352 help 395 help
353 This option selects the RCU implementation that is 396 This option selects the RCU implementation that is
@@ -365,11 +408,24 @@ config TINY_RCU
365 is not required. This option greatly reduces the 408 is not required. This option greatly reduces the
366 memory footprint of RCU. 409 memory footprint of RCU.
367 410
411config TINY_PREEMPT_RCU
412 bool "Preemptible UP-only small-memory-footprint RCU"
413 depends on !SMP && PREEMPT
414 help
415 This option selects the RCU implementation that is designed
416 for real-time UP systems. This option greatly reduces the
417 memory footprint of RCU.
418
368endchoice 419endchoice
369 420
421config PREEMPT_RCU
422 def_bool ( TREE_PREEMPT_RCU || TINY_PREEMPT_RCU )
423 help
424 This option enables preemptible-RCU code that is common between
425 the TREE_PREEMPT_RCU and TINY_PREEMPT_RCU implementations.
426
370config RCU_TRACE 427config RCU_TRACE
371 bool "Enable tracing for RCU" 428 bool "Enable tracing for RCU"
372 depends on TREE_RCU || TREE_PREEMPT_RCU
373 help 429 help
374 This option provides tracing in RCU which presents stats 430 This option provides tracing in RCU which presents stats
375 in debugfs for debugging RCU implementation. 431 in debugfs for debugging RCU implementation.
@@ -387,9 +443,12 @@ config RCU_FANOUT
387 help 443 help
388 This option controls the fanout of hierarchical implementations 444 This option controls the fanout of hierarchical implementations
389 of RCU, allowing RCU to work efficiently on machines with 445 of RCU, allowing RCU to work efficiently on machines with
390 large numbers of CPUs. This value must be at least the cube 446 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 447 root of NR_CPUS, which allows NR_CPUS to be insanely large.
392 systems and up to 262,144 for 64-bit systems. 448 The default value of RCU_FANOUT should be used for production
449 systems, but if you are stress-testing the RCU implementation
450 itself, small RCU_FANOUT values allow you to test large-system
451 code paths on small(er) systems.
393 452
394 Select a specific number if testing RCU itself. 453 Select a specific number if testing RCU itself.
395 Take the default if unsure. 454 Take the default if unsure.
@@ -432,6 +491,45 @@ config TREE_RCU_TRACE
432 TREE_PREEMPT_RCU implementations, permitting Makefile to 491 TREE_PREEMPT_RCU implementations, permitting Makefile to
433 trivially select kernel/rcutree_trace.c. 492 trivially select kernel/rcutree_trace.c.
434 493
494config RCU_BOOST
495 bool "Enable RCU priority boosting"
496 depends on RT_MUTEXES && PREEMPT_RCU
497 default n
498 help
499 This option boosts the priority of preempted RCU readers that
500 block the current preemptible RCU grace period for too long.
501 This option also prevents heavy loads from blocking RCU
502 callback invocation for all flavors of RCU.
503
504 Say Y here if you are working with real-time apps or heavy loads
505 Say N here if you are unsure.
506
507config RCU_BOOST_PRIO
508 int "Real-time priority to boost RCU readers to"
509 range 1 99
510 depends on RCU_BOOST
511 default 1
512 help
513 This option specifies the real-time priority to which preempted
514 RCU readers are to be boosted. If you are working with CPU-bound
515 real-time applications, you should specify a priority higher then
516 the highest-priority CPU-bound application.
517
518 Specify the real-time priority, or take the default if unsure.
519
520config RCU_BOOST_DELAY
521 int "Milliseconds to delay boosting after RCU grace-period start"
522 range 0 3000
523 depends on RCU_BOOST
524 default 500
525 help
526 This option specifies the time to wait after the beginning of
527 a given grace period before priority-boosting preempted RCU
528 readers blocking that grace period. Note that any RCU reader
529 blocking an expedited RCU grace period is boosted immediately.
530
531 Accept the default if unsure.
532
435endmenu # "RCU Subsystem" 533endmenu # "RCU Subsystem"
436 534
437config IKCONFIG 535config IKCONFIG
@@ -491,7 +589,6 @@ if CGROUPS
491 589
492config CGROUP_DEBUG 590config CGROUP_DEBUG
493 bool "Example debug cgroup subsystem" 591 bool "Example debug cgroup subsystem"
494 depends on CGROUPS
495 default n 592 default n
496 help 593 help
497 This option enables a simple cgroup subsystem that 594 This option enables a simple cgroup subsystem that
@@ -500,32 +597,20 @@ config CGROUP_DEBUG
500 597
501 Say N if unsure. 598 Say N if unsure.
502 599
503config CGROUP_NS
504 bool "Namespace cgroup subsystem"
505 depends on CGROUPS
506 help
507 Provides a simple namespace cgroup subsystem to
508 provide hierarchical naming of sets of namespaces,
509 for instance virtual servers and checkpoint/restart
510 jobs.
511
512config CGROUP_FREEZER 600config CGROUP_FREEZER
513 bool "Freezer cgroup subsystem" 601 bool "Freezer cgroup subsystem"
514 depends on CGROUPS
515 help 602 help
516 Provides a way to freeze and unfreeze all tasks in a 603 Provides a way to freeze and unfreeze all tasks in a
517 cgroup. 604 cgroup.
518 605
519config CGROUP_DEVICE 606config CGROUP_DEVICE
520 bool "Device controller for cgroups" 607 bool "Device controller for cgroups"
521 depends on CGROUPS && EXPERIMENTAL
522 help 608 help
523 Provides a cgroup implementing whitelists for devices which 609 Provides a cgroup implementing whitelists for devices which
524 a process in the cgroup can mknod or open. 610 a process in the cgroup can mknod or open.
525 611
526config CPUSETS 612config CPUSETS
527 bool "Cpuset support" 613 bool "Cpuset support"
528 depends on CGROUPS
529 help 614 help
530 This option will let you create and manage CPUSETs which 615 This option will let you create and manage CPUSETs which
531 allow dynamically partitioning a system into sets of CPUs and 616 allow dynamically partitioning a system into sets of CPUs and
@@ -541,7 +626,6 @@ config PROC_PID_CPUSET
541 626
542config CGROUP_CPUACCT 627config CGROUP_CPUACCT
543 bool "Simple CPU accounting cgroup subsystem" 628 bool "Simple CPU accounting cgroup subsystem"
544 depends on CGROUPS
545 help 629 help
546 Provides a simple Resource Controller for monitoring the 630 Provides a simple Resource Controller for monitoring the
547 total CPU consumed by the tasks in a cgroup. 631 total CPU consumed by the tasks in a cgroup.
@@ -551,11 +635,10 @@ config RESOURCE_COUNTERS
551 help 635 help
552 This option enables controller independent resource accounting 636 This option enables controller independent resource accounting
553 infrastructure that works with cgroups. 637 infrastructure that works with cgroups.
554 depends on CGROUPS
555 638
556config CGROUP_MEM_RES_CTLR 639config CGROUP_MEM_RES_CTLR
557 bool "Memory Resource Controller for Control Groups" 640 bool "Memory Resource Controller for Control Groups"
558 depends on CGROUPS && RESOURCE_COUNTERS 641 depends on RESOURCE_COUNTERS
559 select MM_OWNER 642 select MM_OWNER
560 help 643 help
561 Provides a memory resource controller that manages both anonymous 644 Provides a memory resource controller that manages both anonymous
@@ -593,10 +676,33 @@ config CGROUP_MEM_RES_CTLR_SWAP
593 if boot option "noswapaccount" is set, swap will not be accounted. 676 if boot option "noswapaccount" is set, swap will not be accounted.
594 Now, memory usage of swap_cgroup is 2 bytes per entry. If swap page 677 Now, memory usage of swap_cgroup is 2 bytes per entry. If swap page
595 size is 4096bytes, 512k per 1Gbytes of swap. 678 size is 4096bytes, 512k per 1Gbytes of swap.
679config CGROUP_MEM_RES_CTLR_SWAP_ENABLED
680 bool "Memory Resource Controller Swap Extension enabled by default"
681 depends on CGROUP_MEM_RES_CTLR_SWAP
682 default y
683 help
684 Memory Resource Controller Swap Extension comes with its price in
685 a bigger memory consumption. General purpose distribution kernels
686 which want to enable the feature but keep it disabled by default
687 and let the user enable it by swapaccount boot command line
688 parameter should have this option unselected.
689 For those who want to have the feature enabled by default should
690 select this option (if, for some reason, they need to disable it
691 then noswapaccount does the trick).
692
693config CGROUP_PERF
694 bool "Enable perf_event per-cpu per-container group (cgroup) monitoring"
695 depends on PERF_EVENTS && CGROUPS
696 help
697 This option extends the per-cpu mode to restrict monitoring to
698 threads which belong to the cgroup specified and run on the
699 designated cpu.
700
701 Say N if unsure.
596 702
597menuconfig CGROUP_SCHED 703menuconfig CGROUP_SCHED
598 bool "Group CPU scheduler" 704 bool "Group CPU scheduler"
599 depends on EXPERIMENTAL && CGROUPS 705 depends on EXPERIMENTAL
600 default n 706 default n
601 help 707 help
602 This feature lets CPU scheduler recognize task groups and control CPU 708 This feature lets CPU scheduler recognize task groups and control CPU
@@ -625,7 +731,7 @@ endif #CGROUP_SCHED
625 731
626config BLK_CGROUP 732config BLK_CGROUP
627 tristate "Block IO controller" 733 tristate "Block IO controller"
628 depends on CGROUPS && BLOCK 734 depends on BLOCK
629 default n 735 default n
630 ---help--- 736 ---help---
631 Generic block IO controller cgroup interface. This is the common 737 Generic block IO controller cgroup interface. This is the common
@@ -634,11 +740,14 @@ config BLK_CGROUP
634 740
635 Currently, CFQ IO scheduler uses it to recognize task groups and 741 Currently, CFQ IO scheduler uses it to recognize task groups and
636 control disk bandwidth allocation (proportional time slice allocation) 742 control disk bandwidth allocation (proportional time slice allocation)
637 to such task groups. 743 to such task groups. It is also used by bio throttling logic in
744 block layer to implement upper limit in IO rates on a device.
638 745
639 This option only enables generic Block IO controller infrastructure. 746 This option only enables generic Block IO controller infrastructure.
640 One needs to also enable actual IO controlling logic in CFQ for it 747 One needs to also enable actual IO controlling logic/policy. For
641 to take effect. (CONFIG_CFQ_GROUP_IOSCHED=y). 748 enabling proportional weight division of disk bandwidth in CFQ, set
749 CONFIG_CFQ_GROUP_IOSCHED=y; for enabling throttling policy, set
750 CONFIG_BLK_DEV_THROTTLING=y.
642 751
643 See Documentation/cgroups/blkio-controller.txt for more information. 752 See Documentation/cgroups/blkio-controller.txt for more information.
644 753
@@ -652,107 +761,124 @@ config DEBUG_BLK_CGROUP
652 761
653endif # CGROUPS 762endif # CGROUPS
654 763
655config MM_OWNER 764menuconfig NAMESPACES
656 bool 765 bool "Namespaces support" if EXPERT
657 766 default !EXPERT
658config SYSFS_DEPRECATED
659 bool
660
661config SYSFS_DEPRECATED_V2
662 bool "enable deprecated sysfs features to support old userspace tools"
663 depends on SYSFS
664 default n
665 select SYSFS_DEPRECATED
666 help
667 This option switches the layout of sysfs to the deprecated
668 version. Do not use it on recent distributions.
669
670 The current sysfs layout features a unified device tree at
671 /sys/devices/, which is able to express a hierarchy between
672 class devices. If the deprecated option is set to Y, the
673 unified device tree is split into a bus device tree at
674 /sys/devices/ and several individual class device trees at
675 /sys/class/. The class and bus devices will be connected by
676 "<subsystem>:<name>" and the "device" links. The "block"
677 class devices, will not show up in /sys/class/block/. Some
678 subsystems will suppress the creation of some devices which
679 depend on the unified device tree.
680
681 This option is not a pure compatibility option that can
682 be safely enabled on newer distributions. It will change the
683 layout of sysfs to the non-extensible deprecated version,
684 and disable some features, which can not be exported without
685 confusing older userspace tools. Since 2007/2008 all major
686 distributions do not enable this option, and ship no tools which
687 depend on the deprecated layout or this option.
688
689 If you are using a new kernel on an older distribution, or use
690 older userspace tools, you might need to say Y here. Do not say Y,
691 if the original kernel, that came with your distribution, has
692 this option set to N.
693
694config RELAY
695 bool "Kernel->user space relay support (formerly relayfs)"
696 help
697 This option enables support for relay interface support in
698 certain file systems (such as debugfs).
699 It is designed to provide an efficient mechanism for tools and
700 facilities to relay large amounts of data from kernel space to
701 user space.
702
703 If unsure, say N.
704
705config NAMESPACES
706 bool "Namespaces support" if EMBEDDED
707 default !EMBEDDED
708 help 767 help
709 Provides the way to make tasks work with different objects using 768 Provides the way to make tasks work with different objects using
710 the same id. For example same IPC id may refer to different objects 769 the same id. For example same IPC id may refer to different objects
711 or same user id or pid may refer to different tasks when used in 770 or same user id or pid may refer to different tasks when used in
712 different namespaces. 771 different namespaces.
713 772
773if NAMESPACES
774
714config UTS_NS 775config UTS_NS
715 bool "UTS namespace" 776 bool "UTS namespace"
716 depends on NAMESPACES 777 default y
717 help 778 help
718 In this namespace tasks see different info provided with the 779 In this namespace tasks see different info provided with the
719 uname() system call 780 uname() system call
720 781
721config IPC_NS 782config IPC_NS
722 bool "IPC namespace" 783 bool "IPC namespace"
723 depends on NAMESPACES && (SYSVIPC || POSIX_MQUEUE) 784 depends on (SYSVIPC || POSIX_MQUEUE)
785 default y
724 help 786 help
725 In this namespace tasks work with IPC ids which correspond to 787 In this namespace tasks work with IPC ids which correspond to
726 different IPC objects in different namespaces. 788 different IPC objects in different namespaces.
727 789
728config USER_NS 790config USER_NS
729 bool "User namespace (EXPERIMENTAL)" 791 bool "User namespace (EXPERIMENTAL)"
730 depends on NAMESPACES && EXPERIMENTAL 792 depends on EXPERIMENTAL
793 default y
731 help 794 help
732 This allows containers, i.e. vservers, to use user namespaces 795 This allows containers, i.e. vservers, to use user namespaces
733 to provide different user info for different servers. 796 to provide different user info for different servers.
734 If unsure, say N. 797 If unsure, say N.
735 798
736config PID_NS 799config PID_NS
737 bool "PID Namespaces (EXPERIMENTAL)" 800 bool "PID Namespaces"
738 default n 801 default y
739 depends on NAMESPACES && EXPERIMENTAL
740 help 802 help
741 Support process id namespaces. This allows having multiple 803 Support process id namespaces. This allows having multiple
742 processes with the same pid as long as they are in different 804 processes with the same pid as long as they are in different
743 pid namespaces. This is a building block of containers. 805 pid namespaces. This is a building block of containers.
744 806
745 Unless you want to work with an experimental feature
746 say N here.
747
748config NET_NS 807config NET_NS
749 bool "Network namespace" 808 bool "Network namespace"
750 default n 809 depends on NET
751 depends on NAMESPACES && EXPERIMENTAL && NET 810 default y
752 help 811 help
753 Allow user space to create what appear to be multiple instances 812 Allow user space to create what appear to be multiple instances
754 of the network stack. 813 of the network stack.
755 814
815endif # NAMESPACES
816
817config SCHED_AUTOGROUP
818 bool "Automatic process group scheduling"
819 select EVENTFD
820 select CGROUPS
821 select CGROUP_SCHED
822 select FAIR_GROUP_SCHED
823 help
824 This option optimizes the scheduler for common desktop workloads by
825 automatically creating and populating task groups. This separation
826 of workloads isolates aggressive CPU burners (like build jobs) from
827 desktop applications. Task group autogeneration is currently based
828 upon task session.
829
830config MM_OWNER
831 bool
832
833config SYSFS_DEPRECATED
834 bool "Enable deprecated sysfs features to support old userspace tools"
835 depends on SYSFS
836 default n
837 help
838 This option adds code that switches the layout of the "block" class
839 devices, to not show up in /sys/class/block/, but only in
840 /sys/block/.
841
842 This switch is only active when the sysfs.deprecated=1 boot option is
843 passed or the SYSFS_DEPRECATED_V2 option is set.
844
845 This option allows new kernels to run on old distributions and tools,
846 which might get confused by /sys/class/block/. Since 2007/2008 all
847 major distributions and tools handle this just fine.
848
849 Recent distributions and userspace tools after 2009/2010 depend on
850 the existence of /sys/class/block/, and will not work with this
851 option enabled.
852
853 Only if you are using a new kernel on an old distribution, you might
854 need to say Y here.
855
856config SYSFS_DEPRECATED_V2
857 bool "Enable deprecated sysfs features by default"
858 default n
859 depends on SYSFS
860 depends on SYSFS_DEPRECATED
861 help
862 Enable deprecated sysfs by default.
863
864 See the CONFIG_SYSFS_DEPRECATED option for more details about this
865 option.
866
867 Only if you are using a new kernel on an old distribution, you might
868 need to say Y here. Even then, odds are you would not need it
869 enabled, you can always pass the boot option if absolutely necessary.
870
871config RELAY
872 bool "Kernel->user space relay support (formerly relayfs)"
873 help
874 This option enables support for relay interface support in
875 certain file systems (such as debugfs).
876 It is designed to provide an efficient mechanism for tools and
877 facilities to relay large amounts of data from kernel space to
878 user space.
879
880 If unsure, say N.
881
756config BLK_DEV_INITRD 882config BLK_DEV_INITRD
757 bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support" 883 bool "Initial RAM filesystem and RAM disk (initramfs/initrd) support"
758 depends on BROKEN || !FRV 884 depends on BROKEN || !FRV
@@ -777,7 +903,6 @@ endif
777 903
778config CC_OPTIMIZE_FOR_SIZE 904config CC_OPTIMIZE_FOR_SIZE
779 bool "Optimize for size" 905 bool "Optimize for size"
780 default y
781 help 906 help
782 Enabling this option will pass "-Os" instead of "-O2" to gcc 907 Enabling this option will pass "-Os" instead of "-O2" to gcc
783 resulting in a smaller kernel. 908 resulting in a smaller kernel.
@@ -790,8 +915,8 @@ config SYSCTL
790config ANON_INODES 915config ANON_INODES
791 bool 916 bool
792 917
793menuconfig EMBEDDED 918menuconfig EXPERT
794 bool "Configure standard kernel features (for small systems)" 919 bool "Configure standard kernel features (expert users)"
795 help 920 help
796 This option allows certain base kernel options and settings 921 This option allows certain base kernel options and settings
797 to be disabled or tweaked. This is for specialized 922 to be disabled or tweaked. This is for specialized
@@ -799,14 +924,14 @@ menuconfig EMBEDDED
799 Only use this if you really know what you are doing. 924 Only use this if you really know what you are doing.
800 925
801config UID16 926config UID16
802 bool "Enable 16-bit UID system calls" if EMBEDDED 927 bool "Enable 16-bit UID system calls" if EXPERT
803 depends on ARM || BLACKFIN || CRIS || FRV || H8300 || X86_32 || M68K || (S390 && !64BIT) || SUPERH || SPARC32 || (SPARC64 && COMPAT) || UML || (X86_64 && IA32_EMULATION) 928 depends on ARM || BLACKFIN || CRIS || FRV || H8300 || X86_32 || M68K || (S390 && !64BIT) || SUPERH || SPARC32 || (SPARC64 && COMPAT) || UML || (X86_64 && IA32_EMULATION)
804 default y 929 default y
805 help 930 help
806 This enables the legacy 16-bit UID syscall wrappers. 931 This enables the legacy 16-bit UID syscall wrappers.
807 932
808config SYSCTL_SYSCALL 933config SYSCTL_SYSCALL
809 bool "Sysctl syscall support" if EMBEDDED 934 bool "Sysctl syscall support" if EXPERT
810 depends on PROC_SYSCTL 935 depends on PROC_SYSCTL
811 default y 936 default y
812 select SYSCTL 937 select SYSCTL
@@ -823,7 +948,7 @@ config SYSCTL_SYSCALL
823 If unsure say Y here. 948 If unsure say Y here.
824 949
825config KALLSYMS 950config KALLSYMS
826 bool "Load all symbols for debugging/ksymoops" if EMBEDDED 951 bool "Load all symbols for debugging/ksymoops" if EXPERT
827 default y 952 default y
828 help 953 help
829 Say Y here to let the kernel print out symbolic crash information and 954 Say Y here to let the kernel print out symbolic crash information and
@@ -834,27 +959,21 @@ config KALLSYMS_ALL
834 bool "Include all symbols in kallsyms" 959 bool "Include all symbols in kallsyms"
835 depends on DEBUG_KERNEL && KALLSYMS 960 depends on DEBUG_KERNEL && KALLSYMS
836 help 961 help
837 Normally kallsyms only contains the symbols of functions, for nicer 962 Normally kallsyms only contains the symbols of functions for nicer
838 OOPS messages. Some debuggers can use kallsyms for other 963 OOPS messages and backtraces (i.e., symbols from the text and inittext
839 symbols too: say Y here to include all symbols, if you need them 964 sections). This is sufficient for most cases. And only in very rare
840 and you don't care about adding 300k to the size of your kernel. 965 cases (e.g., when a debugger is used) all symbols are required (e.g.,
966 names of variables from the data sections, etc).
841 967
842 Say N. 968 This option makes sure that all symbols are loaded into the kernel
843 969 image (i.e., symbols from all sections) in cost of increased kernel
844config KALLSYMS_EXTRA_PASS 970 size (depending on the kernel configuration, it may be 300KiB or
845 bool "Do an extra kallsyms pass" 971 something like this).
846 depends on KALLSYMS
847 help
848 If kallsyms is not working correctly, the build will fail with
849 inconsistent kallsyms data. If that occurs, log a bug report and
850 turn on KALLSYMS_EXTRA_PASS which should result in a stable build.
851 Always say N here unless you find a bug in kallsyms, which must be
852 reported. KALLSYMS_EXTRA_PASS is only a temporary workaround while
853 you wait for kallsyms to be fixed.
854 972
973 Say N unless you really need all symbols.
855 974
856config HOTPLUG 975config HOTPLUG
857 bool "Support for hot-pluggable devices" if EMBEDDED 976 bool "Support for hot-pluggable devices" if EXPERT
858 default y 977 default y
859 help 978 help
860 This option is provided for the case where no hotplug or uevent 979 This option is provided for the case where no hotplug or uevent
@@ -864,7 +983,7 @@ config HOTPLUG
864 983
865config PRINTK 984config PRINTK
866 default y 985 default y
867 bool "Enable support for printk" if EMBEDDED 986 bool "Enable support for printk" if EXPERT
868 help 987 help
869 This option enables normal printk support. Removing it 988 This option enables normal printk support. Removing it
870 eliminates most of the message strings from the kernel image 989 eliminates most of the message strings from the kernel image
@@ -873,7 +992,7 @@ config PRINTK
873 strongly discouraged. 992 strongly discouraged.
874 993
875config BUG 994config BUG
876 bool "BUG() support" if EMBEDDED 995 bool "BUG() support" if EXPERT
877 default y 996 default y
878 help 997 help
879 Disabling this option eliminates support for BUG and WARN, reducing 998 Disabling this option eliminates support for BUG and WARN, reducing
@@ -884,12 +1003,12 @@ config BUG
884 1003
885config ELF_CORE 1004config ELF_CORE
886 default y 1005 default y
887 bool "Enable ELF core dumps" if EMBEDDED 1006 bool "Enable ELF core dumps" if EXPERT
888 help 1007 help
889 Enable support for generating core dumps. Disabling saves about 4k. 1008 Enable support for generating core dumps. Disabling saves about 4k.
890 1009
891config PCSPKR_PLATFORM 1010config PCSPKR_PLATFORM
892 bool "Enable PC-Speaker support" if EMBEDDED 1011 bool "Enable PC-Speaker support" if EXPERT
893 depends on ALPHA || X86 || MIPS || PPC_PREP || PPC_CHRP || PPC_PSERIES 1012 depends on ALPHA || X86 || MIPS || PPC_PREP || PPC_CHRP || PPC_PSERIES
894 default y 1013 default y
895 help 1014 help
@@ -898,14 +1017,14 @@ config PCSPKR_PLATFORM
898 1017
899config BASE_FULL 1018config BASE_FULL
900 default y 1019 default y
901 bool "Enable full-sized data structures for core" if EMBEDDED 1020 bool "Enable full-sized data structures for core" if EXPERT
902 help 1021 help
903 Disabling this option reduces the size of miscellaneous core 1022 Disabling this option reduces the size of miscellaneous core
904 kernel data structures. This saves memory on small machines, 1023 kernel data structures. This saves memory on small machines,
905 but may reduce performance. 1024 but may reduce performance.
906 1025
907config FUTEX 1026config FUTEX
908 bool "Enable futex support" if EMBEDDED 1027 bool "Enable futex support" if EXPERT
909 default y 1028 default y
910 select RT_MUTEXES 1029 select RT_MUTEXES
911 help 1030 help
@@ -914,7 +1033,7 @@ config FUTEX
914 run glibc-based applications correctly. 1033 run glibc-based applications correctly.
915 1034
916config EPOLL 1035config EPOLL
917 bool "Enable eventpoll support" if EMBEDDED 1036 bool "Enable eventpoll support" if EXPERT
918 default y 1037 default y
919 select ANON_INODES 1038 select ANON_INODES
920 help 1039 help
@@ -922,7 +1041,7 @@ config EPOLL
922 support for epoll family of system calls. 1041 support for epoll family of system calls.
923 1042
924config SIGNALFD 1043config SIGNALFD
925 bool "Enable signalfd() system call" if EMBEDDED 1044 bool "Enable signalfd() system call" if EXPERT
926 select ANON_INODES 1045 select ANON_INODES
927 default y 1046 default y
928 help 1047 help
@@ -932,7 +1051,7 @@ config SIGNALFD
932 If unsure, say Y. 1051 If unsure, say Y.
933 1052
934config TIMERFD 1053config TIMERFD
935 bool "Enable timerfd() system call" if EMBEDDED 1054 bool "Enable timerfd() system call" if EXPERT
936 select ANON_INODES 1055 select ANON_INODES
937 default y 1056 default y
938 help 1057 help
@@ -942,7 +1061,7 @@ config TIMERFD
942 If unsure, say Y. 1061 If unsure, say Y.
943 1062
944config EVENTFD 1063config EVENTFD
945 bool "Enable eventfd() system call" if EMBEDDED 1064 bool "Enable eventfd() system call" if EXPERT
946 select ANON_INODES 1065 select ANON_INODES
947 default y 1066 default y
948 help 1067 help
@@ -952,7 +1071,7 @@ config EVENTFD
952 If unsure, say Y. 1071 If unsure, say Y.
953 1072
954config SHMEM 1073config SHMEM
955 bool "Use full shmem filesystem" if EMBEDDED 1074 bool "Use full shmem filesystem" if EXPERT
956 default y 1075 default y
957 depends on MMU 1076 depends on MMU
958 help 1077 help
@@ -963,13 +1082,21 @@ config SHMEM
963 which may be appropriate on small systems without swap. 1082 which may be appropriate on small systems without swap.
964 1083
965config AIO 1084config AIO
966 bool "Enable AIO support" if EMBEDDED 1085 bool "Enable AIO support" if EXPERT
967 default y 1086 default y
968 help 1087 help
969 This option enables POSIX asynchronous I/O which may by used 1088 This option enables POSIX asynchronous I/O which may by used
970 by some high performance threaded applications. Disabling 1089 by some high performance threaded applications. Disabling
971 this option saves about 7k. 1090 this option saves about 7k.
972 1091
1092config EMBEDDED
1093 bool "Embedded system"
1094 select EXPERT
1095 help
1096 This option should be enabled if compiling the kernel for
1097 an embedded system so certain expert options are available
1098 for configuration.
1099
973config HAVE_PERF_EVENTS 1100config HAVE_PERF_EVENTS
974 bool 1101 bool
975 help 1102 help
@@ -987,6 +1114,7 @@ config PERF_EVENTS
987 default y if (PROFILING || PERF_COUNTERS) 1114 default y if (PROFILING || PERF_COUNTERS)
988 depends on HAVE_PERF_EVENTS 1115 depends on HAVE_PERF_EVENTS
989 select ANON_INODES 1116 select ANON_INODES
1117 select IRQ_WORK
990 help 1118 help
991 Enable kernel support for various performance events provided 1119 Enable kernel support for various performance events provided
992 by software and hardware. 1120 by software and hardware.
@@ -1039,16 +1167,16 @@ endmenu
1039 1167
1040config VM_EVENT_COUNTERS 1168config VM_EVENT_COUNTERS
1041 default y 1169 default y
1042 bool "Enable VM event counters for /proc/vmstat" if EMBEDDED 1170 bool "Enable VM event counters for /proc/vmstat" if EXPERT
1043 help 1171 help
1044 VM event counters are needed for event counts to be shown. 1172 VM event counters are needed for event counts to be shown.
1045 This option allows the disabling of the VM event counters 1173 This option allows the disabling of the VM event counters
1046 on EMBEDDED systems. /proc/vmstat will only show page counts 1174 on EXPERT systems. /proc/vmstat will only show page counts
1047 if VM event counters are disabled. 1175 if VM event counters are disabled.
1048 1176
1049config PCI_QUIRKS 1177config PCI_QUIRKS
1050 default y 1178 default y
1051 bool "Enable PCI quirk workarounds" if EMBEDDED 1179 bool "Enable PCI quirk workarounds" if EXPERT
1052 depends on PCI 1180 depends on PCI
1053 help 1181 help
1054 This enables workarounds for various PCI chipset 1182 This enables workarounds for various PCI chipset
@@ -1057,7 +1185,7 @@ config PCI_QUIRKS
1057 1185
1058config SLUB_DEBUG 1186config SLUB_DEBUG
1059 default y 1187 default y
1060 bool "Enable SLUB debugging support" if EMBEDDED 1188 bool "Enable SLUB debugging support" if EXPERT
1061 depends on SLUB && SYSFS 1189 depends on SLUB && SYSFS
1062 help 1190 help
1063 SLUB has extensive debug support features. Disabling these can 1191 SLUB has extensive debug support features. Disabling these can
@@ -1101,7 +1229,7 @@ config SLUB
1101 a slab allocator. 1229 a slab allocator.
1102 1230
1103config SLOB 1231config SLOB
1104 depends on EMBEDDED 1232 depends on EXPERT
1105 bool "SLOB (Simple Allocator)" 1233 bool "SLOB (Simple Allocator)"
1106 help 1234 help
1107 SLOB replaces the stock allocator with a drastically simpler 1235 SLOB replaces the stock allocator with a drastically simpler
@@ -1112,7 +1240,7 @@ endchoice
1112 1240
1113config MMAP_ALLOW_UNINITIALIZED 1241config MMAP_ALLOW_UNINITIALIZED
1114 bool "Allow mmapped anonymous memory to be uninitialized" 1242 bool "Allow mmapped anonymous memory to be uninitialized"
1115 depends on EMBEDDED && !MMU 1243 depends on EXPERT && !MMU
1116 default n 1244 default n
1117 help 1245 help
1118 Normally, and according to the Linux spec, anonymous memory obtained 1246 Normally, and according to the Linux spec, anonymous memory obtained
diff --git a/init/calibrate.c b/init/calibrate.c
index 6eb48e53d61c..aae2f40fea4c 100644
--- a/init/calibrate.c
+++ b/init/calibrate.c
@@ -38,6 +38,9 @@ static unsigned long __cpuinit calibrate_delay_direct(void)
38 unsigned long timer_rate_min, timer_rate_max; 38 unsigned long timer_rate_min, timer_rate_max;
39 unsigned long good_timer_sum = 0; 39 unsigned long good_timer_sum = 0;
40 unsigned long good_timer_count = 0; 40 unsigned long good_timer_count = 0;
41 unsigned long measured_times[MAX_DIRECT_CALIBRATION_RETRIES];
42 int max = -1; /* index of measured_times with max/min values or not set */
43 int min = -1;
41 int i; 44 int i;
42 45
43 if (read_current_timer(&pre_start) < 0 ) 46 if (read_current_timer(&pre_start) < 0 )
@@ -66,7 +69,7 @@ static unsigned long __cpuinit calibrate_delay_direct(void)
66 pre_start = 0; 69 pre_start = 0;
67 read_current_timer(&start); 70 read_current_timer(&start);
68 start_jiffies = jiffies; 71 start_jiffies = jiffies;
69 while (jiffies <= (start_jiffies + 1)) { 72 while (time_before_eq(jiffies, start_jiffies + 1)) {
70 pre_start = start; 73 pre_start = start;
71 read_current_timer(&start); 74 read_current_timer(&start);
72 } 75 }
@@ -74,8 +77,8 @@ static unsigned long __cpuinit calibrate_delay_direct(void)
74 77
75 pre_end = 0; 78 pre_end = 0;
76 end = post_start; 79 end = post_start;
77 while (jiffies <= 80 while (time_before_eq(jiffies, start_jiffies + 1 +
78 (start_jiffies + 1 + DELAY_CALIBRATION_TICKS)) { 81 DELAY_CALIBRATION_TICKS)) {
79 pre_end = end; 82 pre_end = end;
80 read_current_timer(&end); 83 read_current_timer(&end);
81 } 84 }
@@ -90,18 +93,75 @@ static unsigned long __cpuinit calibrate_delay_direct(void)
90 * If the upper limit and lower limit of the timer_rate is 93 * If the upper limit and lower limit of the timer_rate is
91 * >= 12.5% apart, redo calibration. 94 * >= 12.5% apart, redo calibration.
92 */ 95 */
93 if (pre_start != 0 && pre_end != 0 && 96 if (start >= post_end)
97 printk(KERN_NOTICE "calibrate_delay_direct() ignoring "
98 "timer_rate as we had a TSC wrap around"
99 " start=%lu >=post_end=%lu\n",
100 start, post_end);
101 if (start < post_end && pre_start != 0 && pre_end != 0 &&
94 (timer_rate_max - timer_rate_min) < (timer_rate_max >> 3)) { 102 (timer_rate_max - timer_rate_min) < (timer_rate_max >> 3)) {
95 good_timer_count++; 103 good_timer_count++;
96 good_timer_sum += timer_rate_max; 104 good_timer_sum += timer_rate_max;
97 } 105 measured_times[i] = timer_rate_max;
106 if (max < 0 || timer_rate_max > measured_times[max])
107 max = i;
108 if (min < 0 || timer_rate_max < measured_times[min])
109 min = i;
110 } else
111 measured_times[i] = 0;
112
98 } 113 }
99 114
100 if (good_timer_count) 115 /*
101 return (good_timer_sum/good_timer_count); 116 * Find the maximum & minimum - if they differ too much throw out the
117 * one with the largest difference from the mean and try again...
118 */
119 while (good_timer_count > 1) {
120 unsigned long estimate;
121 unsigned long maxdiff;
122
123 /* compute the estimate */
124 estimate = (good_timer_sum/good_timer_count);
125 maxdiff = estimate >> 3;
126
127 /* if range is within 12% let's take it */
128 if ((measured_times[max] - measured_times[min]) < maxdiff)
129 return estimate;
130
131 /* ok - drop the worse value and try again... */
132 good_timer_sum = 0;
133 good_timer_count = 0;
134 if ((measured_times[max] - estimate) <
135 (estimate - measured_times[min])) {
136 printk(KERN_NOTICE "calibrate_delay_direct() dropping "
137 "min bogoMips estimate %d = %lu\n",
138 min, measured_times[min]);
139 measured_times[min] = 0;
140 min = max;
141 } else {
142 printk(KERN_NOTICE "calibrate_delay_direct() dropping "
143 "max bogoMips estimate %d = %lu\n",
144 max, measured_times[max]);
145 measured_times[max] = 0;
146 max = min;
147 }
148
149 for (i = 0; i < MAX_DIRECT_CALIBRATION_RETRIES; i++) {
150 if (measured_times[i] == 0)
151 continue;
152 good_timer_count++;
153 good_timer_sum += measured_times[i];
154 if (measured_times[i] < measured_times[min])
155 min = i;
156 if (measured_times[i] > measured_times[max])
157 max = i;
158 }
102 159
103 printk(KERN_WARNING "calibrate_delay_direct() failed to get a good " 160 }
104 "estimate for loops_per_jiffy.\nProbably due to long platform interrupts. Consider using \"lpj=\" boot option.\n"); 161
162 printk(KERN_NOTICE "calibrate_delay_direct() failed to get a good "
163 "estimate for loops_per_jiffy.\nProbably due to long platform "
164 "interrupts. Consider using \"lpj=\" boot option.\n");
105 return 0; 165 return 0;
106} 166}
107#else 167#else
@@ -110,8 +170,8 @@ static unsigned long __cpuinit calibrate_delay_direct(void) {return 0;}
110 170
111/* 171/*
112 * This is the number of bits of precision for the loops_per_jiffy. Each 172 * This is the number of bits of precision for the loops_per_jiffy. Each
113 * bit takes on average 1.5/HZ seconds. This (like the original) is a little 173 * time we refine our estimate after the first takes 1.5/HZ seconds, so try
114 * better than 1% 174 * to start with a good estimate.
115 * For the boot cpu we can skip the delay calibration and assign it a value 175 * For the boot cpu we can skip the delay calibration and assign it a value
116 * calculated based on the timer frequency. 176 * calculated based on the timer frequency.
117 * For the rest of the CPUs we cannot assume that the timer frequency is same as 177 * For the rest of the CPUs we cannot assume that the timer frequency is same as
@@ -119,64 +179,98 @@ static unsigned long __cpuinit calibrate_delay_direct(void) {return 0;}
119 */ 179 */
120#define LPS_PREC 8 180#define LPS_PREC 8
121 181
182static unsigned long __cpuinit calibrate_delay_converge(void)
183{
184 /* First stage - slowly accelerate to find initial bounds */
185 unsigned long lpj, lpj_base, ticks, loopadd, loopadd_base, chop_limit;
186 int trials = 0, band = 0, trial_in_band = 0;
187
188 lpj = (1<<12);
189
190 /* wait for "start of" clock tick */
191 ticks = jiffies;
192 while (ticks == jiffies)
193 ; /* nothing */
194 /* Go .. */
195 ticks = jiffies;
196 do {
197 if (++trial_in_band == (1<<band)) {
198 ++band;
199 trial_in_band = 0;
200 }
201 __delay(lpj * band);
202 trials += band;
203 } while (ticks == jiffies);
204 /*
205 * We overshot, so retreat to a clear underestimate. Then estimate
206 * the largest likely undershoot. This defines our chop bounds.
207 */
208 trials -= band;
209 loopadd_base = lpj * band;
210 lpj_base = lpj * trials;
211
212recalibrate:
213 lpj = lpj_base;
214 loopadd = loopadd_base;
215
216 /*
217 * Do a binary approximation to get lpj set to
218 * equal one clock (up to LPS_PREC bits)
219 */
220 chop_limit = lpj >> LPS_PREC;
221 while (loopadd > chop_limit) {
222 lpj += loopadd;
223 ticks = jiffies;
224 while (ticks == jiffies)
225 ; /* nothing */
226 ticks = jiffies;
227 __delay(lpj);
228 if (jiffies != ticks) /* longer than 1 tick */
229 lpj -= loopadd;
230 loopadd >>= 1;
231 }
232 /*
233 * If we incremented every single time possible, presume we've
234 * massively underestimated initially, and retry with a higher
235 * start, and larger range. (Only seen on x86_64, due to SMIs)
236 */
237 if (lpj + loopadd * 2 == lpj_base + loopadd_base * 2) {
238 lpj_base = lpj;
239 loopadd_base <<= 2;
240 goto recalibrate;
241 }
242
243 return lpj;
244}
245
122void __cpuinit calibrate_delay(void) 246void __cpuinit calibrate_delay(void)
123{ 247{
124 unsigned long ticks, loopbit; 248 unsigned long lpj;
125 int lps_precision = LPS_PREC;
126 static bool printed; 249 static bool printed;
127 250
128 if (preset_lpj) { 251 if (preset_lpj) {
129 loops_per_jiffy = preset_lpj; 252 lpj = preset_lpj;
130 if (!printed) 253 if (!printed)
131 pr_info("Calibrating delay loop (skipped) " 254 pr_info("Calibrating delay loop (skipped) "
132 "preset value.. "); 255 "preset value.. ");
133 } else if ((!printed) && lpj_fine) { 256 } else if ((!printed) && lpj_fine) {
134 loops_per_jiffy = lpj_fine; 257 lpj = lpj_fine;
135 pr_info("Calibrating delay loop (skipped), " 258 pr_info("Calibrating delay loop (skipped), "
136 "value calculated using timer frequency.. "); 259 "value calculated using timer frequency.. ");
137 } else if ((loops_per_jiffy = calibrate_delay_direct()) != 0) { 260 } else if ((lpj = calibrate_delay_direct()) != 0) {
138 if (!printed) 261 if (!printed)
139 pr_info("Calibrating delay using timer " 262 pr_info("Calibrating delay using timer "
140 "specific routine.. "); 263 "specific routine.. ");
141 } else { 264 } else {
142 loops_per_jiffy = (1<<12);
143
144 if (!printed) 265 if (!printed)
145 pr_info("Calibrating delay loop... "); 266 pr_info("Calibrating delay loop... ");
146 while ((loops_per_jiffy <<= 1) != 0) { 267 lpj = calibrate_delay_converge();
147 /* wait for "start of" clock tick */
148 ticks = jiffies;
149 while (ticks == jiffies)
150 /* nothing */;
151 /* Go .. */
152 ticks = jiffies;
153 __delay(loops_per_jiffy);
154 ticks = jiffies - ticks;
155 if (ticks)
156 break;
157 }
158
159 /*
160 * Do a binary approximation to get loops_per_jiffy set to
161 * equal one clock (up to lps_precision bits)
162 */
163 loops_per_jiffy >>= 1;
164 loopbit = loops_per_jiffy;
165 while (lps_precision-- && (loopbit >>= 1)) {
166 loops_per_jiffy |= loopbit;
167 ticks = jiffies;
168 while (ticks == jiffies)
169 /* nothing */;
170 ticks = jiffies;
171 __delay(loops_per_jiffy);
172 if (jiffies != ticks) /* longer than 1 tick */
173 loops_per_jiffy &= ~loopbit;
174 }
175 } 268 }
176 if (!printed) 269 if (!printed)
177 pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n", 270 pr_cont("%lu.%02lu BogoMIPS (lpj=%lu)\n",
178 loops_per_jiffy/(500000/HZ), 271 lpj/(500000/HZ),
179 (loops_per_jiffy/(5000/HZ)) % 100, loops_per_jiffy); 272 (lpj/(5000/HZ)) % 100, lpj);
180 273
274 loops_per_jiffy = lpj;
181 printed = true; 275 printed = true;
182} 276}
diff --git a/init/do_mounts.c b/init/do_mounts.c
index 02e3ca4fc527..c0851a8e030c 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 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
@@ -116,7 +186,7 @@ dev_t name_to_dev_t(char *name)
116 goto done; 186 goto done;
117 187
118 /* 188 /*
119 * try non-existant, but valid partition, which may only exist 189 * try non-existent, but valid partition, which may only exist
120 * after revalidating the disk, like partitioned md devices 190 * after revalidating the disk, like partitioned md devices
121 */ 191 */
122 while (p > s && isdigit(p[-1])) 192 while (p > s && isdigit(p[-1]))
@@ -221,9 +291,10 @@ static int __init do_mount_root(char *name, char *fs, int flags, void *data)
221 if (err) 291 if (err)
222 return err; 292 return err;
223 293
224 sys_chdir("/root"); 294 sys_chdir((const char __user __force *)"/root");
225 ROOT_DEV = current->fs->pwd.mnt->mnt_sb->s_dev; 295 ROOT_DEV = current->fs->pwd.mnt->mnt_sb->s_dev;
226 printk("VFS: Mounted root (%s filesystem)%s on device %u:%u.\n", 296 printk(KERN_INFO
297 "VFS: Mounted root (%s filesystem)%s on device %u:%u.\n",
227 current->fs->pwd.mnt->mnt_sb->s_type->name, 298 current->fs->pwd.mnt->mnt_sb->s_type->name,
228 current->fs->pwd.mnt->mnt_sb->s_flags & MS_RDONLY ? 299 current->fs->pwd.mnt->mnt_sb->s_flags & MS_RDONLY ?
229 " readonly" : "", MAJOR(ROOT_DEV), MINOR(ROOT_DEV)); 300 " readonly" : "", MAJOR(ROOT_DEV), MINOR(ROOT_DEV));
@@ -291,13 +362,13 @@ out:
291#ifdef CONFIG_ROOT_NFS 362#ifdef CONFIG_ROOT_NFS
292static int __init mount_nfs_root(void) 363static int __init mount_nfs_root(void)
293{ 364{
294 void *data = nfs_root_data(); 365 char *root_dev, *root_data;
295 366
296 create_dev("/dev/root", ROOT_DEV); 367 if (nfs_root_data(&root_dev, &root_data) != 0)
297 if (data && 368 return 0;
298 do_mount_root("/dev/root", "nfs", root_mountflags, data) == 0) 369 if (do_mount_root(root_dev, "nfs", root_mountflags, root_data) != 0)
299 return 1; 370 return 0;
300 return 0; 371 return 1;
301} 372}
302#endif 373#endif
303 374
@@ -418,5 +489,5 @@ void __init prepare_namespace(void)
418out: 489out:
419 devtmpfs_mount("dev"); 490 devtmpfs_mount("dev");
420 sys_mount(".", "/", NULL, MS_MOVE, NULL); 491 sys_mount(".", "/", NULL, MS_MOVE, NULL);
421 sys_chroot("."); 492 sys_chroot((const char __user __force *)".");
422} 493}
diff --git a/init/do_mounts_md.c b/init/do_mounts_md.c
index 69aebbf8fd2d..32c4799b8c91 100644
--- a/init/do_mounts_md.c
+++ b/init/do_mounts_md.c
@@ -283,7 +283,7 @@ static void __init autodetect_raid(void)
283 283
284 wait_for_device_probe(); 284 wait_for_device_probe();
285 285
286 fd = sys_open("/dev/md0", 0, 0); 286 fd = sys_open((const char __user __force *) "/dev/md0", 0, 0);
287 if (fd >= 0) { 287 if (fd >= 0) {
288 sys_ioctl(fd, RAID_AUTORUN, raid_autopart); 288 sys_ioctl(fd, RAID_AUTORUN, raid_autopart);
289 sys_close(fd); 289 sys_close(fd);
diff --git a/init/do_mounts_rd.c b/init/do_mounts_rd.c
index bf3ef667bf36..fe9acb0ae480 100644
--- a/init/do_mounts_rd.c
+++ b/init/do_mounts_rd.c
@@ -64,7 +64,7 @@ identify_ramdisk_image(int fd, int start_block, decompress_fn *decompressor)
64 64
65 buf = kmalloc(size, GFP_KERNEL); 65 buf = kmalloc(size, GFP_KERNEL);
66 if (!buf) 66 if (!buf)
67 return -1; 67 return -ENOMEM;
68 68
69 minixsb = (struct minix_super_block *) buf; 69 minixsb = (struct minix_super_block *) buf;
70 ext2sb = (struct ext2_super_block *) buf; 70 ext2sb = (struct ext2_super_block *) buf;
@@ -168,7 +168,7 @@ int __init rd_load_image(char *from)
168 char rotator[4] = { '|' , '/' , '-' , '\\' }; 168 char rotator[4] = { '|' , '/' , '-' , '\\' };
169#endif 169#endif
170 170
171 out_fd = sys_open("/dev/ram", O_RDWR, 0); 171 out_fd = sys_open((const char __user __force *) "/dev/ram", O_RDWR, 0);
172 if (out_fd < 0) 172 if (out_fd < 0)
173 goto out; 173 goto out;
174 174
@@ -267,7 +267,7 @@ noclose_input:
267 sys_close(out_fd); 267 sys_close(out_fd);
268out: 268out:
269 kfree(buf); 269 kfree(buf);
270 sys_unlink("/dev/ram"); 270 sys_unlink((const char __user __force *) "/dev/ram");
271 return res; 271 return res;
272} 272}
273 273
diff --git a/init/initramfs.c b/init/initramfs.c
index 4b9c20205092..2531811d42cb 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -483,7 +483,8 @@ static int __init retain_initrd_param(char *str)
483} 483}
484__setup("retain_initrd", retain_initrd_param); 484__setup("retain_initrd", retain_initrd_param);
485 485
486extern char __initramfs_start[], __initramfs_end[]; 486extern char __initramfs_start[];
487extern unsigned long __initramfs_size;
487#include <linux/initrd.h> 488#include <linux/initrd.h>
488#include <linux/kexec.h> 489#include <linux/kexec.h>
489 490
@@ -528,7 +529,7 @@ static void __init clean_rootfs(void)
528 struct linux_dirent64 *dirp; 529 struct linux_dirent64 *dirp;
529 int num; 530 int num;
530 531
531 fd = sys_open("/", O_RDONLY, 0); 532 fd = sys_open((const char __user __force *) "/", O_RDONLY, 0);
532 WARN_ON(fd < 0); 533 WARN_ON(fd < 0);
533 if (fd < 0) 534 if (fd < 0)
534 return; 535 return;
@@ -570,8 +571,7 @@ static void __init clean_rootfs(void)
570 571
571static int __init populate_rootfs(void) 572static int __init populate_rootfs(void)
572{ 573{
573 char *err = unpack_to_rootfs(__initramfs_start, 574 char *err = unpack_to_rootfs(__initramfs_start, __initramfs_size);
574 __initramfs_end - __initramfs_start);
575 if (err) 575 if (err)
576 panic(err); /* Failed to decompress INTERNAL initramfs */ 576 panic(err); /* Failed to decompress INTERNAL initramfs */
577 if (initrd_start) { 577 if (initrd_start) {
@@ -585,12 +585,12 @@ static int __init populate_rootfs(void)
585 return 0; 585 return 0;
586 } else { 586 } else {
587 clean_rootfs(); 587 clean_rootfs();
588 unpack_to_rootfs(__initramfs_start, 588 unpack_to_rootfs(__initramfs_start, __initramfs_size);
589 __initramfs_end - __initramfs_start);
590 } 589 }
591 printk(KERN_INFO "rootfs image is not initramfs (%s)" 590 printk(KERN_INFO "rootfs image is not initramfs (%s)"
592 "; looks like an initrd\n", err); 591 "; looks like an initrd\n", err);
593 fd = sys_open("/initrd.image", O_WRONLY|O_CREAT, 0700); 592 fd = sys_open((const char __user __force *) "/initrd.image",
593 O_WRONLY|O_CREAT, 0700);
594 if (fd >= 0) { 594 if (fd >= 0) {
595 sys_write(fd, (char *)initrd_start, 595 sys_write(fd, (char *)initrd_start,
596 initrd_end - initrd_start); 596 initrd_end - initrd_start);
diff --git a/init/main.c b/init/main.c
index 94ab488039aa..d7211faed2ad 100644
--- a/init/main.c
+++ b/init/main.c
@@ -20,7 +20,6 @@
20#include <linux/delay.h> 20#include <linux/delay.h>
21#include <linux/ioport.h> 21#include <linux/ioport.h>
22#include <linux/init.h> 22#include <linux/init.h>
23#include <linux/smp_lock.h>
24#include <linux/initrd.h> 23#include <linux/initrd.h>
25#include <linux/bootmem.h> 24#include <linux/bootmem.h>
26#include <linux/acpi.h> 25#include <linux/acpi.h>
@@ -68,6 +67,7 @@
68#include <linux/sfi.h> 67#include <linux/sfi.h>
69#include <linux/shmem_fs.h> 68#include <linux/shmem_fs.h>
70#include <linux/slab.h> 69#include <linux/slab.h>
70#include <linux/perf_event.h>
71 71
72#include <asm/io.h> 72#include <asm/io.h>
73#include <asm/bugs.h> 73#include <asm/bugs.h>
@@ -96,6 +96,15 @@ static inline void mark_rodata_ro(void) { }
96extern void tc_init(void); 96extern void tc_init(void);
97#endif 97#endif
98 98
99/*
100 * Debug helper: via this flag we know that we are in 'early bootup code'
101 * where only the boot processor is running with IRQ disabled. This means
102 * two things - IRQ must not be enabled before the flag is cleared and some
103 * operations which are not allowed with IRQ disabled are allowed while the
104 * flag is set.
105 */
106bool early_boot_irqs_disabled __read_mostly;
107
99enum system_states system_state __read_mostly; 108enum system_states system_state __read_mostly;
100EXPORT_SYMBOL(system_state); 109EXPORT_SYMBOL(system_state);
101 110
@@ -120,63 +129,6 @@ static char *static_command_line;
120static char *execute_command; 129static char *execute_command;
121static char *ramdisk_execute_command; 130static char *ramdisk_execute_command;
122 131
123#ifdef CONFIG_SMP
124/* Setup configured maximum number of CPUs to activate */
125unsigned int setup_max_cpus = NR_CPUS;
126EXPORT_SYMBOL(setup_max_cpus);
127
128
129/*
130 * Setup routine for controlling SMP activation
131 *
132 * Command-line option of "nosmp" or "maxcpus=0" will disable SMP
133 * activation entirely (the MPS table probe still happens, though).
134 *
135 * Command-line option of "maxcpus=<NUM>", where <NUM> is an integer
136 * greater than 0, limits the maximum number of CPUs activated in
137 * SMP mode to <NUM>.
138 */
139
140void __weak arch_disable_smp_support(void) { }
141
142static int __init nosmp(char *str)
143{
144 setup_max_cpus = 0;
145 arch_disable_smp_support();
146
147 return 0;
148}
149
150early_param("nosmp", nosmp);
151
152/* this is hard limit */
153static int __init nrcpus(char *str)
154{
155 int nr_cpus;
156
157 get_option(&str, &nr_cpus);
158 if (nr_cpus > 0 && nr_cpus < nr_cpu_ids)
159 nr_cpu_ids = nr_cpus;
160
161 return 0;
162}
163
164early_param("nr_cpus", nrcpus);
165
166static int __init maxcpus(char *str)
167{
168 get_option(&str, &setup_max_cpus);
169 if (setup_max_cpus == 0)
170 arch_disable_smp_support();
171
172 return 0;
173}
174
175early_param("maxcpus", maxcpus);
176#else
177static const unsigned int setup_max_cpus = NR_CPUS;
178#endif
179
180/* 132/*
181 * If set, this is an indication to the drivers that reset the underlying 133 * If set, this is an indication to the drivers that reset the underlying
182 * device before going ahead with the initialization otherwise driver might 134 * device before going ahead with the initialization otherwise driver might
@@ -353,7 +305,7 @@ static int __init rdinit_setup(char *str)
353__setup("rdinit=", rdinit_setup); 305__setup("rdinit=", rdinit_setup);
354 306
355#ifndef CONFIG_SMP 307#ifndef CONFIG_SMP
356 308static const unsigned int setup_max_cpus = NR_CPUS;
357#ifdef CONFIG_X86_LOCAL_APIC 309#ifdef CONFIG_X86_LOCAL_APIC
358static void __init smp_init(void) 310static void __init smp_init(void)
359{ 311{
@@ -365,37 +317,6 @@ static void __init smp_init(void)
365 317
366static inline void setup_nr_cpu_ids(void) { } 318static inline void setup_nr_cpu_ids(void) { }
367static inline void smp_prepare_cpus(unsigned int maxcpus) { } 319static inline void smp_prepare_cpus(unsigned int maxcpus) { }
368
369#else
370
371/* Setup number of possible processor ids */
372int nr_cpu_ids __read_mostly = NR_CPUS;
373EXPORT_SYMBOL(nr_cpu_ids);
374
375/* An arch may set nr_cpu_ids earlier if needed, so this would be redundant */
376static void __init setup_nr_cpu_ids(void)
377{
378 nr_cpu_ids = find_last_bit(cpumask_bits(cpu_possible_mask),NR_CPUS) + 1;
379}
380
381/* Called by boot processor to activate the rest. */
382static void __init smp_init(void)
383{
384 unsigned int cpu;
385
386 /* FIXME: This should be done in userspace --RR */
387 for_each_present_cpu(cpu) {
388 if (num_online_cpus() >= setup_max_cpus)
389 break;
390 if (!cpu_online(cpu))
391 cpu_up(cpu);
392 }
393
394 /* Any cleanup work */
395 printk(KERN_INFO "Brought up %ld CPUs\n", (long)num_online_cpus());
396 smp_cpus_done(setup_max_cpus);
397}
398
399#endif 320#endif
400 321
401/* 322/*
@@ -424,7 +345,6 @@ static void __init setup_command_line(char *command_line)
424static __initdata DECLARE_COMPLETION(kthreadd_done); 345static __initdata DECLARE_COMPLETION(kthreadd_done);
425 346
426static noinline void __init_refok rest_init(void) 347static noinline void __init_refok rest_init(void)
427 __releases(kernel_lock)
428{ 348{
429 int pid; 349 int pid;
430 350
@@ -555,8 +475,7 @@ asmlinkage void __init start_kernel(void)
555 cgroup_init_early(); 475 cgroup_init_early();
556 476
557 local_irq_disable(); 477 local_irq_disable();
558 early_boot_irqs_off(); 478 early_boot_irqs_disabled = true;
559 early_init_irq_lock_class();
560 479
561/* 480/*
562 * Interrupts are still disabled. Do necessary setups, then 481 * Interrupts are still disabled. Do necessary setups, then
@@ -568,6 +487,7 @@ asmlinkage void __init start_kernel(void)
568 printk(KERN_NOTICE "%s", linux_banner); 487 printk(KERN_NOTICE "%s", linux_banner);
569 setup_arch(&command_line); 488 setup_arch(&command_line);
570 mm_init_owner(&init_mm, &init_task); 489 mm_init_owner(&init_mm, &init_task);
490 mm_init_cpumask(&init_mm);
571 setup_command_line(command_line); 491 setup_command_line(command_line);
572 setup_nr_cpu_ids(); 492 setup_nr_cpu_ids();
573 setup_per_cpu_areas(); 493 setup_per_cpu_areas();
@@ -585,11 +505,13 @@ asmlinkage void __init start_kernel(void)
585 * These use large bootmem allocations and must precede 505 * These use large bootmem allocations and must precede
586 * kmem_cache_init() 506 * kmem_cache_init()
587 */ 507 */
508 setup_log_buf(0);
588 pidhash_init(); 509 pidhash_init();
589 vfs_caches_init_early(); 510 vfs_caches_init_early();
590 sort_main_extable(); 511 sort_main_extable();
591 trap_init(); 512 trap_init();
592 mm_init(); 513 mm_init();
514
593 /* 515 /*
594 * Set up the scheduler prior starting any interrupts (such as the 516 * Set up the scheduler prior starting any interrupts (such as the
595 * timer interrupt). Full topology setup happens at smp_init() 517 * timer interrupt). Full topology setup happens at smp_init()
@@ -606,6 +528,8 @@ asmlinkage void __init start_kernel(void)
606 "enabled *very* early, fixing it\n"); 528 "enabled *very* early, fixing it\n");
607 local_irq_disable(); 529 local_irq_disable();
608 } 530 }
531 idr_init_cache();
532 perf_event_init();
609 rcu_init(); 533 rcu_init();
610 radix_tree_init(); 534 radix_tree_init();
611 /* init some links before init_ISA_irqs() */ 535 /* init some links before init_ISA_irqs() */
@@ -618,10 +542,11 @@ asmlinkage void __init start_kernel(void)
618 timekeeping_init(); 542 timekeeping_init();
619 time_init(); 543 time_init();
620 profile_init(); 544 profile_init();
545 call_function_init();
621 if (!irqs_disabled()) 546 if (!irqs_disabled())
622 printk(KERN_CRIT "start_kernel(): bug: interrupts were " 547 printk(KERN_CRIT "start_kernel(): bug: interrupts were "
623 "enabled early\n"); 548 "enabled early\n");
624 early_boot_irqs_on(); 549 early_boot_irqs_disabled = false;
625 local_irq_enable(); 550 local_irq_enable();
626 551
627 /* Interrupts are enabled now so all GFP allocations are safe. */ 552 /* Interrupts are enabled now so all GFP allocations are safe. */
@@ -659,9 +584,8 @@ asmlinkage void __init start_kernel(void)
659#endif 584#endif
660 page_cgroup_init(); 585 page_cgroup_init();
661 enable_debug_pagealloc(); 586 enable_debug_pagealloc();
662 kmemleak_init();
663 debug_objects_mem_init(); 587 debug_objects_mem_init();
664 idr_init_cache(); 588 kmemleak_init();
665 setup_per_cpu_pageset(); 589 setup_per_cpu_pageset();
666 numa_policy_init(); 590 numa_policy_init();
667 if (late_time_init) 591 if (late_time_init)
@@ -778,9 +702,6 @@ static void __init do_initcalls(void)
778 702
779 for (fn = __early_initcall_end; fn < __initcall_end; fn++) 703 for (fn = __early_initcall_end; fn < __initcall_end; fn++)
780 do_one_initcall(*fn); 704 do_one_initcall(*fn);
781
782 /* Make sure there is no pending stuff from the initcall sequence */
783 flush_scheduled_work();
784} 705}
785 706
786/* 707/*
@@ -819,7 +740,6 @@ static void run_init_process(const char *init_filename)
819 * makes it inline to init() and it becomes part of init.text section 740 * makes it inline to init() and it becomes part of init.text section
820 */ 741 */
821static noinline int init_post(void) 742static noinline int init_post(void)
822 __releases(kernel_lock)
823{ 743{
824 /* need to finish all async __init code before freeing the memory */ 744 /* need to finish all async __init code before freeing the memory */
825 async_synchronize_full(); 745 async_synchronize_full();
@@ -871,21 +791,13 @@ static int __init kernel_init(void * unused)
871 * init can run on any cpu. 791 * init can run on any cpu.
872 */ 792 */
873 set_cpus_allowed_ptr(current, cpu_all_mask); 793 set_cpus_allowed_ptr(current, cpu_all_mask);
874 /*
875 * Tell the world that we're going to be the grim
876 * reaper of innocent orphaned children.
877 *
878 * We don't want people to have to make incorrect
879 * assumptions about where in the task array this
880 * can be found.
881 */
882 init_pid_ns.child_reaper = current;
883 794
884 cad_pid = task_pid(current); 795 cad_pid = task_pid(current);
885 796
886 smp_prepare_cpus(setup_max_cpus); 797 smp_prepare_cpus(setup_max_cpus);
887 798
888 do_pre_smp_initcalls(); 799 do_pre_smp_initcalls();
800 lockup_detector_init();
889 801
890 smp_init(); 802 smp_init();
891 sched_init_smp(); 803 sched_init_smp();
diff --git a/init/noinitramfs.c b/init/noinitramfs.c
index f4c1a3a1b8c5..267739d85179 100644
--- a/init/noinitramfs.c
+++ b/init/noinitramfs.c
@@ -29,17 +29,17 @@ static int __init default_rootfs(void)
29{ 29{
30 int err; 30 int err;
31 31
32 err = sys_mkdir("/dev", 0755); 32 err = sys_mkdir((const char __user __force *) "/dev", 0755);
33 if (err < 0) 33 if (err < 0)
34 goto out; 34 goto out;
35 35
36 err = sys_mknod((const char __user *) "/dev/console", 36 err = sys_mknod((const char __user __force *) "/dev/console",
37 S_IFCHR | S_IRUSR | S_IWUSR, 37 S_IFCHR | S_IRUSR | S_IWUSR,
38 new_encode_dev(MKDEV(5, 1))); 38 new_encode_dev(MKDEV(5, 1)));
39 if (err < 0) 39 if (err < 0)
40 goto out; 40 goto out;
41 41
42 err = sys_mkdir("/root", 0700); 42 err = sys_mkdir((const char __user __force *) "/root", 0700);
43 if (err < 0) 43 if (err < 0)
44 goto out; 44 goto out;
45 45
diff --git a/init/version.c b/init/version.c
index adff586401a5..86fe0ccb997a 100644
--- a/init/version.c
+++ b/init/version.c
@@ -33,6 +33,7 @@ struct uts_namespace init_uts_ns = {
33 .machine = UTS_MACHINE, 33 .machine = UTS_MACHINE,
34 .domainname = UTS_DOMAINNAME, 34 .domainname = UTS_DOMAINNAME,
35 }, 35 },
36 .user_ns = &init_user_ns,
36}; 37};
37EXPORT_SYMBOL_GPL(init_uts_ns); 38EXPORT_SYMBOL_GPL(init_uts_ns);
38 39