Subject: CVS commit: syssrc/sys/uvm
To: None <source-changes@netbsd.org>
From: Andrew Brown <atatat@netbsd.org>
List: source-changes
Date: 11/14/2002 19:58:49
Module Name:	syssrc
Committed By:	atatat
Date:		Thu Nov 14 17:58:49 UTC 2002

Modified Files:
	syssrc/sys/uvm: uvm_amap.c uvm_amap.h uvm_map.c

Log Message:
Implement backwards extension of amaps.  There are three cases to deal
with:

Case #1 -- adjust offset: The slot offset in the aref can be
decremented to cover the required size addition.

Case #2 -- move pages and adjust offset: The slot offset is not large
enough, but the amap contains enough inactive space *after* the mapped
pages to make up the difference, so active slots are slid to the "end"
of the amap, and the slot offset is, again, adjusted to cover the
required size addition.  This optimizes for hitting case #1 again on
the next small extension.

Case #3 -- reallocate, move pages, and adjust offset: There is not
enough inactive space in the amap, so the arrays are reallocated, and
the active pages are copied again to the "end" of the amap, and the
slot offset is adjusted to cover the required size.  This also
optimizes for hitting case #1 on the next backwards extension.

This provides the missing piece in the "forward extension of
vm_map_entries" logic, so the merge failure counters have been
removed.

Not many applications will make any use of this at this time (except
for jvms and perhaps gcc3), but a "top-down" memory allocator will use
it extensively.


To generate a diff of this commit:
cvs rdiff -r1.45 -r1.46 syssrc/sys/uvm/uvm_amap.c
cvs rdiff -r1.18 -r1.19 syssrc/sys/uvm/uvm_amap.h
cvs rdiff -r1.124 -r1.125 syssrc/sys/uvm/uvm_map.c

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