Will Dyson on Sun, 24 Mar 2002 16:14:19 -0500


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

Re: [PLUG] Weird Hang on Boot


Martin DiViaio wrote:

I know I've miscompiled the kernel I'm just not sure where. I did run
across an article in the SMP-HOWTO that says that odd hangs can occur with
some protocol issues. I have compiled SMP support into the kernel but I am
not using multiple processors at the moment. Could that be the problem? If
not, could it be the preemptable patch? Or both?

An SMP kernel will work fine on a single cpu computer. A non-smp kernel will run slightly faster, because it can leave out a lot of the locking that a SMP kernel does.


I am running a kernel (2.4.18-pre9) with the preemptable patch, and have found it to be quite stable.

However, your problems sound like the kind of thing that would happen if a module that was compiled without preemption was loaded into a preemptable kernel (or a module compiled without smp support loaded into an smp kernel, for that matter).

The preemptable kernel patch modifies the kernel locking mechanisms so that preemption is prevented when a lock is held. However, those locking mechanisms are compiled inline for speed. Therefor, a module binary that was compiled for a non-preemptive kernel will still use the non-preempt-aware locking when loaded into a preemptive kernel. This will cause all sorts of trouble. For example, imagine that the non-preempt-aware module grabs a kernel lock and is then preempted by another process which also needs access to the same lock. Deadlock. The preempted process cannot give up the lock because it is not running. The preempting proccess will wait forever for the lock.

Anyway, to make sure this is not happening, you should boot using a stable kernel and rename away (or delete) the modules directory for the 2.4.18 kernel (/lib/modules/2.4.18/), and then recompile the preemptive kernel.

--
Will Dyson


______________________________________________________________________ Philadelphia Linux Users Group - http://www.phillylinux.org Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce General Discussion - http://lists.phillylinux.org/mail/listinfo/plug