Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102648182
D35787.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D35787.diff
View Options
diff --git a/sys/vm/swap_pager.c b/sys/vm/swap_pager.c
--- a/sys/vm/swap_pager.c
+++ b/sys/vm/swap_pager.c
@@ -787,6 +787,20 @@
swp_pager_meta_free_all(object);
object->handle = NULL;
object->type = OBJT_DEAD;
+
+ /*
+ * Release the allocation charge.
+ */
+ if (object->cred != NULL) {
+ swap_release_by_cred(object->charge, object->cred);
+ object->charge = 0;
+ crfree(object->cred);
+ object->cred = NULL;
+ }
+
+ /*
+ * Hide the object from swap_pager_swapoff().
+ */
vm_object_clear_flag(object, OBJ_SWAP);
}
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -702,27 +702,9 @@
}
}
-/*
- * vm_object_destroy removes the object from the global object list
- * and frees the space for the object.
- */
void
vm_object_destroy(vm_object_t object)
{
-
- /*
- * Release the allocation charge.
- */
- if (object->cred != NULL) {
- swap_release_by_cred(object->charge, object->cred);
- object->charge = 0;
- crfree(object->cred);
- object->cred = NULL;
- }
-
- /*
- * Free the space for the object.
- */
uma_zfree(obj_zone, object);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 7:46 AM (21 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14655442
Default Alt Text
D35787.diff (1 KB)
Attached To
Mode
D35787: vm_object: Release object swap charge in the swap pager destructor
Attached
Detach File
Event Timeline
Log In to Comment