Whamcloud - gitweb
LU-12780 llite: don't use ptlrpc_thread for sai_agl_thread 58/36258/6
authorMr NeilBrown <neilb@suse.de>
Wed, 23 Oct 2019 00:30:48 +0000 (11:30 +1100)
committerOleg Drokin <green@whamcloud.com>
Tue, 25 Feb 2020 05:50:55 +0000 (05:50 +0000)
commit5b630935452d5d8d7529d9ed267885f1ae11b450
tree99026713c4bf83e0edb3f571eabdd66e7cb583b7
parent99d501a0cbd0195d3235dbb91b95952bad938cfa
LU-12780 llite: don't use ptlrpc_thread for sai_agl_thread

Instead of ptlrpc_thread use native kthread functionality.

- instead of waiting for the thread to start-up, perform
  all early initialization before starting the thread,
  and cleanup happens after thread is stopped.
- use kthread_stop()/ kthread_should_stop() to negotiate
  shutdown.
- wake_up_process to tell the thread if there is more work
  to do.  The thread sets current->state to TASK_IDLE before
  checking, so that if it gets the wakeup, the 'schedule()'
  call won't block.
  We clear ->sai_agl_task under a spinlock, from which it is
  also woken, to avoid races.

Linux-commit c044fb0f835c

Change-Id: I73294dd2f28087f56c3463ecfad1a8b32a44b2d7
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/36258
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Lai Siyao <lai.siyao@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/llite/llite_internal.h
lustre/llite/statahead.c