summaryrefslogtreecommitdiffstats
path: root/sys/vm/vm_page.c
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2002-12-19 07:23:46 +0000
committeralc <alc@FreeBSD.org>2002-12-19 07:23:46 +0000
commit6bff4b9a4742061d3a586a5879b30f3cf9125af9 (patch)
tree938fec2a35377cf0a4569b8270dbec0e5a68b384 /sys/vm/vm_page.c
parent9926d06eeb9bce8a4966bbf53b88d60314cd84f0 (diff)
downloadFreeBSD-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/vm_page.c')
-rw-r--r--sys/vm/vm_page.c36
1 files changed, 2 insertions, 34 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,
OpenPOWER on IntegriCloud