Re: kernel thread blocked in sock_recvmsg() not kill-able

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi again,

> > 	size = sock_recvmsg(kthread->sock,&msg,len,0);
> 
> try to pass MSG_DONTWAIT as flag/last parameter (defined in 
> linux/socket.h) so it becomes non blocking read operation. maybe this 
> won't solve your problem, but at least it can check whether you 
> actually receive the packet or not.

i've tried to do that, the problem is that witho non-blocking IO i must
sleep after the sock_recvmsg() function.

my thought is performance will be limited in that case, it's correct?

> 
> BTW, how big is "len"?

in my example it works fine with 1024 (the exact size of the struct
copied in the udp data field).

> IIRC, in 2.6.x, you should use provided kthread helper function. take a 
> look on linux/kthread.h inside kernel tree. Basically, it uses 
> completion to "signal" a thread that it is allowed to finish.
> 

i can't understand the use of functions from the linux/kthread.h file,
neither of them can wake a thread... any help?

thanks a lot,

toni

> As always, somebody please CMIIW
> 
> regards
> 
> Mulyadi
> 
> 
-- 
toni <agar9938@xxxxxxxxxxxxxxxxxx>


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux