Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F109871876
D26304.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
D26304.diff
View Options
Index: head/sys/vm/vm_page.c
===================================================================
--- head/sys/vm/vm_page.c
+++ head/sys/vm/vm_page.c
@@ -4724,12 +4724,11 @@
VM_OBJECT_ASSERT_WLOCKED(object);
KASSERT(((u_int)allocflags >> VM_ALLOC_COUNT_SHIFT) == 0,
("vm_page_grap_pages: VM_ALLOC_COUNT() is not allowed"));
+ KASSERT(count > 0,
+ ("vm_page_grab_pages: invalid page count %d", count));
vm_page_grab_check(allocflags);
pflags = vm_page_grab_pflags(allocflags);
- if (count == 0)
- return (0);
-
i = 0;
retrylookup:
m = vm_radix_lookup_le(&object->rtree, pindex + i);
@@ -4783,6 +4782,8 @@
int flags;
int i;
+ KASSERT(count > 0,
+ ("vm_page_grab_pages_unlocked: invalid page count %d", count));
vm_page_grab_check(allocflags);
/*
@@ -4805,7 +4806,7 @@
vm_page_grab_release(m, allocflags);
pred = ma[i] = m;
}
- if ((allocflags & VM_ALLOC_NOCREAT) != 0)
+ if (i == count || (allocflags & VM_ALLOC_NOCREAT) != 0)
return (i);
count -= i;
VM_OBJECT_WLOCK(object);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Feb 11, 2:31 PM (11 h, 4 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
16596363
Default Alt Text
D26304.diff (1 KB)
Attached To
Mode
D26304: Avoid unnecessary object locking in vm_page_grab_pages_unlocked().
Attached
Detach File
Event Timeline
Log In to Comment