I have just started programing on Linux kernel threads. I have a problem which I would like to share with you guys. My code is:
YOu can also go for completions. The linux mass storage driver http://lxr.free-electrons.com/source/drivers/usb/storage/usb.c has a very good implementation of kthreads. Good Luck.