OSDN Git Service

rcutorture: Flag nonexistent RCU GP kthread
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Sun, 6 Dec 2015 01:34:10 +0000 (17:34 -0800)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Sun, 6 Dec 2015 01:58:00 +0000 (17:58 -0800)
Currently, if the RCU grace-period kthread has not yet been created,
in which case the starvation-check code will print zero for the state,
which maps to TASK_RUNNING.  This could clearly be quite confusing, so
this commit prints ~0, which does not map to any legal ->state value.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
kernel/rcu/tree.c

index 81aa1cd..e2315fb 100644 (file)
@@ -1201,7 +1201,7 @@ static void rcu_check_gp_kthread_starvation(struct rcu_state *rsp)
                       rsp->name, j - gpa,
                       rsp->gpnum, rsp->completed,
                       rsp->gp_flags, rsp->gp_state,
-                      rsp->gp_kthread ? rsp->gp_kthread->state : 0);
+                      rsp->gp_kthread ? rsp->gp_kthread->state : ~0);
 }
 
 /*