Re: Preempt & how long it takes to interrupt (was Re: [2.4.17/18pre] VM and swap - it's really unusable)

Nigel Gamble
2002-01-27T22:11:46Z

On Sun, 27 Jan 2002, Alan Cox wrote:
> I dont believe anyone has tested the driver hard with pre-empt. Its not that
> this driver can't be fixed. Its that this is one tiny example of maybe
> thousands of other similar flaws lurking. There is no obvious automated way
> to find them either.

You could make the same argument against SMP, but Linux has SMP support
despite all the thousands of SMP flaws that once lurked with no obvious
automated way to find them. Most of them have been found.

Actually, there is a way to help to automate the finding of preemption
problems: you keep a log of kernel preemption events in a circular
buffer, and dump the log after something unexpected happens (like a
kernel oops). Then you search the log for preemptions that happened in
suspicious places. Kernel preemptions don't happen very often, so the
log usually goes back several seconds, which is usually plenty of time
to catch the preemption that happened in the wrong place. (Since SMP
locking problems are also preemption problems, this technique can also
catch SMP problems.)

I have a patch to do this for earlier versions of the kernel preemption
patch - I need to bring it up to date and send it to Robert for use with
the latest versions of his patch.

Nigel Gamble nigel@nrg.org
Mountain View, CA, USA. http://www.nrg.org/