From 4166faaee00ae299a6d683961e938c191a46dfc2 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Thu, 18 Nov 2010 20:46:28 +0000 Subject: [PATCH] Only increment object generation count when inserting the page into object page list. The only use of object generation count now is a restart of the scan in vm_object_page_clean(), which makes sense to do on the page addition. Page removals do not affect the dirtiness of the object, as well as manipulations with the shadow chain. Suggested and reviewed by: alc MFC after: 1 week --- sys/vm/vm_object.c | 7 ------- sys/vm/vm_page.c | 3 --- 2 files changed, 10 deletions(-) diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 83039b2b9df1..cbc9a906270e 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -600,7 +600,6 @@ doterm: VM_OBJECT_LOCK(temp); LIST_REMOVE(object, shadow_list); temp->shadow_count--; - temp->generation++; VM_OBJECT_UNLOCK(temp); object->backing_object = NULL; } @@ -1192,7 +1191,6 @@ vm_object_shadow( VM_OBJECT_LOCK(source); LIST_INSERT_HEAD(&source->shadow_head, result, shadow_list); source->shadow_count++; - source->generation++; #if VM_NRESERVLEVEL > 0 result->flags |= source->flags & OBJ_COLORED; result->pg_color = (source->pg_color + OFF_TO_IDX(*offset)) & @@ -1260,7 +1258,6 @@ vm_object_split(vm_map_entry_t entry) LIST_INSERT_HEAD(&source->shadow_head, new_object, shadow_list); source->shadow_count++; - source->generation++; vm_object_reference_locked(source); /* for new_object */ vm_object_clear_flag(source, OBJ_ONEMAPPING); VM_OBJECT_UNLOCK(source); @@ -1651,7 +1648,6 @@ vm_object_collapse(vm_object_t object) */ LIST_REMOVE(object, shadow_list); backing_object->shadow_count--; - backing_object->generation++; if (backing_object->backing_object) { VM_OBJECT_LOCK(backing_object->backing_object); LIST_REMOVE(backing_object, shadow_list); @@ -1661,7 +1657,6 @@ vm_object_collapse(vm_object_t object) /* * The shadow_count has not changed. */ - backing_object->backing_object->generation++; VM_OBJECT_UNLOCK(backing_object->backing_object); } object->backing_object = backing_object->backing_object; @@ -1703,7 +1698,6 @@ vm_object_collapse(vm_object_t object) */ LIST_REMOVE(object, shadow_list); backing_object->shadow_count--; - backing_object->generation++; new_backing_object = backing_object->backing_object; if ((object->backing_object = new_backing_object) != NULL) { @@ -1714,7 +1708,6 @@ vm_object_collapse(vm_object_t object) shadow_list ); new_backing_object->shadow_count++; - new_backing_object->generation++; vm_object_reference_locked(new_backing_object); VM_OBJECT_UNLOCK(new_backing_object); object->backing_object_offset += diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 32b90e632c26..767f7ecffec5 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -846,7 +846,6 @@ vm_page_remove(vm_page_t m) * And show that the object has one fewer resident page. */ object->resident_page_count--; - object->generation++; /* * The vnode may now be recycled. */ @@ -1983,7 +1982,6 @@ vm_page_cache(vm_page_t m) object->root = root; TAILQ_REMOVE(&object->memq, m, listq); object->resident_page_count--; - object->generation++; /* * Restore the default memory attribute to the page. @@ -2395,7 +2393,6 @@ vm_page_set_invalid(vm_page_t m, int base, int size) ("vm_page_set_invalid: page %p is mapped", m)); m->valid &= ~bits; m->dirty &= ~bits; - m->object->generation++; } /*