diff options
author | alc <alc@FreeBSD.org> | 2002-12-19 07:23:46 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2002-12-19 07:23:46 +0000 |
commit | 6bff4b9a4742061d3a586a5879b30f3cf9125af9 (patch) | |
tree | 938fec2a35377cf0a4569b8270dbec0e5a68b384 /sys/vm | |
parent | 9926d06eeb9bce8a4966bbf53b88d60314cd84f0 (diff) | |
download | FreeBSD-src-6bff4b9a4742061d3a586a5879b30f3cf9125af9.zip FreeBSD-src-6bff4b9a4742061d3a586a5879b30f3cf9125af9.tar.gz |
- Remove vm_page_sleep_busy(). The transition to vm_page_sleep_if_busy(),
which incorporates page queue and field locking, is complete.
- Assert that the page queue lock rather than Giant is held in
vm_page_flag_set().
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_page.c | 36 | ||||
-rw-r--r-- | sys/vm/vm_page.h | 1 |
2 files changed, 2 insertions, 35 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index ee23feb..4a0454f 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -277,7 +277,8 @@ vm_page_startup(vm_offset_t starta, vm_offset_t enda, vm_offset_t vaddr) void vm_page_flag_set(vm_page_t m, unsigned short bits) { - GIANT_REQUIRED; + + mtx_assert(&vm_page_queue_mtx, MA_OWNED); m->flags |= bits; } @@ -414,39 +415,6 @@ vm_page_free_zero(vm_page_t m) } /* - * vm_page_sleep_busy: - * - * Wait until page is no longer PG_BUSY or (if also_m_busy is TRUE) - * m->busy is zero. Returns TRUE if it had to sleep ( including if - * it almost had to sleep and made temporary spl*() mods), FALSE - * otherwise. - * - * This routine assumes that interrupts can only remove the busy - * status from a page, not set the busy status or change it from - * PG_BUSY to m->busy or vise versa (which would create a timing - * window). - */ -int -vm_page_sleep_busy(vm_page_t m, int also_m_busy, const char *msg) -{ - GIANT_REQUIRED; - if ((m->flags & PG_BUSY) || (also_m_busy && m->busy)) { - int s = splvm(); - if ((m->flags & PG_BUSY) || (also_m_busy && m->busy)) { - /* - * Page is busy. Wait and retry. - */ - vm_page_flag_set(m, PG_WANTED | PG_REFERENCED); - tsleep(m, PVM, msg, 0); - } - splx(s); - return (TRUE); - /* not reached */ - } - return (FALSE); -} - -/* * vm_page_sleep_if_busy: * * Sleep and release the page queues lock if PG_BUSY is set or, diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index 72cf4eb..67e3529 100644 --- a/sys/vm/vm_page.h +++ b/sys/vm/vm_page.h @@ -330,7 +330,6 @@ void vm_page_unhold(vm_page_t mem); void vm_page_copy(vm_page_t src_m, vm_page_t dest_m); void vm_page_free(vm_page_t m); void vm_page_free_zero(vm_page_t m); -int vm_page_sleep_busy(vm_page_t m, int also_m_busy, const char *msg); int vm_page_sleep_if_busy(vm_page_t m, int also_m_busy, const char *msg); void vm_page_dirty(vm_page_t m); void vm_page_wakeup(vm_page_t m); |