From 523a10e8fa16283ef5e50fcb9462999f2bcaf7a2 Mon Sep 17 00:00:00 2001
From: "he, bo" <bo.he@intel.com>
Date: Sat, 24 Nov 2018 13:30:40 +0800
Subject: [PATCH 1/2] add rcu hung task detect

Change-Id: If8791c7f4f250b44c04927c1f5c0ca82f2fadc01
Tracked-On:
Signed-off-by: he, bo <bo.he@intel.com>
---
 kernel/rcu/update.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/kernel/rcu/update.c b/kernel/rcu/update.c
index 39cb23d..81db882 100644
--- a/kernel/rcu/update.c
+++ b/kernel/rcu/update.c
@@ -362,8 +362,13 @@ void __wait_rcu_gp(bool checktiny, int n, call_rcu_func_t *crcu_array,
 		for (j = 0; j < i; j++)
 			if (crcu_array[j] == crcu_array[i])
 				break;
-		if (j == i)
-			wait_for_completion(&rs_array[i].completion);
+		if (j == i) {
+			trace_printk("bobo: start wait for rcu gp\n");
+			if(!wait_for_completion_timeout(&rs_array[i].completion, 3*HZ))
+				panic("hung_task: blocked tasks in rcu");
+			trace_printk("bobo: finish wait for rcu gp\n");
+
+		}
 		destroy_rcu_head_on_stack(&rs_array[i].head);
 	}
 }
-- 
2.7.4

