From 560d1fbc999be1dae282d77181e98b8bbe2315f3 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sun, 24 Nov 2002 21:37:02 +0000 Subject: Add page queues locking to vunmapbuf(); reduce differences with respect to the sparc64 implementation. (Note: With modest effort on the alpha and ia64 this function could migrate to the MI part of the kernel.) Approved by: re (blanket) --- sys/amd64/amd64/vm_machdep.c | 6 +++--- sys/i386/i386/vm_machdep.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'sys') diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index 14721f306038e..1f1e4002f6695 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -481,7 +481,6 @@ vunmapbuf(bp) { int pidx; int npages; - vm_page_t *m; GIANT_REQUIRED; @@ -491,9 +490,10 @@ vunmapbuf(bp) npages = bp->b_npages; pmap_qremove(trunc_page((vm_offset_t)bp->b_data), npages); - m = bp->b_pages; + vm_page_lock_queues(); for (pidx = 0; pidx < npages; pidx++) - vm_page_unhold(*m++); + vm_page_unhold(bp->b_pages[pidx]); + vm_page_unlock_queues(); bp->b_data = bp->b_saveaddr; } diff --git a/sys/i386/i386/vm_machdep.c b/sys/i386/i386/vm_machdep.c index 14721f306038e..1f1e4002f6695 100644 --- a/sys/i386/i386/vm_machdep.c +++ b/sys/i386/i386/vm_machdep.c @@ -481,7 +481,6 @@ vunmapbuf(bp) { int pidx; int npages; - vm_page_t *m; GIANT_REQUIRED; @@ -491,9 +490,10 @@ vunmapbuf(bp) npages = bp->b_npages; pmap_qremove(trunc_page((vm_offset_t)bp->b_data), npages); - m = bp->b_pages; + vm_page_lock_queues(); for (pidx = 0; pidx < npages; pidx++) - vm_page_unhold(*m++); + vm_page_unhold(bp->b_pages[pidx]); + vm_page_unlock_queues(); bp->b_data = bp->b_saveaddr; } -- cgit v1.3