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

Re: [microblaze-uclinux] kernel BUG at sched.c:687!



The reason could be two:

1) active_mm pointer is just modified when a kernel thread is going to to take 
the CPU. Kernel threads don't have a mm struct as normal processes so they 
use the mm used by the previous normal process which has the CPU. Then 
something happens when scheduler is interrupted and a kernel thread was the 
last process (see line 692 at sched.c). At this point interrupts are enabled 
by spin_unlock_irq (line 640). BUT, in this situation the scheduler just 
could be executed if it is called from code not related with interrupts. So, 
perhaps there's a driver doing the call to schedule in some way.

2) A corruption kernel stack happened. Then active_mm is not pointing to the 
right place. This could happen under heavy interrupts frequency. You can put 
some code to know when this could happen, this is when kernel stack size is 
very close from 8192 bytes. 

3) Yes, I said just two options, but I have the same sched BUG problem under 
tests done with RTLinux and Microblaze. In this cases the interrupts 
frequency are higher than tests done just under uClinux. At this point I'm 
doing dome study to resolve the problem but I have not been successful until 
now. 

I assumed you are using the entry.S without my patch reported two days ago. 
aren't you?

On Wednesday 19 April 2006 22:20, Brettschneider Falk wrote:
> Hi,
>
> DeviPrasad Natesan wrote:
> > What typically causes this "kernel BUG at sched.c:562".
>
> The code is: BUG_ON(!current->active_mm);
> I think the scheduler has an inconsistent state here already. Hard to say
> why but I think, corrupted memory in 'current' could be the most likely
> reason. Maybe task switching doesn't save/restore some data properly
> (although it seems so), anyway I suppose the scheduler is one of the first
> things that is called after a task switch.
>
> Cheers, F@lk
> ___________________________
> microblaze-uclinux mailing list
> microblaze-uclinux@xxxxxxxxxxxxxx
> Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
> Mailing List Archive :
> http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/

-- 
Alejandro Lucero
Technical Director
+34 665 68 71 68
Valencia (SPAIN)
www.os3sl.com
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/