aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig94
-rw-r--r--init/main.c36
2 files changed, 112 insertions, 18 deletions
diff --git a/init/Kconfig b/init/Kconfig
index f763762d544a..13627191a60d 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -588,6 +588,13 @@ config KALLSYMS_ALL
588 588
589 Say N. 589 Say N.
590 590
591config KALLSYMS_STRIP_GENERATED
592 bool "Strip machine generated symbols from kallsyms"
593 depends on KALLSYMS_ALL
594 default y
595 help
596 Say N if you want kallsyms to retain even machine generated symbols.
597
591config KALLSYMS_EXTRA_PASS 598config KALLSYMS_EXTRA_PASS
592 bool "Do an extra kallsyms pass" 599 bool "Do an extra kallsyms pass"
593 depends on KALLSYMS 600 depends on KALLSYMS
@@ -808,6 +815,7 @@ config TRACEPOINTS
808 815
809config MARKERS 816config MARKERS
810 bool "Activate markers" 817 bool "Activate markers"
818 depends on TRACEPOINTS
811 help 819 help
812 Place an empty function call at each marker site. Can be 820 Place an empty function call at each marker site. Can be
813 dynamically changed for a probe function. 821 dynamically changed for a probe function.
@@ -928,10 +936,90 @@ source "block/Kconfig"
928config PREEMPT_NOTIFIERS 936config PREEMPT_NOTIFIERS
929 bool 937 bool
930 938
939choice
940 prompt "RCU Implementation"
941 default CLASSIC_RCU
942
931config CLASSIC_RCU 943config CLASSIC_RCU
932 def_bool !PREEMPT_RCU 944 bool "Classic RCU"
933 help 945 help
934 This option selects the classic RCU implementation that is 946 This option selects the classic RCU implementation that is
935 designed for best read-side performance on non-realtime 947 designed for best read-side performance on non-realtime
936 systems. Classic RCU is the default. Note that the 948 systems.
937 PREEMPT_RCU symbol is used to select/deselect this option. 949
950 Select this option if you are unsure.
951
952config TREE_RCU
953 bool "Tree-based hierarchical RCU"
954 help
955 This option selects the RCU implementation that is
956 designed for very large SMP system with hundreds or
957 thousands of CPUs.
958
959config PREEMPT_RCU
960 bool "Preemptible RCU"
961 depends on PREEMPT
962 help
963 This option reduces the latency of the kernel by making certain
964 RCU sections preemptible. Normally RCU code is non-preemptible, if
965 this option is selected then read-only RCU sections become
966 preemptible. This helps latency, but may expose bugs due to
967 now-naive assumptions about each RCU read-side critical section
968 remaining on a given CPU through its execution.
969
970endchoice
971
972config RCU_TRACE
973 bool "Enable tracing for RCU"
974 depends on TREE_RCU || PREEMPT_RCU
975 help
976 This option provides tracing in RCU which presents stats
977 in debugfs for debugging RCU implementation.
978
979 Say Y here if you want to enable RCU tracing
980 Say N if you are unsure.
981
982config RCU_FANOUT
983 int "Tree-based hierarchical RCU fanout value"
984 range 2 64 if 64BIT
985 range 2 32 if !64BIT
986 depends on TREE_RCU
987 default 64 if 64BIT
988 default 32 if !64BIT
989 help
990 This option controls the fanout of hierarchical implementations
991 of RCU, allowing RCU to work efficiently on machines with
992 large numbers of CPUs. This value must be at least the cube
993 root of NR_CPUS, which allows NR_CPUS up to 32,768 for 32-bit
994 systems and up to 262,144 for 64-bit systems.
995
996 Select a specific number if testing RCU itself.
997 Take the default if unsure.
998
999config RCU_FANOUT_EXACT
1000 bool "Disable tree-based hierarchical RCU auto-balancing"
1001 depends on TREE_RCU
1002 default n
1003 help
1004 This option forces use of the exact RCU_FANOUT value specified,
1005 regardless of imbalances in the hierarchy. This is useful for
1006 testing RCU itself, and might one day be useful on systems with
1007 strong NUMA behavior.
1008
1009 Without RCU_FANOUT_EXACT, the code will balance the hierarchy.
1010
1011 Say N if unsure.
1012
1013config TREE_RCU_TRACE
1014 def_bool RCU_TRACE && TREE_RCU
1015 select DEBUG_FS
1016 help
1017 This option provides tracing for the TREE_RCU implementation,
1018 permitting Makefile to trivially select kernel/rcutree_trace.c.
1019
1020config PREEMPT_RCU_TRACE
1021 def_bool RCU_TRACE && PREEMPT_RCU
1022 select DEBUG_FS
1023 help
1024 This option provides tracing for the PREEMPT_RCU implementation,
1025 permitting Makefile to trivially select kernel/rcupreempt_trace.c.
diff --git a/init/main.c b/init/main.c
index 2c183abbf61c..f5e64f20d2b0 100644
--- a/init/main.c
+++ b/init/main.c
@@ -63,6 +63,7 @@
63#include <linux/signal.h> 63#include <linux/signal.h>
64#include <linux/idr.h> 64#include <linux/idr.h>
65#include <linux/ftrace.h> 65#include <linux/ftrace.h>
66#include <trace/boot.h>
66 67
67#include <asm/io.h> 68#include <asm/io.h>
68#include <asm/bugs.h> 69#include <asm/bugs.h>
@@ -671,6 +672,7 @@ asmlinkage void __init start_kernel(void)
671 efi_enter_virtual_mode(); 672 efi_enter_virtual_mode();
672#endif 673#endif
673 thread_info_cache_init(); 674 thread_info_cache_init();
675 cred_init();
674 fork_init(num_physpages); 676 fork_init(num_physpages);
675 proc_caches_init(); 677 proc_caches_init();
676 buffer_init(); 678 buffer_init();
@@ -705,31 +707,35 @@ core_param(initcall_debug, initcall_debug, bool, 0644);
705int do_one_initcall(initcall_t fn) 707int do_one_initcall(initcall_t fn)
706{ 708{
707 int count = preempt_count(); 709 int count = preempt_count();
708 ktime_t delta; 710 ktime_t calltime, delta, rettime;
709 char msgbuf[64]; 711 char msgbuf[64];
710 struct boot_trace it; 712 struct boot_trace_call call;
713 struct boot_trace_ret ret;
711 714
712 if (initcall_debug) { 715 if (initcall_debug) {
713 it.caller = task_pid_nr(current); 716 call.caller = task_pid_nr(current);
714 printk("calling %pF @ %i\n", fn, it.caller); 717 printk("calling %pF @ %i\n", fn, call.caller);
715 it.calltime = ktime_get(); 718 calltime = ktime_get();
719 trace_boot_call(&call, fn);
720 enable_boot_trace();
716 } 721 }
717 722
718 it.result = fn(); 723 ret.result = fn();
719 724
720 if (initcall_debug) { 725 if (initcall_debug) {
721 it.rettime = ktime_get(); 726 disable_boot_trace();
722 delta = ktime_sub(it.rettime, it.calltime); 727 rettime = ktime_get();
723 it.duration = (unsigned long long) delta.tv64 >> 10; 728 delta = ktime_sub(rettime, calltime);
729 ret.duration = (unsigned long long) ktime_to_ns(delta) >> 10;
730 trace_boot_ret(&ret, fn);
724 printk("initcall %pF returned %d after %Ld usecs\n", fn, 731 printk("initcall %pF returned %d after %Ld usecs\n", fn,
725 it.result, it.duration); 732 ret.result, ret.duration);
726 trace_boot(&it, fn);
727 } 733 }
728 734
729 msgbuf[0] = 0; 735 msgbuf[0] = 0;
730 736
731 if (it.result && it.result != -ENODEV && initcall_debug) 737 if (ret.result && ret.result != -ENODEV && initcall_debug)
732 sprintf(msgbuf, "error code %d ", it.result); 738 sprintf(msgbuf, "error code %d ", ret.result);
733 739
734 if (preempt_count() != count) { 740 if (preempt_count() != count) {
735 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); 741 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf));
@@ -743,7 +749,7 @@ int do_one_initcall(initcall_t fn)
743 printk("initcall %pF returned with %s\n", fn, msgbuf); 749 printk("initcall %pF returned with %s\n", fn, msgbuf);
744 } 750 }
745 751
746 return it.result; 752 return ret.result;
747} 753}
748 754
749 755
@@ -884,7 +890,7 @@ static int __init kernel_init(void * unused)
884 * we're essentially up and running. Get rid of the 890 * we're essentially up and running. Get rid of the
885 * initmem segments and start the user-mode stuff.. 891 * initmem segments and start the user-mode stuff..
886 */ 892 */
887 stop_boot_trace(); 893
888 init_post(); 894 init_post();
889 return 0; 895 return 0;
890} 896}