Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F106202300
D40400.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
D40400.diff
View Options
diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c
--- a/sys/vm/vm_phys.c
+++ b/sys/vm/vm_phys.c
@@ -680,6 +680,15 @@
}
}
+static void
+vm_phys_enq_chunk(struct vm_freelist *fl, vm_page_t m, int order, int tail)
+{
+ KASSERT(order >= 0 && order < VM_NFREEORDER,
+ ("%s: invalid order %d", __func__, order));
+
+ vm_freelist_add(fl, m, order, tail);
+}
+
/*
* Add the physical pages [m, m + npages) at the beginning of a power-of-two
* aligned and sized set to the specified free list.
@@ -706,13 +715,13 @@
KASSERT(m->order == VM_NFREEORDER,
("%s: page %p has unexpected order %d",
__func__, m, m->order));
- order = ilog2(npages);
+ order = ilog2(npages);
KASSERT(order < VM_NFREEORDER,
("%s: order %d is out of range", __func__, order));
- vm_freelist_add(fl, m, order, tail);
+ vm_phys_enq_chunk(fl, m, order, tail);
m += 1 << order;
- npages -= 1 << order;
- }
+ npages -= 1 << order;
+ }
}
/*
@@ -743,9 +752,7 @@
("vm_phys_enq_range: page %p has unexpected order %d",
m, m->order));
order = ffs(npages) - 1;
- KASSERT(order < VM_NFREEORDER,
- ("vm_phys_enq_range: order %d is out of range", order));
- vm_freelist_add(fl, m, order, tail);
+ vm_phys_enq_chunk(fl, m, order, tail);
m += 1 << order;
npages -= 1 << order;
}
@@ -1203,7 +1210,7 @@
KASSERT(seg == &vm_phys_segs[m->segind],
("%s: page range [%p,%p) spans multiple segments",
__func__, m_end - npages, m));
- vm_freelist_add(fl, m, order, 1);
+ vm_phys_enq_chunk(fl, m, order, 1);
m += 1 << order;
}
/* Free blocks of diminishing size. */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 28, 2:19 AM (7 h, 48 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15619599
Default Alt Text
D40400.diff (1 KB)
Attached To
Mode
D40400: vm_phys: Factor out some calls to vm_freelist_add()
Attached
Detach File
Event Timeline
Log In to Comment