diff options
author | Paul E. McKenney <paul.mckenney@linaro.org> | 2013-02-11 13:23:27 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2013-03-26 11:04:43 -0400 |
commit | 911af505ef407c2511106c224dd640f882f0f590 (patch) | |
tree | 00656ef4be8d1195a568951333dd9618265c6435 | |
parent | 34ed62461ae4970695974afb9a60ac3df0086830 (diff) |
rcu: Provide compile-time control for no-CBs CPUs
Currently, the only way to specify no-CBs CPUs is via the rcu_nocbs
kernel command-line parameter. This is inconvenient in some cases,
particularly for randconfig testing, so this commit adds a new set of
kernel configuration parameters. CONFIG_RCU_NOCB_CPU_NONE (the default)
retains the old behavior, CONFIG_RCU_NOCB_CPU_ZERO offloads callback
processing from CPU 0 (along with any other CPUs specified by the
rcu_nocbs boot-time parameter), and CONFIG_RCU_NOCB_CPU_ALL offloads
callback processing from all CPUs.
Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rw-r--r-- | init/Kconfig | 39 | ||||
-rw-r--r-- | kernel/rcutree_plugin.h | 14 |
2 files changed, 53 insertions, 0 deletions
diff --git a/init/Kconfig b/init/Kconfig index c8bd349eb638..307499704580 100644 --- a/init/Kconfig +++ b/init/Kconfig | |||
@@ -676,6 +676,45 @@ config RCU_NOCB_CPU | |||
676 | Say Y here if you want to help to debug reduced OS jitter. | 676 | Say Y here if you want to help to debug reduced OS jitter. |
677 | Say N here if you are unsure. | 677 | Say N here if you are unsure. |
678 | 678 | ||
679 | choice | ||
680 | prompt "Build-forced no-CBs CPUs" | ||
681 | default RCU_NOCB_CPU_NONE | ||
682 | help | ||
683 | This option allows no-CBs CPUs to be specified at build time. | ||
684 | Additional no-CBs CPUs may be specified by the rcu_nocbs= | ||
685 | boot parameter. | ||
686 | |||
687 | config RCU_NOCB_CPU_NONE | ||
688 | bool "No build_forced no-CBs CPUs" | ||
689 | depends on RCU_NOCB_CPU | ||
690 | help | ||
691 | This option does not force any of the CPUs to be no-CBs CPUs. | ||
692 | Only CPUs designated by the rcu_nocbs= boot parameter will be | ||
693 | no-CBs CPUs. | ||
694 | |||
695 | config RCU_NOCB_CPU_ZERO | ||
696 | bool "CPU 0 is a build_forced no-CBs CPU" | ||
697 | depends on RCU_NOCB_CPU | ||
698 | help | ||
699 | This option forces CPU 0 to be a no-CBs CPU. Additional CPUs | ||
700 | may be designated as no-CBs CPUs using the rcu_nocbs= boot | ||
701 | parameter will be no-CBs CPUs. | ||
702 | |||
703 | Select this if CPU 0 needs to be a no-CBs CPU for real-time | ||
704 | or energy-efficiency reasons. | ||
705 | |||
706 | config RCU_NOCB_CPU_ALL | ||
707 | bool "All CPUs are build_forced no-CBs CPUs" | ||
708 | depends on RCU_NOCB_CPU | ||
709 | help | ||
710 | This option forces all CPUs to be no-CBs CPUs. The rcu_nocbs= | ||
711 | boot parameter will be ignored. | ||
712 | |||
713 | Select this if all CPUs need to be no-CBs CPUs for real-time | ||
714 | or energy-efficiency reasons. | ||
715 | |||
716 | endchoice | ||
717 | |||
679 | endmenu # "RCU Subsystem" | 718 | endmenu # "RCU Subsystem" |
680 | 719 | ||
681 | config IKCONFIG | 720 | config IKCONFIG |
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h index 44f958a88b21..3e33aefce0ea 100644 --- a/kernel/rcutree_plugin.h +++ b/kernel/rcutree_plugin.h | |||
@@ -85,6 +85,20 @@ static void __init rcu_bootup_announce_oddness(void) | |||
85 | if (nr_cpu_ids != NR_CPUS) | 85 | if (nr_cpu_ids != NR_CPUS) |
86 | printk(KERN_INFO "\tRCU restricting CPUs from NR_CPUS=%d to nr_cpu_ids=%d.\n", NR_CPUS, nr_cpu_ids); | 86 | printk(KERN_INFO "\tRCU restricting CPUs from NR_CPUS=%d to nr_cpu_ids=%d.\n", NR_CPUS, nr_cpu_ids); |
87 | #ifdef CONFIG_RCU_NOCB_CPU | 87 | #ifdef CONFIG_RCU_NOCB_CPU |
88 | #ifndef CONFIG_RCU_NOCB_CPU_NONE | ||
89 | if (!have_rcu_nocb_mask) { | ||
90 | alloc_bootmem_cpumask_var(&rcu_nocb_mask); | ||
91 | have_rcu_nocb_mask = true; | ||
92 | } | ||
93 | #ifdef CONFIG_RCU_NOCB_CPU_ZERO | ||
94 | pr_info("\tExperimental no-CBs CPU 0\n"); | ||
95 | cpumask_set_cpu(0, rcu_nocb_mask); | ||
96 | #endif /* #ifdef CONFIG_RCU_NOCB_CPU_ZERO */ | ||
97 | #ifdef CONFIG_RCU_NOCB_CPU_ALL | ||
98 | pr_info("\tExperimental no-CBs for all CPUs\n"); | ||
99 | cpumask_setall(rcu_nocb_mask); | ||
100 | #endif /* #ifdef CONFIG_RCU_NOCB_CPU_ALL */ | ||
101 | #endif /* #ifndef CONFIG_RCU_NOCB_CPU_NONE */ | ||
88 | if (have_rcu_nocb_mask) { | 102 | if (have_rcu_nocb_mask) { |
89 | cpulist_scnprintf(nocb_buf, sizeof(nocb_buf), rcu_nocb_mask); | 103 | cpulist_scnprintf(nocb_buf, sizeof(nocb_buf), rcu_nocb_mask); |
90 | pr_info("\tExperimental no-CBs CPUs: %s.\n", nocb_buf); | 104 | pr_info("\tExperimental no-CBs CPUs: %s.\n", nocb_buf); |