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:
parent
ef098feafc
commit
2999e9faca
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=100545
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user