Subject: CVS commit: syssrc
To: None <source-changes@netbsd.org>
From: Jason R Thorpe <thorpej@netbsd.org>
List: source-changes
Date: 01/23/2001 03:56:17
Module Name:	syssrc
Committed By:	thorpej
Date:		Tue Jan 23 01:56:17 UTC 2001

Modified Files:
	syssrc/sys/uvm: uvm_amap.c uvm_anon.c uvm_fault.c uvm_page.c

Log Message:
Sprinkle some assertions:
amap_free(): Assert that the amap is locked.
amap_share_protect(): Assert that the amap is locked.
amap_wipeout(): Assert that the amap is locked.
uvm_anfree(): Assert that the anon has a reference count of 0 and is
              not locked.
uvm_anon_lockloanpg(): Assert that the anon is locked.
anon_pagein(): Assert that the anon is locked.
uvmfault_anonget(): Assert that the anon is locked.
uvm_pagealloc_strat(): Assert that the uobj or the anon is locked

And fix the problems these have uncovered:
amap_cow_now(): Lock the new anon after allocating it, and unref and
                unlock it (rather than lock!) before freeing it in case
                of an error condition.  This should fix a problem reported
		by Dan Carosone using cdrecord on an i386 MP kernel.
uvm_fault(): Case1B -- Lock the new anon afer allocating it, and unlock
             it later when we unlock the old anon.
	     Case2 -- Lock the new anon after allocating it, and unlock
	     it later by passing it to uvmfault_unlockall() (we set anon
	     to NULL if we're not doing a promote fault).


To generate a diff of this commit:
cvs rdiff -r1.27 -r1.28 syssrc/sys/uvm/uvm_amap.c
cvs rdiff -r1.11 -r1.12 syssrc/sys/uvm/uvm_anon.c
cvs rdiff -r1.52 -r1.53 syssrc/sys/uvm/uvm_fault.c
cvs rdiff -r1.47 -r1.48 syssrc/sys/uvm/uvm_page.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.