From 7757d1c2586617175fd124c67920169b278d3b97 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Wed, 25 Aug 2010 11:44:11 -0700 Subject: [PATCH] kernel - unlock pbuf prior to acquiring a spinlock * In relpbuf() move the BUF_UNLOCK() outside the spinlock. --- sys/vm/vm_pager.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/vm/vm_pager.c b/sys/vm/vm_pager.c index 6899f3ba70..b939a62008 100644 --- a/sys/vm/vm_pager.c +++ b/sys/vm/vm_pager.c @@ -477,9 +477,9 @@ relpbuf(struct buf *bp, int *pfreecnt) KKASSERT(bp->b_flags & B_PAGING); dsched_exit_buf(bp); - spin_lock_wr(&bswspin); - BUF_UNLOCK(bp); + + spin_lock_wr(&bswspin); if (bp->b_kvabase) { TAILQ_INSERT_HEAD(&bswlist_kva, bp, b_freelist); ++pbuf_kva_count; @@ -499,7 +499,6 @@ relpbuf(struct buf *bp, int *pfreecnt) if (++*pfreecnt == 1) wake_freecnt = 1; } - spin_unlock_wr(&bswspin); if (wake_bsw_kva) -- 2.41.0