Subject: Re: i386-current page fault trap in profiled code
To: Frank van der Linden <fvdl@wasabisystems.com>
From: john heasley <heas@shrubbery.net>
List: port-i386
Date: 11/11/2002 17:56:43
Mon, Nov 11, 2002 at 11:43:16PM +0100, Frank van der Linden:
> On Mon, Nov 11, 2002 at 02:11:46PM -0800, john heasley wrote:
> > login: kernel: page fault trap, code=0
> > Stopped in pid 28182 (tac_plus) at      0xc010049b:     repe movsb      (%esi),%es:(%edi)
> > db{1}> trace
> > gdt_desc(e3f3c014,805fc84,1,1,0) at 0xc010049b
> > gdt_desc(1f,1f,1f,1f,c) at 0xc01fd012
> > db{1}> sync
> > syncing disks... panic: TLB IPI rendezvous failed (mask 1)
> > Stopped in pid 28182 (tac_plus) at      0xc01ecb34:     movl    %ebp,%esp
> 
> Ok.. I think I see. Try the following diff:
> 
> 
> Index: trap.c
> ===================================================================
> RCS file: /cvsroot/syssrc/sys/arch/i386/i386/trap.c,v
> retrieving revision 1.174
> diff -c -r1.174 trap.c
> *** trap.c	2002/11/11 13:54:28	1.174
> --- trap.c	2002/11/11 22:40:49
> ***************
> *** 409,415 ****
> --- 409,417 ----
>   		uvmexp.softs++;
>   		if (p->p_flag & P_OWEUPC) {
>   			p->p_flag &= ~P_OWEUPC;
> + 			KERNEL_PROC_LOCK(p);
>   			ADDUPROF(p);
> + 			KERNEL_PROC_UNLOCK(p);
>   		}
>   		/* Allow a forced task switch. */
>   		if (curcpu()->ci_want_resched) /* XXX CSE me? */

this seems to fix it the panic.  thanks!

though the numbers dont seem to be kosher.  the number of calls look
good, but i dont believe the times.  eg:

  %   cumulative   self              self     total           
 time   seconds   seconds    calls  Ts/call  Ts/call  name    
  0.00      0.00     0.00       85     0.00     0.00  bcopy
  0.00      0.00     0.00       65     0.00     0.00  memcpy
  0.00      0.00     0.00       36     0.00     0.00  MD5Update
  0.00      0.00     0.00       33     0.00     0.00  strncmp
  0.00      0.00     0.00       31     0.00     0.00  imalloc
  0.00      0.00     0.00       31     0.00     0.00  malloc_bytes
  0.00      0.00     0.00       30     0.00     0.00  write
  0.00      0.00     0.00       29     0.00     0.00  acct_write
  0.00      0.00     0.00       28     0.00     0.00  free
  0.00      0.00     0.00       28     0.00     0.00  ifree

granted, the child is fairly short-lived.  i'll have to try it with a
longer running process.