Re: Doing sock_recvmsg from a data_ready callback

From: Andi Kleen (ak@suse.de)
Date: Fri Jun 23 2000 - 17:40:20 EST


On Fri, Jun 23, 2000 at 03:27:13PM -0700, breed@almaden.ibm.com wrote:
>
>
> I registered for a data_ready callback on a TCP socket in the kernel and I
> would like to recieve the data that just came in immediately. In other
> words, I have no process that I can do the recieve in. I seemed to run
> into problems if I didn't queue a task on the scheduler task queue. It
> seems to be working but not well... I have to do terrible things like save
> current->state before I call sock_recvmsg. Am I going to have to create a
> process just to do the sock_recvmsgs in?

Yes. recvmsg depends on a process context. tq_scheduler works in limits,
but you have to be very careful (e.g. it is easy to overflow the stack
by implicit recursion). Creating a kernel thread is recommended.

-Andi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:26 EST