From: Hongchao Zhang Date: Wed, 10 May 2017 03:45:19 +0000 (+0800) Subject: LU-9235 libcfs: don't dump stack if just touched X-Git-Tag: 2.10.52~18 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=1376094062c1e46c985f04d82821114d84329699 LU-9235 libcfs: don't dump stack if just touched If some lc_watchdog was touched before lcw_dump_stack dumped the stack of the thread, it should not dump it anymore for the thread is verified to be active and no need to dump. Change-Id: I8e4acc1793bb8458ee3b6dc73f2953670ed22896 Signed-off-by: Hongchao Zhang Reviewed-on: https://review.whamcloud.com/23162 Tested-by: Jenkins Reviewed-by: James Simmons Reviewed-by: Dmitry Eremin Tested-by: Maloo Reviewed-by: Fan Yong Reviewed-by: Oleg Drokin --- diff --git a/libcfs/libcfs/watchdog.c b/libcfs/libcfs/watchdog.c index 401210c..359ca94 100644 --- a/libcfs/libcfs/watchdog.c +++ b/libcfs/libcfs/watchdog.c @@ -160,6 +160,11 @@ static void lcw_dump_stack(struct lc_watchdog *lcw) timediff = ktime_to_timespec64(ktime_sub(ktime_get(), lcw->lcw_last_touched)); + + /* LU-9235: Don't dump stack if the thread is just touched. */ + if (timediff.tv_sec == 0) + return; + /* * Check to see if we should throttle the watchdog timer to avoid * too many dumps going to the console thus triggering an NMI.