Whamcloud - gitweb
LU-8304 libcfs: convert debug_ctlwq to a completion. 98/37398/3
authorNeilBrown <neilb@suse.com>
Sun, 2 Feb 2020 02:15:17 +0000 (21:15 -0500)
committerOleg Drokin <green@whamcloud.com>
Sat, 8 Feb 2020 04:06:53 +0000 (04:06 +0000)
commitacb6ee1f1fbeebad43a3d415bfcf47edd05c2aba
treed1650f94cf40435f175514d3446d08461886fa2d
parentef60f77dbbb8820531df4ae61b9ca6c09bde7fa8
LU-8304 libcfs: convert debug_ctlwq to a completion.

kthread_run might sleep during an allocation, and so
it's considered unsafe to call with a state that's not
RUNNABLE.
Rather than move the state setting to after kthread_run, which
introduces a small race, replace the waitqueue with a completion.
This has clean semantics which perfectly match the need here.

Change-Id: Ic3bcf21dc747d73ce482e2d50bffd6c43fc04fbc
Signed-off-by: NeilBrown <neilb@suse.com>
Reviewed-on: https://review.whamcloud.com/37398
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
libcfs/libcfs/debug.c