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 c1f999a3cf31..2a7ce0f8e453 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>
@@ -680,6 +681,7 @@ asmlinkage void __init start_kernel(void)
680 efi_enter_virtual_mode(); 681 efi_enter_virtual_mode();
681#endif 682#endif
682 thread_info_cache_init(); 683 thread_info_cache_init();
684 cred_init();
683 fork_init(num_physpages); 685 fork_init(num_physpages);
684 proc_caches_init(); 686 proc_caches_init();
685 buffer_init(); 687 buffer_init();
@@ -714,31 +716,35 @@ core_param(initcall_debug, initcall_debug, bool, 0644);
714int do_one_initcall(initcall_t fn) 716int do_one_initcall(initcall_t fn)
715{ 717{
716 int count = preempt_count(); 718 int count = preempt_count();
717 ktime_t delta; 719 ktime_t calltime, delta, rettime;
718 char msgbuf[64]; 720 char msgbuf[64];
719 struct boot_trace it; 721 struct boot_trace_call call;
722 struct boot_trace_ret ret;
720 723
721 if (initcall_debug) { 724 if (initcall_debug) {
722 it.caller = task_pid_nr(current); 725 call.caller = task_pid_nr(current);
723 printk("calling %pF @ %i\n", fn, it.caller); 726 printk("calling %pF @ %i\n", fn, call.caller);
724 it.calltime = ktime_get(); 727 calltime = ktime_get();
728 trace_boot_call(&call, fn);
729 enable_boot_trace();
725 } 730 }
726 731
727 it.result = fn(); 732 ret.result = fn();
728 733
729 if (initcall_debug) { 734 if (initcall_debug) {
730 it.rettime = ktime_get(); 735 disable_boot_trace();
731 delta = ktime_sub(it.rettime, it.calltime); 736 rettime = ktime_get();
732 it.duration = (unsigned long long) delta.tv64 >> 10; 737 delta = ktime_sub(rettime, calltime);
738 ret.duration = (unsigned long long) ktime_to_ns(delta) >> 10;
739 trace_boot_ret(&ret, fn);
733 printk("initcall %pF returned %d after %Ld usecs\n", fn, 740 printk("initcall %pF returned %d after %Ld usecs\n", fn,
734 it.result, it.duration); 741 ret.result, ret.duration);
735 trace_boot(&it, fn);
736 } 742 }
737 743
738 msgbuf[0] = 0; 744 msgbuf[0] = 0;
739 745
740 if (it.result && it.result != -ENODEV && initcall_debug) 746 if (ret.result && ret.result != -ENODEV && initcall_debug)
741 sprintf(msgbuf, "error code %d ", it.result); 747 sprintf(msgbuf, "error code %d ", ret.result);
742 748
743 if (preempt_count() != count) { 749 if (preempt_count() != count) {
744 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf)); 750 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf));
@@ -752,7 +758,7 @@ int do_one_initcall(initcall_t fn)
752 printk("initcall %pF returned with %s\n", fn, msgbuf); 758 printk("initcall %pF returned with %s\n", fn, msgbuf);
753 } 759 }
754 760
755 return it.result; 761 return ret.result;
756} 762}
757 763
758 764
@@ -893,7 +899,7 @@ static int __init kernel_init(void * unused)
893 * we're essentially up and running. Get rid of the 899 * we're essentially up and running. Get rid of the
894 * initmem segments and start the user-mode stuff.. 900 * initmem segments and start the user-mode stuff..
895 */ 901 */
896 stop_boot_trace(); 902
897 init_post(); 903 init_post();
898 return 0; 904 return 0;
899} 905}