Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151151398
D22234.id64006.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
D22234.id64006.diff
View Options
Index: head/sys/vm/vm_fault.c
===================================================================
--- head/sys/vm/vm_fault.c
+++ head/sys/vm/vm_fault.c
@@ -155,10 +155,14 @@
{
if (fs->m != NULL) {
- vm_page_xunbusy(fs->m);
+ /*
+ * fs->m's object lock might not be held, so the page must be
+ * kept busy until we are done with it.
+ */
vm_page_lock(fs->m);
vm_page_deactivate(fs->m);
vm_page_unlock(fs->m);
+ vm_page_xunbusy(fs->m);
fs->m = NULL;
}
}
Index: head/sys/vm/vm_page.c
===================================================================
--- head/sys/vm/vm_page.c
+++ head/sys/vm/vm_page.c
@@ -3421,7 +3421,7 @@
struct vm_pagequeue *pq, *pq1;
uint8_t aflags;
- KASSERT(mtx_owned(vm_page_lockptr(m)) || m->object == NULL,
+ KASSERT(mtx_owned(vm_page_lockptr(m)) || m->ref_count == 0,
("page %p is allocated and unlocked", m));
for (pq = vm_page_pagequeue(m);; pq = pq1) {
@@ -3475,6 +3475,8 @@
vm_page_assert_locked(m);
KASSERT(m->queue == PQ_NONE && (m->aflags & PGA_QUEUE_STATE_MASK) == 0,
("%s: page %p is already enqueued", __func__, m));
+ KASSERT(m->ref_count > 0,
+ ("%s: page %p does not carry any references", __func__, m));
m->queue = queue;
if ((m->aflags & PGA_REQUEUE) == 0)
@@ -3496,6 +3498,8 @@
vm_page_assert_locked(m);
KASSERT(vm_page_queue(m) != PQ_NONE,
("%s: page %p is not logically enqueued", __func__, m));
+ KASSERT(m->ref_count > 0,
+ ("%s: page %p does not carry any references", __func__, m));
if ((m->aflags & PGA_REQUEUE) == 0)
vm_page_aflag_set(m, PGA_REQUEUE);
@@ -3889,6 +3893,8 @@
vm_page_assert_locked(m);
KASSERT((m->oflags & VPO_UNMANAGED) == 0,
("vm_page_mvqueue: page %p is unmanaged", m));
+ KASSERT(m->ref_count > 0,
+ ("%s: page %p does not carry any references", __func__, m));
if (vm_page_queue(m) != nqueue) {
vm_page_dequeue(m);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 7, 10:56 AM (20 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31027027
Default Alt Text
D22234.id64006.diff (1 KB)
Attached To
Mode
D22234: Fix a race in release_page().
Attached
Detach File
Event Timeline
Log In to Comment