Subject: Re: [Fwd: System hung...]
To: e.stiebler <emu@e-bbes.com>
From: Johnny Billquist <bqt@softjar.se>
List: current-users
Date: 08/30/2007 09:16:52
Johnny Billquist skrev:
> e.stiebler skrev:
>> Johnny Billquist wrote:
>>>> Yes, I'm getting now the "same" here. Checked out the CVS last night 
>>>> compiled new userland and kernel. With the new kernel the system 
>>>> bombs after few minutes into the debugger. the old kernel and 
>>>> userland works for hours (that how I compiled the new userland & 
>>>> kernel). Now I'm trying to install the userland on the old kernel, 
>>>> just in case the userland and kernel are out of sync ...
>>>
>>> That's another issue. I'm actually working on orting that out, and 
>>> the crashes I've gotten rid of. But now I get hung systems instead, 
>>> after a few hours...
>>> (I can send you the patches tonight.)
>>
>> Did you check the patches in the meantime into the cvs ?
> 
> Sorry. I'm not a netbsd developer, and don't have the rights needed to 
> check anything in myself.
> Also, this is just experimenting, so it's probably not a good idea to 
> check it in without actually confirming a bit more that these patches 
> are ok, and not actually the cause of these "hangs" I now see...
> 
> Anyway, here's the patch:
> ...
> umm... I can't get cvs to work right now. I'll get back with a diff in a 
> while.
> 
>     Johnny

Ah. Now cvs feels like working again...


Index: sys/arch/vax/vax/pmap.c
===================================================================
RCS file: /cvsroot/src/sys/arch/vax/vax/pmap.c,v
retrieving revision 1.150
diff -c -r1.150 pmap.c
*** sys/arch/vax/vax/pmap.c     17 May 2007 14:51:34 -0000      1.150
--- sys/arch/vax/vax/pmap.c     30 Aug 2007 07:10:14 -0000
***************
*** 91,97 ****
    * Page 4: unused
    */
   long  scratch;
! #define SCRATCHPAGES  4


   struct pmap kernel_pmap_store;
--- 91,97 ----
    * Page 4: unused
    */
   long  scratch;
! #define SCRATCHPAGES  3


   struct pmap kernel_pmap_store;
***************
*** 324,330 ****
         scratch = istack + ISTACK_SIZE;

         /* Physical-to-virtual translation table */
!       pv_table = (struct pv_entry *)(scratch + 3 * VAX_NBPG);

         avail_start = (vaddr_t)pv_table + (round_page(avail_end >> PGSHIFT)) *
             sizeof(struct pv_entry) - KERNBASE;
--- 324,330 ----
         scratch = istack + ISTACK_SIZE;

         /* Physical-to-virtual translation table */
!       pv_table = (struct pv_entry *)(scratch + SCRATCHPAGES * VAX_NBPG);

         avail_start = (vaddr_t)pv_table + (round_page(avail_end >> PGSHIFT)) *
             sizeof(struct pv_entry) - KERNBASE;
***************
*** 560,572 ****
   {
         struct pm_share *ps;

         ps = pm->pm_share;
         while (ps != NULL) {
                 ps->ps_pcb->P0BR = pm->pm_p0br;
                 ps->ps_pcb->P0LR = pm->pm_p0lr|AST_PCB;
                 ps->ps_pcb->P1BR = pm->pm_p1br;
                 ps->ps_pcb->P1LR = pm->pm_p1lr;
!               ps = ps->ps_next;
         }

         /* If curlwp uses this pmap update the regs too */
--- 560,576 ----
   {
         struct pm_share *ps;

+       if (pm == NULL) return; /* bqt */
+
         ps = pm->pm_share;
         while (ps != NULL) {
+         if (ps->ps_pcb != NULL) { /* bqt */
                 ps->ps_pcb->P0BR = pm->pm_p0br;
                 ps->ps_pcb->P0LR = pm->pm_p0lr|AST_PCB;
                 ps->ps_pcb->P1BR = pm->pm_p1br;
                 ps->ps_pcb->P1LR = pm->pm_p1lr;
!         }
!         ps = ps->ps_next;
         }

         /* If curlwp uses this pmap update the regs too */
***************
*** 1668,1673 ****
--- 1672,1679 ----
         pmap = p->p_vmspace->vm_map.pmap;
         pcb = &l->l_addr->u_pcb;

+       if (pmap->pm_share == NULL) return; /* bqt */
+
         ps = pmap->pm_share;
         if (ps->ps_pcb == pcb) {
                 pmap->pm_share = ps->ps_next;
=================

Try that, and you shouldn't get the panic crashes. But the system will still 
hang after a number of hours.

	Johnny

-- 
Johnny Billquist                  || "I'm on a bus
                                   ||  on a psychedelic trip
email: bqt@softjar.se             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol