Whamcloud - gitweb
LU-12838 ptlrpc: fix watchdog ratelimit logic 09/36409/3
authorAndreas Dilger <adilger@whamcloud.com>
Tue, 8 Oct 2019 21:42:32 +0000 (15:42 -0600)
committerOleg Drokin <green@whamcloud.com>
Fri, 18 Oct 2019 01:06:43 +0000 (01:06 +0000)
commit594c79f2f855737fa415562a9bbb3fb13aee9ec9
tree4644fa4cddc6d5fc5c37bc46cade9280780a68e6
parentcebda7a478f9943f10b9a3388377c61a54957a87
LU-12838 ptlrpc: fix watchdog ratelimit logic

The ptlrpc-level watchdog ratelimiting is broken. The kernel prints:

    mdt00_009: service thread pid 18935 was inactive for 72s.
    Watchdog stack traces are limited to 3 per 300s, skipping...

even though there hasn't been any stack trace printed before.

It looks like the __ratelimit() return value is backward from
what one would expect from normal English grammar, namely that
if __ratelimit() returns true the action should NOT be limited.

Fix the logic checking the __ratelimit() return value, and add a
check in sanity test_422 (which forces a service thread timeout)
to ensure that the watchdog sometimes prints a full stack.

Fixes: fc9de679a4c2 ("LU-9859 libcfs: add watchdog for ptlrpc service threads")
Test-Parameters: trivial
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I4a97dd361c12ac7c7a39c251551c21506b3ebbe5
Reviewed-on: https://review.whamcloud.com/36409
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ptlrpc/service.c
lustre/tests/sanity.sh