OpenVZ Forum


Home » Mailing lists » Devel » [PATCH] usbatm: Update to use the kthread api.
Re: [PATCH] usbatm: Update to use the kthread api. [message #17114 is a reply to message #17074] Tue, 02 January 2007 11:11 Go to previous messageGo to previous message
Christoph Hellwig is currently offline  Christoph Hellwig
Messages: 59
Registered: April 2006
Member
On Fri, Dec 15, 2006 at 10:14:06AM -0500, Alan Stern wrote:
> On Fri, 15 Dec 2006, Christoph Hellwig wrote:
> 
> > > Are signals the best available mechanism to request that a thread
> > > stop that can exit on it's own.
> > 
> > Defintly not.  signals should be avoided in kernel threads at all
> > cost.
> 
> I have a driver that spawns a kernel thread (using kthread_create) which 
> does I/O by calling vfs_write and vfs_read.  It relies on signals to 
> interrupt the I/O activity when necessary.  Maybe this isn't a good way of 
> doing things, but I couldn't think of anything better.

Given that we have no other way to interrupt I/O then signals at those
lower level I don't see a way around the singals if you stick to that
higher level design.

> P.S.: What is the reason for saying "signals should be avoided in kernel
> threads at all cost"?

The probem with signals is that they can come from various sources, most
notably from random kill commands issues from userland.  This defeats
the notion of a fixed thread lifetime under control of the owning module.
Of course this issue doesn't exist for you above useage where you'd
hopefully avoid allowing signals that could terminate the thread.
_______________________________________________
Containers mailing list
Containers@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/containers
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [PATCH] Set a separate lockdep class for neighbour table's proxy_queue
Next Topic: Re: Getting the new RxRPC patches upstream
Goto Forum:
  


Current Time: Thu Oct 23 04:16:04 GMT 2025

Total time taken to generate the page: 0.13374 seconds