When shadowing objects, adjust the page coloring of the shadowing object

such that pages in the combined/shadowed object are consistantly
    colored.

Submitted by:	"John S. Dyson" <dyson@iquest.net>
This commit is contained in:
Matthew Dillon 1999-02-07 08:44:53 +00:00
parent ded0cfef98
commit 9b09fe24a4
1 changed files with 6 additions and 1 deletions

View File

@ -61,7 +61,7 @@
* any improvements or extensions that they make and grant Carnegie the * any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes. * rights to redistribute these changes.
* *
* $Id: vm_object.c,v 1.143 1999/02/03 01:57:17 dillon Exp $ * $Id: vm_object.c,v 1.144 1999/02/04 17:47:52 dillon Exp $
*/ */
/* /*
@ -936,6 +936,10 @@ vm_object_shadow(object, offset, length)
* Our caller changes his reference to point to the new object, * Our caller changes his reference to point to the new object,
* removing a reference to the source object. Net result: no change * removing a reference to the source object. Net result: no change
* of reference count. * of reference count.
*
* Try to optimize the result object's page color when shadowing
* in order to maintain page coloring consistancy in the combined
* shadowed object.
*/ */
result->backing_object = source; result->backing_object = source;
if (source) { if (source) {
@ -943,6 +947,7 @@ vm_object_shadow(object, offset, length)
vm_object_clear_flag(source, OBJ_ONEMAPPING); vm_object_clear_flag(source, OBJ_ONEMAPPING);
source->shadow_count++; source->shadow_count++;
source->generation++; source->generation++;
result->pg_color = (source->pg_color + OFF_TO_IDX(*offset)) & PQ_L2_MASK;
} }
/* /*