On Sun, 2005-04-03 at 03:48 +0900, ooyama eiichi wrote: > > > because my driver hungs the machine by an certain ioctl. and it > > > seems to me there is no bad in the code correspond to the ioctl, > > > except for that it is using large auto variables. (some functions > > > are useing ~1KB autos) > > > > don't do that, even if you make it 'apparently' work for you it will > > just end up being a problem mater on or for someone else > > > > I changed these to using kmalloc(). > (but not yet confirmed for my driver to work properly)
You can also use globally static variables too. But this makes for non-reentry code. Sometimes I don't feel that a kmalloc is worth it, and if the function in question for the driver would seldom have problems with reentry, I use a statically defined global, and protect it with spin_locks. If these can also be used in interrupt context, you need to use the spin_lock_irqsave variants. But don't do this if the critical section has long latencies. -- Steve - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/