The engineer says there is no excuse, but we still see this kind of lockup a decade later.
Notice that I said "I think drivers should be written with an 'abort' ioctl". I later said that the kernel should have a way to kill a stuck process like this.
Apparently it wasn't as dumb an idea as everyone seemed to think at the time: see TASK_KILLABLE.
From: Geoff Johnson <gpj@saki.com.au> Newsgroups: comp.unix.sco.misc Subject: Re: Tape drives, tape drives Date: Thu, 11 May 2000 23:23:40 +1000 Message-ID: <391AB45C.B85EFD3E@saki.com.au> Tony Lawrence wrote: > > Geoff Johnson wrote: > > > > Tony Lawrence wrote: > > > > > > Geoff Johnson wrote: > > > > > > > > If a tape driver is unkillable it is nearly always a device driver bug. > > > > There is no excuse for sleep at a unkillable priority without seting up > > > > timeout to signal the sleep. Even if its 5 minutes later this beats the > > > > forced reboot that is usually 5 minutes later anyway. > > > > > > There's no excuse, but it's still extremely common. But > > > isn't it not that it's sleeping at an unkillable priority > > > but that it never comes out of the driver so the process > > > never sees the signal? > > > > > We are saying exactly the same thing. > > The only way to not leave the drver is to sleep. The only way the > > processes does not respond to signals is if it sleeps at too high > > a priority. > > I always have trouble getting my brain wrapped around these > issues. So does everyone else, even the people who write > the drivers- that's why they screw up, right? > > But the fine distinction I'm trying to make here is that a > process running in kernel code doesn't respond to signals > because it doesn't see signals until it pops back up into > user space. So yes, that's probably because it's sleeping, Only if it is sleeping at too high a priority. Below the threshhold priorty the kernel will prematurely awaken the process if the process is signaled. Of course a stupid program could loop back and sleep again. This is how reads on ttys etc, are forced to return from the kernel side of the fence when the process is interupted. There is nothing magic about being in the kernel except for bloody minded device drivers. In the old days of QIC tape drives just about every driver on the market suffered from this problem because a typoe in the standard led everyone to write a damaged driver. > but isn't the fact that it's in kernel space more > important? I dunno, as I said, at a certain point here my > brain boggles and I lose track of the overall picture :-) > > > > > I ioctl is useless if the upper levels of the driver will not allow > > simultaneous opens of the device (usually a good thing). > > Creating a co-device for issuing the ioctl to is harder than just > > coding it correctly in the first place. > > You are probably right. Still, if you can't plan for every > screwup of the hardware, it would seem smart to have a > safety valve that could let the administrator free it. > > > > > > I think drivers should be written with an "abort" ioctl that > > > just tells it "give it up, Jack- I know you think you are > > > doing something useful, but you aren't, so just reset your > > > state and let your head pop back out of the water". > > > > > > -- > > > Tony Lawrence (tony@aplawrence.com) > > > SCO/Linux articles, help, book reviews, tests, > > > job listings and more : > > > > -- > > > > Geoff Johnson > > -- > Tony Lawrence (tony@aplawrence.com) > SCO/Linux articles, help, book reviews, tests, > job listings and more : -- Geoff Johnson
More Articles by Tony Lawrence - Find me on Google+
Have you tried Searching this site?
Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates
This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.
Many of the products and books I review are things I purchased for my own use. Some were given to me specifically for the purpose of reviewing them. I resell or can earn commissions from the sale of some of these items. Links within these pages may be affiliate links that pay me for referring you to them. That's mostly insignificant amounts of money; whenever it is not I have made my relationship plain. I also may own stock in companies mentioned here. If you have any question, please do feel free to contact me.
Specific links that take you to pages that allow you to purchase the item I reviewed are very likely to pay me a commission. Many of the books I review were given to me by the publishers specifically for the purpose of writing a review. These gifts and referral fees do not affect my opinions; I often give bad reviews anyway.
We use Google third-party advertising companies to serve ads when you visit our website. These companies may use information (not including your name, address, email address, or telephone number) about your visits to this and other websites in order to provide advertisements about goods and services of interest to you. If you would like more information about this practice and to know your choices about not having this information used by these companies, click here.
Click here to add your comments
Don't miss responses! Subscribe to Comments by RSS or by Email
Click here to add your comments
If you want a picture to show with your comment, go get a Gravatar