- if (object->copy == VM_OBJECT_NULL &&
- (object->purgable == VM_PURGABLE_EMPTY ||
- object->purgable == VM_PURGABLE_VOLATILE)) {
- assert(m->wire_count == 0); /* if it's wired, we can't put it on our queue */
- /* just stick it back on! */
- goto reactivate_page;
+ /* If the object is empty, the page must be reclaimed even if dirty or used. */
+ /* If the page belongs to a volatile object, we stick it back on. */
+ if (object->copy == VM_OBJECT_NULL) {
+ if(object->purgable == VM_PURGABLE_EMPTY && !m->cleaning) {
+ m->busy = TRUE;
+ if (m->pmapped == TRUE) {
+ /* unmap the page */
+ refmod_state = pmap_disconnect(m->phys_page);
+ if (refmod_state & VM_MEM_MODIFIED) {
+ m->dirty = TRUE;
+ }
+ }
+ if (m->dirty || m->precious) {
+ /* we saved the cost of cleaning this page ! */
+ vm_page_purged_count++;
+ }
+ goto reclaim_page;
+ }
+ if (object->purgable == VM_PURGABLE_VOLATILE) {
+ /* if it's wired, we can't put it on our queue */
+ assert(m->wire_count == 0);
+ /* just stick it back on! */
+ goto reactivate_page;
+ }