Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F107290470
D41317.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
886 B
Referenced Files
None
Subscribers
None
D41317.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
@@ -690,15 +690,17 @@
* term fragmentation by promoting contemporaneous allocation and (hopefully)
* deallocation.
*
- * The physical page m's buddy must not be free.
+ * If npages is zero, this function does nothing and ignores the physical page
+ * parameter m. Otherwise, the physical page m's buddy must not be free.
*/
static vm_page_t
vm_phys_enq_range(vm_page_t m, u_int npages, struct vm_freelist *fl, int tail)
{
int order;
- KASSERT(((VM_PAGE_TO_PHYS(m) + npages * PAGE_SIZE) &
- ((PAGE_SIZE << fls(npages / 2)) - 1)) == 0,
+ KASSERT(npages == 0 ||
+ ((VM_PAGE_TO_PHYS(m) + npages * PAGE_SIZE) &
+ ((PAGE_SIZE << (fls(npages) - 1)) - 1)) == 0,
("vm_phys_enq_range: page %p and npages %u are misaligned",
m, npages));
while (npages > 0) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 13, 1:49 AM (20 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15774769
Default Alt Text
D41317.diff (886 B)
Attached To
Mode
D41317: vm_phys_enq_range: no alignment assert for npages==0
Attached
Detach File
Event Timeline
Log In to Comment