From: Matthew Dillon Date: Tue, 4 Jan 2011 04:22:47 +0000 (-0800) Subject: kernel - Fix vkernel lwp stuck thread bug X-Git-Tag: v2.11.0~397 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/7e8888ce7f674f2071ff724ef17afa053eadd953 kernel - Fix vkernel lwp stuck thread bug * Fix a tsleep hz / 100 which calculates to 0 due to the vkernel's 20hz tick rate. This could cause threads running under the vkernel to get stuck. --- diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 55b520740f..2c26b8549a 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -2043,7 +2043,8 @@ restart: /* * Sanity Checks */ - KASSERT(bp->b_qindex == qindex, ("getnewbuf: inconsistent queue %d bp %p", qindex, bp)); + KASSERT(bp->b_qindex == qindex, + ("getnewbuf: inconsistent queue %d bp %p", qindex, bp)); /* * Note: we no longer distinguish between VMIO and non-VMIO @@ -2081,7 +2082,7 @@ restart: if (BUF_LOCK(bp, LK_EXCLUSIVE | LK_NOWAIT) != 0) { spin_unlock(&bufqspin); - tsleep(&bd_request, 0, "gnbxxx", hz / 100); + tsleep(&bd_request, 0, "gnbxxx", (hz + 99) / 100); goto restart; } if (bp->b_qindex != qindex) {