Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102651288
D35788.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
5 KB
Referenced Files
None
Subscribers
None
D35788.diff
View Options
diff --git a/sys/vm/vm_fault.c b/sys/vm/vm_fault.c
--- a/sys/vm/vm_fault.c
+++ b/sys/vm/vm_fault.c
@@ -2040,8 +2040,7 @@
dst_object->cred = curthread->td_ucred;
crhold(dst_object->cred);
*fork_charge += dst_object->charge;
- } else if ((dst_object->type == OBJT_DEFAULT ||
- (dst_object->flags & OBJ_SWAP) != 0) &&
+ } else if ((dst_object->flags & OBJ_SWAP) != 0 &&
dst_object->cred == NULL) {
KASSERT(dst_entry->cred != NULL, ("no cred for entry %p",
dst_entry));
diff --git a/sys/vm/vm_map.c b/sys/vm/vm_map.c
--- a/sys/vm/vm_map.c
+++ b/sys/vm/vm_map.c
@@ -2825,8 +2825,7 @@
}
VM_OBJECT_WLOCK(obj);
- if (obj->type != OBJT_DEFAULT &&
- (obj->flags & OBJ_SWAP) == 0) {
+ if ((obj->flags & OBJ_SWAP) == 0) {
VM_OBJECT_WUNLOCK(obj);
continue;
}
@@ -4136,14 +4135,7 @@
*/
size = src_entry->end - src_entry->start;
if ((src_object = src_entry->object.vm_object) != NULL) {
- /*
- * Swap-backed objects need special handling. Note that
- * this is an unlocked check, so it is possible to race
- * with an OBJT_DEFAULT -> OBJT_SWAP conversion.
- */
- if (src_object->type == OBJT_DEFAULT ||
- src_object->type == OBJT_SWAP ||
- (src_object->flags & OBJ_SWAP) != 0) {
+ if ((src_object->flags & OBJ_SWAP) != 0) {
vm_map_copy_swap_object(src_entry, dst_entry,
size, fork_charge);
/* May have split/collapsed, reload obj. */
diff --git a/sys/vm/vm_mmap.c b/sys/vm/vm_mmap.c
--- a/sys/vm/vm_mmap.c
+++ b/sys/vm/vm_mmap.c
@@ -940,8 +940,7 @@
object = current->object.vm_object;
VM_OBJECT_WLOCK(object);
}
- if (object->type == OBJT_DEFAULT ||
- (object->flags & OBJ_SWAP) != 0 ||
+ if ((object->flags & OBJ_SWAP) != 0 ||
object->type == OBJT_VNODE) {
pindex = OFF_TO_IDX(current->offset +
(addr - current->start));
@@ -1368,8 +1367,7 @@
goto done;
}
} else {
- KASSERT(obj->type == OBJT_DEFAULT || obj->type == OBJT_SWAP ||
- (obj->flags & OBJ_SWAP) != 0, ("wrong object type"));
+ KASSERT((obj->flags & OBJ_SWAP) != 0, ("wrong object type"));
vm_object_reference(obj);
#if VM_NRESERVLEVEL > 0
if ((obj->flags & OBJ_COLORED) == 0) {
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
@@ -414,9 +414,6 @@
switch (type) {
case OBJT_DEAD:
panic("vm_object_allocate: can't create OBJT_DEAD");
- case OBJT_DEFAULT:
- flags = OBJ_COLORED;
- break;
case OBJT_SWAP:
flags = OBJ_COLORED | OBJ_SWAP;
break;
@@ -688,8 +685,7 @@
umtx_shm_object_terminated(object);
temp = object->backing_object;
if (temp != NULL) {
- KASSERT(object->type == OBJT_DEFAULT ||
- object->type == OBJT_SWAP,
+ KASSERT(object->type == OBJT_SWAP,
("shadowed tmpfs v_object 2 %p", object));
vm_object_backing_remove(object);
}
@@ -969,8 +965,7 @@
vm_reserv_break_all(object);
#endif
- KASSERT(object->cred == NULL || object->type == OBJT_DEFAULT ||
- (object->flags & OBJ_SWAP) != 0,
+ KASSERT(object->cred == NULL || (object->flags & OBJ_SWAP) != 0,
("%s: non-swap obj %p has cred", __func__, object));
/*
@@ -1306,8 +1301,7 @@
*
* Deactivate the specified pages if they are resident.
*
- * MADV_FREE (OBJT_DEFAULT/OBJT_SWAP objects,
- * OBJ_ONEMAPPING only)
+ * MADV_FREE (OBJT_SWAP objects, OBJ_ONEMAPPING only)
*
* Deactivate and clean the specified pages if they are
* resident. This permits the process to reuse the pages
@@ -1529,10 +1523,6 @@
offidxstart = OFF_TO_IDX(entry->offset);
size = atop(entry->end - entry->start);
- /*
- * If swap_pager_copy() is later called, it will convert new_object
- * into a swap object.
- */
new_object = vm_object_allocate_anon(size, orig_object,
orig_object->cred, ptoa(size));
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -2693,8 +2693,7 @@
goto retry;
}
/* Don't care: PG_NODUMP, PG_ZERO. */
- if (object->type != OBJT_DEFAULT &&
- (object->flags & OBJ_SWAP) == 0 &&
+ if ((object->flags & OBJ_SWAP) == 0 &&
object->type != OBJT_VNODE) {
run_ext = 0;
#if VM_NRESERVLEVEL > 0
@@ -2831,8 +2830,7 @@
VM_OBJECT_WLOCK(object);
/* Don't care: PG_NODUMP, PG_ZERO. */
if (m->object != object ||
- (object->type != OBJT_DEFAULT &&
- (object->flags & OBJ_SWAP) == 0 &&
+ ((object->flags & OBJ_SWAP) == 0 &&
object->type != OBJT_VNODE))
error = EINVAL;
else if (object->memattr != VM_MEMATTR_DEFAULT)
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -896,11 +896,8 @@
vm_page_free(m);
VM_CNT_INC(v_dfree);
} else if ((object->flags & OBJ_DEAD) == 0) {
- if ((object->flags & OBJ_SWAP) == 0 &&
- object->type != OBJT_DEFAULT)
- pageout_ok = true;
- else if (disable_swap_pageouts)
- pageout_ok = false;
+ if ((object->flags & OBJ_SWAP) != 0)
+ pageout_ok = disable_swap_pageouts == 0;
else
pageout_ok = true;
if (!pageout_ok) {
@@ -1886,8 +1883,7 @@
if ((entry->eflags & MAP_ENTRY_NEEDS_COPY) != 0 &&
obj->ref_count != 1)
continue;
- if (obj->type == OBJT_DEFAULT || obj->type == OBJT_SWAP ||
- obj->type == OBJT_PHYS || obj->type == OBJT_VNODE ||
+ if (obj->type == OBJT_PHYS || obj->type == OBJT_VNODE ||
(obj->flags & OBJ_SWAP) != 0)
res += obj->resident_page_count;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 8:51 AM (21 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14656174
Default Alt Text
D35788.diff (5 KB)
Attached To
Mode
D35788: vm: Remove handling for OBJT_DEFAULT objects
Attached
Detach File
Event Timeline
Log In to Comment