diff options
author | alc <alc@FreeBSD.org> | 2006-08-06 00:15:40 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2006-08-06 00:15:40 +0000 |
commit | 84c8fb9bd2c24cb26941f41d9f9b3ad498c405eb (patch) | |
tree | 9f78806ed07bf7435acc5a2fba922f01441f0c6c /sys/vm/vm_page.c | |
parent | 8eb23d6ba970edc8d4d95ed48847b9a5c0de1cf7 (diff) | |
download | FreeBSD-src-84c8fb9bd2c24cb26941f41d9f9b3ad498c405eb.zip FreeBSD-src-84c8fb9bd2c24cb26941f41d9f9b3ad498c405eb.tar.gz |
Change vm_page_sleep_if_busy() so that it no longer requires the caller to
hold the page queues lock.
Diffstat (limited to 'sys/vm/vm_page.c')
-rw-r--r-- | sys/vm/vm_page.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index 5905ee1..0031493 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -496,9 +496,10 @@ int vm_page_sleep_if_busy(vm_page_t m, int also_m_busy, const char *msg) { - mtx_assert(&vm_page_queue_mtx, MA_OWNED); VM_OBJECT_LOCK_ASSERT(m->object, MA_OWNED); if ((m->flags & PG_BUSY) || (also_m_busy && m->busy)) { + if (!mtx_owned(&vm_page_queue_mtx)) + vm_page_lock_queues(); vm_page_flag_set(m, PG_WANTED | PG_REFERENCED); vm_page_unlock_queues(); |