Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177866225
D61925.1795464715.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D61925.1795464715.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
@@ -1989,25 +1989,14 @@
break;
}
if (i < SWAP_META_PAGES) {
- /*
- * The object lock has been released and regained.
- * Perhaps the object is now dead.
- */
- if ((object->flags & OBJ_DEAD) != 0) {
- /*
- * Make sure that pending writes finish before
- * returning.
- */
- vm_object_pip_wait(object, "swpoff");
- swp_pager_meta_free_all(object);
- break;
- }
-
/*
* The swapblk could have been freed, so reset the pages
* iterator and search again for the first swblk at or
- * after blks.index.
+ * after blks.index. The caller must ensure that the
+ * object is stable.
*/
+ KASSERT((object->flags & OBJ_DEAD) == 0,
+ ("%s: object %p is dead", __func__, object));
pctrie_iter_reset(&pages);
sb = swblk_iter_init(&blks, object, blks.index);
continue;
@@ -2064,10 +2053,16 @@
* Synchronize with _vm_object_allocate().
*/
if ((atomic_load_acq_int(&object->flags) &
- (OBJ_DEAD | OBJ_SWAP)) == OBJ_SWAP)
+ (OBJ_DEAD | OBJ_SWAP)) == OBJ_SWAP) {
+ /* The object lock might be dropped. */
+ vm_object_reference_locked(object);
swap_pager_swapoff_object(sp, object, &bp);
+ VM_OBJECT_WUNLOCK(object);
+ vm_object_deallocate(object);
+ } else {
+ VM_OBJECT_WUNLOCK(object);
+ }
- VM_OBJECT_WUNLOCK(object);
mtx_lock(&vm_object_list_mtx);
}
mtx_unlock(&vm_object_list_mtx);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 23, 8:11 PM (19 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41938564
Default Alt Text
D61925.1795464715.diff (1 KB)
Attached To
Mode
D61925: swap_pager: Keep the object alive across swap_pager_swapoff_object()
Attached
Detach File
Event Timeline