Commit 911af505ef407c2511106c224dd640f882f0f590

Authored by Paul E. McKenney
Committed by Paul E. McKenney
1 parent 34ed62461a

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>

Showing 2 changed files with 53 additions and 0 deletions Side-by-side Diff

... ... @@ -676,6 +676,45 @@
676 676 Say Y here if you want to help to debug reduced OS jitter.
677 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 718 endmenu # "RCU Subsystem"
680 719  
681 720 config IKCONFIG
kernel/rcutree_plugin.h
... ... @@ -85,6 +85,20 @@
85 85 if (nr_cpu_ids != NR_CPUS)
86 86 printk(KERN_INFO "\tRCU restricting CPUs from NR_CPUS=%d to nr_cpu_ids=%d.\n", NR_CPUS, nr_cpu_ids);
87 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 102 if (have_rcu_nocb_mask) {
89 103 cpulist_scnprintf(nocb_buf, sizeof(nocb_buf), rcu_nocb_mask);
90 104 pr_info("\tExperimental no-CBs CPUs: %s.\n", nocb_buf);