Subject: kern/2673: unnecessary test in vm_fault()
To: None <gnats-bugs@NetBSD.ORG>
From: Kenneth Stailey <>
List: netbsd-bugs
Date: 08/05/1996 11:25:35
>Number:         2673
>Category:       kern
>Synopsis:       unnecessary test in vm_fault()
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Mon Aug  5 11:50:01 1996
>Originator:     Kenneth Stailey
>Release:        1.2_BETA
System: NetBSD owl 1.2_BETA NetBSD 1.2_BETA (OWL) #0: Mon Jul 15 23:55:53 EDT 1996 kstailey@owl:/usr/src/sys/arch/i386/compile/OWL i386

I submitted a patch to vm_fault() in the past to add logging of page faults.
I sent E-mail about how the test of curproc != NULL was unnecessary because
curproc is always set when vm_fault() is entered, but it probably got lost
in the shuffle.  Now I always have to rip out the test whenever I download
a copy of vm_fault.c (it's rough being Ken 8c{)] but I'm bearing up well
under the circumstances.)
Maybe profile kernel with and without fix?

--- vm_fault.c.DIST	Mon Aug  5 11:05:28 1996
+++ vm_fault.c	Mon Aug  5 11:05:02 1996
@@ -326,8 +326,7 @@
-			if (curproc)
-				curproc->p_addr->u_stats.p_ru.ru_majflt++;
+			curproc->p_addr->u_stats.p_ru.ru_majflt++;
 			rv = vm_pager_get(object->pager, m, TRUE);