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>