SMP assert failure in kern/vas.c

From: Warren Toomey <wkt_at_nospam.org>
Date: Sat May 29 2004 - 15:21:25 PDT

Hi, I'm back after quite a while. My student Gabriel finished his
project on adding SMP to VSTa. It's mostly done but there are a few
asserts left. Right now I'm working on this assert failure in
vas.c:detach_pview():

         /*
          * Walk each valid slot, and tear down any HAT translation.
          */
         p_lock_void(&ps->p_lock, SPL0_SAME);
         for (x = 0; x < pv->p_len; ++x) {
                 uint pfn, idx;
                 . . .
                 /*
                  * Point to the mapping
                  */
                 idx = pv->p_off + x;
                 pp = find_pp(ps, idx);
                 ASSERT_DEBUG(pp->pp_flags & PP_V,
                         "detach_pview: p_valid !PP_V");
                 . . .
         }

The assert failure comes during an exit() syscall. Looking at the loop
code, at first I suspected that there was a race to reacquire ps->p_lock
after the unlock_slot(ps, pp). I modified unlock_slot() to have a
droplock parameter (1==release the lock, 0==keep the lock). Everywhere
in VSTa, I modified calls to unlock_slot() to have droplock==1. Then I
modified vas.c:detach_pview() to use droplock==0 and removed the code to
reacquire ps->p_lock in the above loop. However, after doing this I
started to get a "trap: bad user type" from trap.c!

Many thanks in advance for any suggestion as to why the above assert is
failing. I'm suspecting a race condition, but I'm surprised that my fix
did not work correctly.

Cheers,
        Warren
Received on Sun, 30 May 2004 08:21:25 +1000

This archive was generated by hypermail 2.1.8 : Tue Sep 26 2006 - 09:03:12 PDT