]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
rcu: Fix tracing formatting
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Fri, 28 Sep 2012 17:49:58 +0000 (10:49 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Sat, 27 Oct 2012 22:52:07 +0000 (15:52 -0700)
The rcu_state structure's ->completed field is unsigned long, so this
commit adjusts show_one_rcugp()'s printf() format to suit.  Also add
the required ACCESS_ONCE() directives while we are in this function.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcutree.c
kernel/rcutree_trace.c

index b966d56ebb5157c784d268dad88bdfca369b5b28..8ed9c481db035b4d59f486b6711d12e963b7faaf 100644 (file)
@@ -68,8 +68,8 @@ static struct lock_class_key rcu_fqs_class[RCU_NUM_LVLS];
        .level = { &sname##_state.node[0] }, \
        .call = cr, \
        .fqs_state = RCU_GP_IDLE, \
-       .gpnum = -300, \
-       .completed = -300, \
+       .gpnum = 0UL - 300UL, \
+       .completed = 0UL - 300UL, \
        .orphan_lock = __RAW_SPIN_LOCK_UNLOCKED(&sname##_state.orphan_lock), \
        .orphan_nxttail = &sname##_state.orphan_nxtlist, \
        .orphan_donetail = &sname##_state.orphan_donelist, \
index bcc4865fea8ba47a356d95c78b5be1ae8c7f0bd5..209e696091bd146af66fa7a89caef37cff7a85ac 100644 (file)
@@ -301,15 +301,15 @@ static void show_one_rcugp(struct seq_file *m, struct rcu_state *rsp)
        struct rcu_node *rnp = &rsp->node[0];
 
        raw_spin_lock_irqsave(&rnp->lock, flags);
-       completed = rsp->completed;
-       gpnum = rsp->gpnum;
-       if (rsp->completed == rsp->gpnum)
+       completed = ACCESS_ONCE(rsp->completed);
+       gpnum = ACCESS_ONCE(rsp->gpnum);
+       if (completed == gpnum)
                gpage = 0;
        else
                gpage = jiffies - rsp->gp_start;
        gpmax = rsp->gp_max;
        raw_spin_unlock_irqrestore(&rnp->lock, flags);
-       seq_printf(m, "%s: completed=%ld  gpnum=%lu  age=%ld  max=%ld\n",
+       seq_printf(m, "%s: completed=%lu  gpnum=%lu  age=%ld  max=%ld\n",
                   rsp->name, completed, gpnum, gpage, gpmax);
 }