On 31-May-01 Bruce Evans wrote: > On Wed, 30 May 2001, David Taylor wrote: > >> When trying to profile ircd-hybrid-7 on -CURRENT (I tried using a pre-vm >> madness version first, then tried a version cvsuped today), I reliably get >> lots of: >> >> kernel trap 12 with interrupts disabled >> >> messages on the console (one every 5-10 seconds, when the ircd is reasonably >> loaded). > > This is because ast() calls addupc_task() with sched_lock held. > addupc_task() calls copyin() and copyin() sometimes traps to fault in the > profiling buffer. > > This seems to be just a bug in ast(). userret() is missing the bug. > Untested fix: I think I have some comments in my local code about that sched_lock being bogus. :-/ I'll commit a fix for all platforms today. > --- > Index: trap.c > =================================================================== > RCS file: /home/ncvs/src/sys/i386/i386/trap.c,v > retrieving revision 1.189 > diff -u -1 -r1.189 trap.c > --- trap.c 2001/05/23 22:58:09 1.189 > +++ trap.c 2001/05/31 13:09:02 > @@ -1285,5 +1341,6 @@ > mtx_lock(&Giant); > - mtx_lock_spin(&sched_lock); > addupc_task(p, p->p_stats->p_prof.pr_addr, > p->p_stats->p_prof.pr_ticks); > + mtx_lock_spin(&sched_lock); > + /* XXX why not unlock Giant? */ To avoid releasing it just to possibly grab it again afterwards I think, but I'll have to look at this again. -- John Baldwin <[EMAIL PROTECTED]> -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.Baldwin.cx/~john/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-current" in the body of the message