lkml.org 
[lkml]   [2013]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH tip/core/rcu 10/13] rcu: Consolidate rcutiny_plugin.h ifdefs
    Date
    From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>

    This commit rearranges code in order to allow ifdefs to be consolidated
    in kernel/rcutiny_plugin.h, simplifying the code.

    Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
    Reviewed-by: Josh Triplett <josh@joshtriplett.org>
    ---
    kernel/rcutiny_plugin.h | 86 +++++++++++++++++++++++--------------------------
    1 file changed, 40 insertions(+), 46 deletions(-)

    diff --git a/kernel/rcutiny_plugin.h b/kernel/rcutiny_plugin.h
    index bac3a6e..65ef180 100644
    --- a/kernel/rcutiny_plugin.h
    +++ b/kernel/rcutiny_plugin.h
    @@ -53,54 +53,10 @@ static struct rcu_ctrlblk rcu_bh_ctrlblk = {
    };

    #ifdef CONFIG_DEBUG_LOCK_ALLOC
    +#include <linux/kernel_stat.h>
    +
    int rcu_scheduler_active __read_mostly;
    EXPORT_SYMBOL_GPL(rcu_scheduler_active);
    -#endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
    -
    -#ifdef CONFIG_RCU_TRACE
    -
    -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 = rcp->jiffies_stall;
    - if (*rcp->curtail && 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, rcu_dynticks_nesting,
    - jiffies - rcp->gp_start, rcp->qlen);
    - dump_stack();
    - }
    - if (*rcp->curtail && ULONG_CMP_GE(j, js))
    - rcp->jiffies_stall = jiffies +
    - 3 * rcu_jiffies_till_stall_check() + 3;
    - else if (ULONG_CMP_GE(j, js))
    - rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check();
    -}
    -
    -#endif /* #ifdef CONFIG_RCU_TRACE */
    -
    -static void reset_cpu_stall_ticks(struct rcu_ctrlblk *rcp)
    -{
    -#ifdef CONFIG_RCU_TRACE
    - rcp->ticks_this_gp = 0;
    - rcp->gp_start = jiffies;
    - rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check();
    -#endif /* #ifdef CONFIG_RCU_TRACE */
    -}
    -
    -static void check_cpu_stalls(void)
    -{
    - RCU_TRACE(check_cpu_stall(&rcu_bh_ctrlblk));
    - RCU_TRACE(check_cpu_stall(&rcu_sched_ctrlblk));
    -}
    -
    -#ifdef CONFIG_DEBUG_LOCK_ALLOC
    -#include <linux/kernel_stat.h>

    /*
    * During boot, we forgive RCU lockdep issues. After this function is
    @@ -179,4 +135,42 @@ MODULE_AUTHOR("Paul E. McKenney");
    MODULE_DESCRIPTION("Read-Copy Update tracing for tiny implementation");
    MODULE_LICENSE("GPL");

    +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 = rcp->jiffies_stall;
    + if (*rcp->curtail && 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, rcu_dynticks_nesting,
    + jiffies - rcp->gp_start, rcp->qlen);
    + dump_stack();
    + }
    + if (*rcp->curtail && ULONG_CMP_GE(j, js))
    + rcp->jiffies_stall = jiffies +
    + 3 * rcu_jiffies_till_stall_check() + 3;
    + else if (ULONG_CMP_GE(j, js))
    + rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check();
    +}
    +
    #endif /* #ifdef CONFIG_RCU_TRACE */
    +
    +static void reset_cpu_stall_ticks(struct rcu_ctrlblk *rcp)
    +{
    +#ifdef CONFIG_RCU_TRACE
    + rcp->ticks_this_gp = 0;
    + rcp->gp_start = jiffies;
    + rcp->jiffies_stall = jiffies + rcu_jiffies_till_stall_check();
    +#endif /* #ifdef CONFIG_RCU_TRACE */
    +}
    +
    +static void check_cpu_stalls(void)
    +{
    + RCU_TRACE(check_cpu_stall(&rcu_bh_ctrlblk));
    + RCU_TRACE(check_cpu_stall(&rcu_sched_ctrlblk));
    +}
    --
    1.8.1.5


    \
     
     \ /
      Last update: 2013-05-20 17:42    [W:5.580 / U:0.056 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site