o Lock page queue accesses by vm_page_dontneed().

o Assert that the page queue lock is held in vm_page_dontneed().
This commit is contained in:
alc 2002-07-23 04:39:48 +00:00
parent c540d472eb
commit b5578712f7
2 changed files with 5 additions and 4 deletions

View File

@ -1084,7 +1084,7 @@ vm_object_madvise(vm_object_t object, vm_pindex_t pindex, int count, int advise)
if (vm_page_sleep_busy(m, TRUE, "madvpo"))
goto relookup;
vm_page_lock_queues();
if (advise == MADV_WILLNEED) {
vm_page_activate(m);
} else if (advise == MADV_DONTNEED) {
@ -1109,9 +1109,10 @@ vm_object_madvise(vm_object_t object, vm_pindex_t pindex, int count, int advise)
m->dirty = 0;
m->act_count = 0;
vm_page_dontneed(m);
if (tobject->type == OBJT_SWAP)
swap_pager_freespace(tobject, tpindex, 1);
}
vm_page_unlock_queues();
if (advise == MADV_FREE && tobject->type == OBJT_SWAP)
swap_pager_freespace(tobject, tpindex, 1);
}
mtx_unlock(&Giant);
}

View File

@ -1466,7 +1466,7 @@ vm_page_dontneed(vm_page_t m)
int dnw;
int head;
GIANT_REQUIRED;
mtx_assert(&vm_page_queue_mtx, MA_OWNED);
dnw = ++dnweight;
/*