2.5.8: Preempt problems

Russell King (rmk@arm.linux.org.uk)
Wed, 17 Apr 2002 11:43:31 +0100


Hi,

I'm trying to debug a flood of:

error: sh[81] exited with preempt_count 1

messages on ARM with kernel 2.5.8, and its looking like a generic kernel
bug is causing it.

The point at which preempt_count gets set to '1' for each task is at the
lock_kernel() in start_kernel(). Why?

We start booting the kernel. One of the very first things we do is call
lock_kernel(), which increments the preempt_count for PID0. We initialise
stuff, and then clone the thread for PID1, init.

When we clone a thread, dup_task_struct() creates a new kernel stack and
thread_info structure. The childs thread_info structure inherits from
the parent, which includes the preempt_count of 1.

We start the user space init(8) program, and run various other programs,
forking as we do. Each time we fork(), we call dup_task_struct() which
causes each task to inherit the non-zero preempt_count.

Thus, we never reach a preempt_count of 0, and never actually preempt.

Comments? Is there some fiddle in the x86 code somewhere that we've
missed in the ARM tree to get this to work?

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/