diff options
author | alc <alc@FreeBSD.org> | 2003-01-20 09:24:03 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2003-01-20 09:24:03 +0000 |
commit | 43a8628b32c6dbffadc0cd1ddba3f22fbad79f5c (patch) | |
tree | e463d5506b6cd99ef4f170f5b50d6261d0e3822f /sys | |
parent | 3d94105a2503d1efd45d8a06f53a0efa630af67e (diff) | |
download | FreeBSD-src-43a8628b32c6dbffadc0cd1ddba3f22fbad79f5c.zip FreeBSD-src-43a8628b32c6dbffadc0cd1ddba3f22fbad79f5c.tar.gz |
- Hold the page queues lock around vm_page_hold().
- Assert that the page queues lock rather than Giant is held in
vm_page_hold().
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/vfs_bio.c | 2 | ||||
-rw-r--r-- | sys/vm/vm_page.c | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 1f1914c..b8a156c 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -3579,7 +3579,9 @@ vmapbuf(struct buf *bp) if (pa == 0) panic("vmapbuf: page not present"); m = PHYS_TO_VM_PAGE(pa); + vm_page_lock_queues(); vm_page_hold(m); + vm_page_unlock_queues(); bp->b_pages[pidx] = m; } if (pidx > btoc(MAXPHYS)) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index bbdc77b..74ba2e7 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -358,7 +358,8 @@ vm_page_io_finish(vm_page_t m) void vm_page_hold(vm_page_t mem) { - GIANT_REQUIRED; + + mtx_assert(&vm_page_queue_mtx, MA_OWNED); mem->hold_count++; } |