rcu: Remove RCU CPU stall warnings from Tiny RCU
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 17 May 2017 17:54:29 +0000 (10:54 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Fri, 9 Jun 2017 01:52:45 +0000 (18:52 -0700)
Tiny RCU's job is to be tiny, so this commit removes its RCU CPU
stall warning code.  After this, there is no longer any need for
rcu_sched_ctrlblk and rcu_bh_ctrlblk to be in tiny_plugin.h, so this
commit also moves them to tiny.c.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcu/Kconfig
kernel/rcu/tiny.c
kernel/rcu/tiny_plugin.h
tools/testing/selftests/rcutorture/configs/rcu/TINY02

index 8edff43..be90c94 100644 (file)
@@ -78,7 +78,7 @@ config TASKS_RCU
          user-mode execution as quiescent states.
 
 config RCU_STALL_COMMON
-       def_bool ( TREE_RCU || PREEMPT_RCU || RCU_TRACE )
+       def_bool ( TREE_RCU || PREEMPT_RCU )
        help
          This option enables RCU CPU stall code that is common between
          the TINY and TREE variants of RCU.  The purpose is to allow
index 595cb1b..f848896 100644 (file)
 
 #include "rcu.h"
 
-/* Forward declarations for tiny_plugin.h. */
-struct rcu_ctrlblk;
-static void __call_rcu(struct rcu_head *head,
-                      rcu_callback_t func,
-                      struct rcu_ctrlblk *rcp);
+/* Global control variables for rcupdate callback mechanism. */
+struct rcu_ctrlblk {
+       struct rcu_head *rcucblist;     /* List of pending callbacks (CBs). */
+       struct rcu_head **donetail;     /* ->next pointer of last "done" CB. */
+       struct rcu_head **curtail;      /* ->next pointer of last CB. */
+};
+
+/* Definition for rcupdate control block. */
+static struct rcu_ctrlblk rcu_sched_ctrlblk = {
+       .donetail       = &rcu_sched_ctrlblk.rcucblist,
+       .curtail        = &rcu_sched_ctrlblk.rcucblist,
+};
+
+static struct rcu_ctrlblk rcu_bh_ctrlblk = {
+       .donetail       = &rcu_bh_ctrlblk.rcucblist,
+       .curtail        = &rcu_bh_ctrlblk.rcucblist,
+};
 
 #include "tiny_plugin.h"
 
@@ -65,7 +77,6 @@ EXPORT_SYMBOL(rcu_barrier_sched);
  */
 static int rcu_qsctr_help(struct rcu_ctrlblk *rcp)
 {
-       RCU_TRACE(reset_cpu_stall_ticks(rcp);)
        if (rcp->donetail != rcp->curtail) {
                rcp->donetail = rcp->curtail;
                return 1;
@@ -111,7 +122,6 @@ void rcu_bh_qs(void)
  */
 void rcu_check_callbacks(int user)
 {
-       RCU_TRACE(check_cpu_stalls();)
        if (user)
                rcu_sched_qs();
        else if (!in_softirq())
@@ -126,10 +136,8 @@ void rcu_check_callbacks(int user)
  */
 static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp)
 {
-       const char *rn = NULL;
        struct rcu_head *next, *list;
        unsigned long flags;
-       RCU_TRACE(int cb_count = 0;)
 
        /* Move the ready-to-invoke callbacks to a local list. */
        local_irq_save(flags);
@@ -147,18 +155,15 @@ static void __rcu_process_callbacks(struct rcu_ctrlblk *rcp)
        local_irq_restore(flags);
 
        /* Invoke the callbacks on the local list. */
-       RCU_TRACE(rn = rcp->name;)
        while (list) {
                next = list->next;
                prefetch(next);
                debug_rcu_head_unqueue(list);
                local_bh_disable();
-               __rcu_reclaim(rn, list);
+               __rcu_reclaim("", list);
                local_bh_enable();
                list = next;
-               RCU_TRACE(cb_count++;)
        }
-       RCU_TRACE(rcu_trace_sub_qlen(rcp, cb_count);)
 }
 
 static __latent_entropy void rcu_process_callbacks(struct softirq_action *unused)
@@ -202,7 +207,6 @@ static void __call_rcu(struct rcu_head *head,
        local_irq_save(flags);
        *rcp->curtail = head;
        rcp->curtail = &head->next;
-       RCU_TRACE(rcp->qlen++;)
        local_irq_restore(flags);
 
        if (unlikely(is_idle_task(current))) {
@@ -235,8 +239,5 @@ EXPORT_SYMBOL_GPL(call_rcu_bh);
 void __init rcu_init(void)
 {
        open_softirq(RCU_SOFTIRQ, rcu_process_callbacks);
-       RCU_TRACE(reset_cpu_stall_ticks(&rcu_sched_ctrlblk);)
-       RCU_TRACE(reset_cpu_stall_ticks(&rcu_bh_ctrlblk);)
-
        rcu_early_boot_tests();
 }
index c642f23..f0a01b2 100644 (file)
  * Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
  */
 
-#include <linux/kthread.h>
-#include <linux/init.h>
-
-/* Global control variables for rcupdate callback mechanism. */
-struct rcu_ctrlblk {
-       struct rcu_head *rcucblist;     /* List of pending callbacks (CBs). */
-       struct rcu_head **donetail;     /* ->next pointer of last "done" CB. */
-       struct rcu_head **curtail;      /* ->next pointer of last CB. */
-       RCU_TRACE(long qlen);           /* Number of pending CBs. */
-       RCU_TRACE(unsigned long gp_start); /* Start time for stalls. */
-       RCU_TRACE(unsigned long ticks_this_gp); /* Statistic for stalls. */
-       RCU_TRACE(unsigned long jiffies_stall); /* Jiffies at next stall. */
-       RCU_TRACE(const char *name);    /* Name of RCU type. */
-};
-
-/* Definition for rcupdate control block. */
-static struct rcu_ctrlblk rcu_sched_ctrlblk = {
-       .donetail       = &rcu_sched_ctrlblk.rcucblist,
-       .curtail        = &rcu_sched_ctrlblk.rcucblist,
-       RCU_TRACE(.name = "rcu_sched")
-};
-
-static struct rcu_ctrlblk rcu_bh_ctrlblk = {
-       .donetail       = &rcu_bh_ctrlblk.rcucblist,
-       .curtail        = &rcu_bh_ctrlblk.rcucblist,
-       RCU_TRACE(.name = "rcu_bh")
-};
-
 #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_SRCU)
 #include <linux/kernel_stat.h>
 
@@ -73,53 +45,3 @@ void __init rcu_scheduler_starting(void)
 }
 
 #endif /* #if defined(CONFIG_DEBUG_LOCK_ALLOC) || defined(CONFIG_SRCU) */
-
-#ifdef CONFIG_RCU_TRACE
-
-static void rcu_trace_sub_qlen(struct rcu_ctrlblk *rcp, int n)
-{
-       unsigned long flags;
-
-       local_irq_save(flags);
-       rcp->qlen -= n;
-       local_irq_restore(flags);
-}
-
-static void check_cpu_stall(struct rcu_ctrlblk *rcp)
-{
-       unsigned long j;
-       unsigned long js;
-
-       if (rcu_cpu_stall_suppress)
-               return;
-       rcp->ticks_this_gp++;
-       j = jiffies;
-       js = READ_ONCE(rcp->jiffies_stall);
-       if (rcp->rcucblist && ULONG_CMP_GE(j, js)) {
-               pr_err("INFO: %s stall on CPU (%lu ticks this GP) idle=%llx (t=%lu jiffies q=%ld)\n",
-                      rcp->name, rcp->ticks_this_gp, DYNTICK_TASK_EXIT_IDLE,
-                      jiffies - rcp->gp_start, rcp->qlen);
-               dump_stack();
-               WRITE_ONCE(rcp->jiffies_stall,
-                          jiffies + 3 * rcu_jiffies_till_stall_check() + 3);
-       } else if (ULONG_CMP_GE(j, js)) {
-               WRITE_ONCE(rcp->jiffies_stall,
-                          jiffies + rcu_jiffies_till_stall_check());
-       }
-}
-
-static void reset_cpu_stall_ticks(struct rcu_ctrlblk *rcp)
-{
-       rcp->ticks_this_gp = 0;
-       rcp->gp_start = jiffies;
-       WRITE_ONCE(rcp->jiffies_stall,
-                  jiffies + rcu_jiffies_till_stall_check());
-}
-
-static void check_cpu_stalls(void)
-{
-       RCU_TRACE(check_cpu_stall(&rcu_bh_ctrlblk);)
-       RCU_TRACE(check_cpu_stall(&rcu_sched_ctrlblk);)
-}
-
-#endif /* #ifdef CONFIG_RCU_TRACE */
index 1f6bebb..d867426 100644 (file)
@@ -6,7 +6,6 @@ CONFIG_PREEMPT=n
 CONFIG_HZ_PERIODIC=y
 CONFIG_NO_HZ_IDLE=n
 CONFIG_NO_HZ_FULL=n
-CONFIG_RCU_TRACE=y
 CONFIG_PROVE_LOCKING=y
 #CHECK#CONFIG_PROVE_RCU=y
 CONFIG_DEBUG_LOCK_ALLOC=y