Whamcloud - gitweb
LU-12780 quota: don't use ptlrpc_thead of qmt_pool_recalc 12/38612/5
authorMr NeilBrown <neilb@suse.de>
Fri, 15 May 2020 05:17:43 +0000 (15:17 +1000)
committerOleg Drokin <green@whamcloud.com>
Sat, 6 Jun 2020 14:03:00 +0000 (14:03 +0000)
commitd9094cf66b54c953416969e8581e1f3a6df461b0
treee99d3b0e3a07d53a4cb0a6c6fbeb44fda5c33be6
parent6a15798f51a9dcb29333e8107a59c5551f607fff
LU-12780 quota: don't use ptlrpc_thead of qmt_pool_recalc

Rather than using ptlrpc_thread, use native kthreads functionality.

kthread_stop() / kthread_should_stop() is used to signal early
shutdown.

kthread_park()/kthread_unpark() is used to ensure that thread
actually starts (else kf kthread_stop() was called too early,
the thread function might not run and the ref on the pool
might not be dropped.

As the thread can stop spontaneiously or on request we use xchg() on
the thread pointer to disambiuate in the case of a race and wait as
needed.

Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I56b03a4735268bc808448a4c7b9e20c8625e2eee
Reviewed-on: https://review.whamcloud.com/38612
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Sergey Cheremencev <sergey.cheremencev@hpe.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/quota/qmt_internal.h
lustre/quota/qmt_pool.c