Whamcloud - gitweb
LU-12780 ofd: don't use ptlrpc_thread for consistency verification 62/36262/13
authorMr NeilBrown <neilb@suse.de>
Wed, 23 Oct 2019 00:30:50 +0000 (11:30 +1100)
committerOleg Drokin <green@whamcloud.com>
Fri, 26 Feb 2021 22:11:36 +0000 (22:11 +0000)
commitcb3c65d4a10b2ad0a6c70d5e38719bca3d501efb
tree2d3753d82c71e3685965a619a674592bed7c302b
parentec138c5c58dd74700b29ad960be4ac5a881a35b0
LU-12780 ofd: don't use ptlrpc_thread for consistency verification

The ofd module runs a consistency verification thread to verify parent
FID.  Rather than using ptlrpc_thread to manage this, use native
kthreads functionality.

- startup-up code is moved out of the thread to before the
  thread is started, which make error handling clearer.
  As part of this, the lfsck_req_local struct is combined with
  an lu_env and ofd_device pointer into a new oivm_args
  which is passed to the thread a arguments - now it doesn't need
  to allocate anything itself.
- Cleanup remains in the thread, so we add a completion to be
  sure the thread has started before there is any chance of
  kthread_stop() being called.

- kthread_stop() and kthread_should_stop() are used for stopping
  the thread.  wake_up_process() is used to wake it.
  The thread sets TASK_IDLE at the top of the loop, and sets
  TASK_RUNNING if anything is found to do.  At the bottom of
  the loop the 'schedule()' will only block if nothing was found
  to be done.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Iec1de307ea48f7d26c60edf5d86eb0b7bf78f49a
Reviewed-on: https://review.whamcloud.com/36262
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/ofd/ofd_dev.c
lustre/ofd/ofd_internal.h
lustre/ofd/ofd_io.c