Subject: Tiny SA patch for review
To: None <tech-kern@netbsd.org>
From: Allen Briggs <briggs@wasabisystems.com>
List: tech-kern
Date: 11/14/2003 10:41:47
I'd like some more eyes on this small patch.  I have been seeing
a problem with a threaded application.  It just stopped running
for no apparent reason after working fine for several seconds.
After wandering down a couple of blind alleys, I enabled the sadebug
variable and found that I was getting stuck in what looked like a
double page fault loop.  I noticed that sa->sa_vp_ofaultaddr is
apparently only reset in sa_register.  It seems that it should also
be reset after the page fault is resolved.  The following patch
appears to fix my problem, but I don't have a whole lot of confidence
that I'm not masking a real problem.  I'd appreciate any comments
from folks who have worked on this code a bit more than I have.

Index: kern/kern_sa.c
===================================================================
RCS file: /cvsroot/src/sys/kern/kern_sa.c,v
retrieving revision 1.42
diff -u -p -r1.42 kern_sa.c
--- kern/kern_sa.c	12 Nov 2003 21:27:46 -0000	1.42
+++ kern/kern_sa.c	14 Nov 2003 15:34:36 -0000
@@ -813,6 +813,7 @@ sa_switch(struct lwp *l, int type)
			mi_switch(l, NULL);
			DPRINTFN(10,("sa_switch(%d.%d) page fault resolved\n",
				     p->p_pid, l->l_lid));
+			sa->sa_vp_ofaultaddr = 0;
			return;
		}

Thanks,
-allen

--
 Allen Briggs			  briggs@wasabisystems.com
 Wasabi Systems, Inc.		  http://www.wasabisystems.com/