Subject: Re: lock errors on DIAGNOSTIC kernel after yamt-idlelwp merge
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
From: Michael L. Hitch <mhitch@lightning.msu.montana.edu>
List: port-amiga
Date: 05/19/2007 16:05:22
On Sat, 19 May 2007, Izumi Tsutsui wrote:

>> Modified Files:
>> 	src/sys/arch/m68k/m68k: pmap_motorola.c switch_subr.s vm_machdep.c
>>
>> Log Message:
>> Common m68k changes for idlelwp.
>
> Does a DIAGNOSTIC kernel work on amiga?

   Did this work after the newlock2 merge (before the idlelwp merge)?

> On hp300 (and also news68, sun3, sun3x) DIAGNOSTIC kernels
> get the following mutex error during SCSI probe:
> ---
> hpibbus4 at nhpib4
> interrupt levels: bio = 4, net = 5, tty = 5
> scsibus0: waiting 2 seconds for devices to settle...
> Mutex error: mutex_vector_enter: locking against myself
>
> lock address : 0x00000000001e67c0
> current cpu  :                  0
> current lwp  : 0x0000000003641d80
> owner field  : 0x0000000027008000 wait/spin:                0/1
>
> panic: lock error

   My amiga has the same problem.  The scsibus0 lwp has the lwp locked
when sched_pstats() run (as well as the other 2 non-idle lwps.

   Hmm, some debugging shows that cpu_switchto never returns when switching
to a newly created lwp.  This leaves the old lwp locked, and when 
sched_pstats() get called while scsibus0 is sleeping for the 2 second 
delay, the DIAGNOSTIC check fails.  This may also explain why my 
non-DIAGNOSTIC amiga kernel seems to lose time:  a 'locked' lwp is at 
IPL_HIGH until it is unlocked.

   And I now see that I'm missing some stuff when starting up a new process 
(it wasn't mentioned in doc/BRANCHES).  I'll fix that and see if things 
work better.

--
Michael L. Hitch			mhitch@montana.edu
Computer Consultant
Information Technology Center
Montana State University	Bozeman, MT	USA