Whamcloud - gitweb
LU-12780 quota: don't use ptlrpc_thread for qsd_upd_thread() 67/36267/11
authorMr NeilBrown <neilb@suse.de>
Wed, 23 Oct 2019 00:30:51 +0000 (11:30 +1100)
committerOleg Drokin <green@whamcloud.com>
Tue, 31 Mar 2020 06:59:34 +0000 (06:59 +0000)
commit2ddb1b57670ce239b755e8a7fb4f5cc9d6319786
tree69908cf24da48420166dda82500d2f584859840a
parent4c1f690a6ea623934b5e825120d8e7986fa4a1a5
LU-12780 quota: don't use ptlrpc_thread for qsd_upd_thread()

Instead of ptlrpc_thread, use native kthread functionality.

- for startup, perform allocations before starting the thread,
  and use a completion to ensure thread function runs before
  kthread_stop() is ever called, so cleanup is guaranteed to
  happen.
- for shutdown, use kthread_stop/kthread_should_stop
- for signalling the thread, use wake_up_process.  The thread
  sets TASK_IDLE while checking if there is anything to do,
  and TASK_RUNNING when it finds something to work on, so
  the schedule_timeout() only blocks if there was nothing to do.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I2ec2e28320e14251f342b8749a1a738f136f3575
Reviewed-on: https://review.whamcloud.com/36267
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
lustre/quota/qsd_internal.h
lustre/quota/qsd_lib.c
lustre/quota/qsd_writeback.c