Use of the ZERO_COPY_SOCKETS options can result in an unusual state that
vm_object_backing_scan() was not written to handle. Specifically, a wired page within a backing object that is shadowed by a page within the shadow object. Handle this state by removing the wired page from the backing object. The wired page will be freed by socow_iodone(). Stop masking errors: If a page is being freed by vm_object_backing_scan(), assert that it is no longer mapped rather than quietly destroying any mappings. Tested by: Harald Schmalzbauer
This commit is contained in:
parent
cdb10bb44d
commit
80f50568e4
@ -1493,8 +1493,12 @@ vm_object_backing_scan(vm_object_t object, int op)
|
|||||||
* can simply destroy it.
|
* can simply destroy it.
|
||||||
*/
|
*/
|
||||||
vm_page_lock_queues();
|
vm_page_lock_queues();
|
||||||
pmap_remove_all(p);
|
KASSERT(!pmap_page_is_mapped(p),
|
||||||
vm_page_free(p);
|
("freeing mapped page %p", p));
|
||||||
|
if (p->wire_count == 0)
|
||||||
|
vm_page_free(p);
|
||||||
|
else
|
||||||
|
vm_page_remove(p);
|
||||||
vm_page_unlock_queues();
|
vm_page_unlock_queues();
|
||||||
p = next;
|
p = next;
|
||||||
continue;
|
continue;
|
||||||
@ -1513,8 +1517,12 @@ vm_object_backing_scan(vm_object_t object, int op)
|
|||||||
* Leave the parent's page alone
|
* Leave the parent's page alone
|
||||||
*/
|
*/
|
||||||
vm_page_lock_queues();
|
vm_page_lock_queues();
|
||||||
pmap_remove_all(p);
|
KASSERT(!pmap_page_is_mapped(p),
|
||||||
vm_page_free(p);
|
("freeing mapped page %p", p));
|
||||||
|
if (p->wire_count == 0)
|
||||||
|
vm_page_free(p);
|
||||||
|
else
|
||||||
|
vm_page_remove(p);
|
||||||
vm_page_unlock_queues();
|
vm_page_unlock_queues();
|
||||||
p = next;
|
p = next;
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user