Whamcloud - gitweb
LU-12780 osp: use native kthreads for opd_pre_thread 63/36263/4
authorMr NeilBrown <neilb@suse.de>
Wed, 23 Oct 2019 00:30:50 +0000 (11:30 +1100)
committerOleg Drokin <green@whamcloud.com>
Sun, 1 Mar 2020 05:35:30 +0000 (05:35 +0000)
commitcce9699b1ae128ac2874516b8f9ee85b5ac3fbc6
treee9fd7b534b2be0daa9067e46ea4869317eb4188a
parent4bc21cc3dca028907d3dd2629a455c80b89c9130
LU-12780 osp: use native kthreads for opd_pre_thread

rather than ptlrpc_thread, use native kthreads functionality.

- provide an opt_args structure which is allocated
  and initialized before the thread is started so errors
  cannot happen in the thread.
- include a completion to synchronize startup so we can be sure
  the thread function actually runs, and so will clean up.
- use kthread_stop and kthread_should_stop to
  synchronize shutdown.

The ptlrpc_thread was not used for signaling the thread about
work-to-do, so no change is needed there.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Ib0e2041da3fa4d613b17f743b18700c84a79fac2
Reviewed-on: https://review.whamcloud.com/36263
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osp/osp_internal.h
lustre/osp/osp_precreate.c