Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1187261

[PATCH tip/core/rcu 01/12] rcu: Provide more diagnostics for stalled GP kthread

From "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject [PATCH tip/core/rcu 01/12] rcu: Provide more diagnostics for stalled GP kthread
Date 2015-07-18 00:40 +0200
Message-ID <pNmsq-2cc-7@gated-at.bofh.it> (permalink)
References <pNmsp-2cc-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcu/tree.c | 10 ++++++++--
 kernel/rcu/tree.h |  6 +++++-
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 65137bc28b2b..1c58cbd03922 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -1178,9 +1178,11 @@ static void rcu_check_gp_kthread_starvation(struct rcu_state *rsp)
 	j = jiffies;
 	gpa = READ_ONCE(rsp->gp_activity);
 	if (j - gpa > 2 * HZ)
-		pr_err("%s kthread starved for %ld jiffies! g%lu c%lu f%#x\n",
+		pr_err("%s kthread starved for %ld jiffies! g%lu c%lu f%#x s%d ->state=%#lx\n",
 		       rsp->name, j - gpa,
-		       rsp->gpnum, rsp->completed, rsp->gp_flags);
+		       rsp->gpnum, rsp->completed,
+		       rsp->gp_flags, rsp->gp_state,
+		       rsp->gp_kthread ? rsp->gp_kthread->state : 0);
 }
 
 /*
@@ -2041,6 +2043,7 @@ static int __noreturn rcu_gp_kthread(void *arg)
 			wait_event_interruptible(rsp->gp_wq,
 						 READ_ONCE(rsp->gp_flags) &
 						 RCU_GP_FLAG_INIT);
+			rsp->gp_state = RCU_GP_DONE_GPS;
 			/* Locking provides needed memory barrier. */
 			if (rcu_gp_init(rsp))
 				break;
@@ -2073,6 +2076,7 @@ static int __noreturn rcu_gp_kthread(void *arg)
 					(!READ_ONCE(rnp->qsmask) &&
 					 !rcu_preempt_blocked_readers_cgp(rnp)),
 					j);
+			rsp->gp_state = RCU_GP_DONE_FQS;
 			/* Locking provides needed memory barriers. */
 			/* If grace period done, leave loop. */
 			if (!READ_ONCE(rnp->qsmask) &&
@@ -2110,7 +2114,9 @@ static int __noreturn rcu_gp_kthread(void *arg)
 		}
 
 		/* Handle grace-period end. */
+		rsp->gp_state = RCU_GP_CLEANUP;
 		rcu_gp_cleanup(rsp);
+		rsp->gp_state = RCU_GP_CLEANED;
 	}
 }
 
diff --git a/kernel/rcu/tree.h b/kernel/rcu/tree.h
index 4adb7ca0bf47..f1f4784f9107 100644
--- a/kernel/rcu/tree.h
+++ b/kernel/rcu/tree.h
@@ -527,7 +527,11 @@ struct rcu_state {
 /* Values for rcu_state structure's gp_flags field. */
 #define RCU_GP_WAIT_INIT 0	/* Initial state. */
 #define RCU_GP_WAIT_GPS  1	/* Wait for grace-period start. */
-#define RCU_GP_WAIT_FQS  2	/* Wait for force-quiescent-state time. */
+#define RCU_GP_DONE_GPS  2	/* Wait done for grace-period start. */
+#define RCU_GP_WAIT_FQS  3	/* Wait for force-quiescent-state time. */
+#define RCU_GP_DONE_FQS  4	/* Wait done for force-quiescent-state time. */
+#define RCU_GP_CLEANUP   5	/* Grace-period cleanup started. */
+#define RCU_GP_CLEANED   6	/* Grace-period cleanup complete. */
 
 extern struct list_head rcu_struct_flavors;
 
-- 
1.8.1.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH tip/core/rcu 0/12] Tree geometry-initialization  simplifications for 4.3 "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-07-18 00:40 +0200
  [PATCH tip/core/rcu 03/12] rcu: Remove superfluous local variable in rcu_init_geometry() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-07-18 00:40 +0200
  [PATCH tip/core/rcu 08/12] rcu: Remove unnecessary fields from rcu_state structure "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-07-18 00:40 +0200
  [PATCH tip/core/rcu 12/12] rcu: Reset rcu_fanout_leaf if out of bounds "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-07-18 00:40 +0200
  [PATCH tip/core/rcu 11/12] rcu: Shut up bogus gcc array bounds warning "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-07-18 00:40 +0200
  [PATCH tip/core/rcu 10/12] rcu: Simplify arithmetic to calculate number of RCU nodes "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-07-18 00:40 +0200
  [PATCH tip/core/rcu 05/12] rcu: Simplify rcu_init_geometry() capacity arithmetics "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-07-18 00:40 +0200
  [PATCH tip/core/rcu 09/12] rcu: Limit count of static data to the number of RCU levels "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-07-18 00:40 +0200
  [PATCH tip/core/rcu 01/12] rcu: Provide more diagnostics for stalled GP kthread "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-07-18 00:40 +0200
    [PATCH tip/core/rcu 04/12] rcu: Cleanup rcu_init_geometry() code and arithmetics "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-07-18 00:40 +0200
    [PATCH tip/core/rcu 02/12] rcu: Panic if RCU tree can not accommodate all CPUs "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-07-18 00:40 +0200
    [PATCH tip/core/rcu 07/12] rcu: Limit rcu_capacity[] size to RCU_NUM_LVLS items "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-07-18 00:40 +0200
    [PATCH tip/core/rcu 06/12] rcu: Limit rcu_state::levelcnt[] to RCU_NUM_LVLS items "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-07-18 00:40 +0200

csiph-web