There is no need for an atomic increment on the vm object's generation

count in _vm_object_allocate().  (Access to the generation count is
governed by the vm object's lock.)  Note: the introduction of the
atomic increment in revision 1.238 appears to be an accident.  The
purpose of that commit was to fix an Alpha-specific bug in UMA's
debugging code.
This commit is contained in:
Alan Cox 2003-09-13 20:07:26 +00:00
parent 51c1824f80
commit b881da26a5

View File

@ -198,6 +198,7 @@ _vm_object_allocate(objtype_t type, vm_pindex_t size, vm_object_t object)
object->root = NULL;
object->type = type;
object->size = size;
object->generation = 1;
object->ref_count = 1;
object->flags = 0;
if ((object->type == OBJT_DEFAULT) || (object->type == OBJT_SWAP))
@ -214,8 +215,6 @@ _vm_object_allocate(objtype_t type, vm_pindex_t size, vm_object_t object)
object->backing_object = NULL;
object->backing_object_offset = (vm_ooffset_t) 0;
atomic_add_int(&object->generation, 1);
mtx_lock(&vm_object_list_mtx);
TAILQ_INSERT_TAIL(&vm_object_list, object, object_list);
mtx_unlock(&vm_object_list_mtx);