What is the recommended, safe way to wake up a kernel thread blocked in
sock_recvmsg (other than sending data to it or pulling the network cable
out of the wall and generating network errors). I have tried various
approaches in kernel sock_close, sock_release even wake_up_process. When
I want to free my captive kernel threads this thread is typically blocked
in tcp_recv_data (on a blocking read of a tcp v4 socket). I am not certain
that it is not waking up and promptly going back to sleep but it is
certainly not returning to the caller until it really gets data.
Steve French
Samba Team
Senior Software Engineer
Linux Technology Center - IBM Austin
phone: 512-838-2294
email: [email protected]
"Steven French" <[email protected]> writes:
> What is the recommended, safe way to wake up a kernel thread blocked in
> sock_recvmsg (other than sending data to it or pulling the network cable
> out of the wall and generating network errors). I have tried various
> approaches in kernel sock_close, sock_release even wake_up_process. When
> I want to free my captive kernel threads this thread is typically blocked
> in tcp_recv_data (on a blocking read of a tcp v4 socket). I am not certain
> that it is not waking up and promptly going back to sleep but it is
> certainly not returning to the caller until it really gets data.
You could send it a signal.
Or alternatively use non blocking sockets and sleep yourself on the socket
wait queue.
-Andi