1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

Assert that the page queues lock is held in vm_page_unhold(),

vm_page_remove(), and vm_page_free_toq().
This commit is contained in:
Alan Cox 2002-12-15 00:06:02 +00:00
parent b12211fe30
commit 495bedfbd0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=107887

View File

@ -363,7 +363,8 @@ vm_page_hold(vm_page_t mem)
void
vm_page_unhold(vm_page_t mem)
{
GIANT_REQUIRED;
mtx_assert(&vm_page_queue_mtx, MA_OWNED);
--mem->hold_count;
KASSERT(mem->hold_count >= 0, ("vm_page_unhold: hold count < 0!!!"));
if (mem->hold_count == 0 && mem->queue == PQ_HOLD)
@ -622,7 +623,7 @@ vm_page_remove(vm_page_t m)
vm_page_t root;
GIANT_REQUIRED;
mtx_assert(&vm_page_queue_mtx, MA_OWNED);
if (m->object == NULL)
return;
@ -1061,6 +1062,7 @@ vm_page_free_toq(vm_page_t m)
vm_object_t object = m->object;
GIANT_REQUIRED;
mtx_assert(&vm_page_queue_mtx, MA_OWNED);
s = splvm();
cnt.v_tfree++;