Whamcloud - gitweb
LU-12780 quota: don't use ptlrpc_thread for qsd_reint_main() 68/36268/8
authorMr NeilBrown <neilb@suse.de>
Wed, 23 Oct 2019 00:30:51 +0000 (11:30 +1100)
committerOleg Drokin <green@whamcloud.com>
Tue, 24 Mar 2020 05:16:47 +0000 (05:16 +0000)
commit24eeeeef5d56f05b19c94fdd69a5a22ab7384616
treec4315227f25b27ef0dfb332ba2d53e0144aefc4c
parent051f0adeb0615da83c819ff74da467bb4117ae63
LU-12780 quota: don't use ptlrpc_thread for qsd_reint_main()

Instead of ptlrpc_thread, use native kthread operations.

- perform allocation before starting the thread, and don't
  bother with synchronization at thread start
- use kthread_stop() and kthread_should_stop() to signal
  shutdown
- as the thread can stop independently, use xchg() on
  qqi->qqi_reint_task to determine if there is a waiter, and
  if so, the thread should synchronize with the waiter.
- use wake_up_var and wait_var_event for event signalling.

Also use kthread's thread-name formatting rather than
allocating a 'name' for formating the name separately.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: Ia1334a3e865b67ba5ae78c7b8342704a340229f7
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/36268
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/quota/qsd_internal.h
lustre/quota/qsd_lib.c
lustre/quota/qsd_reint.c