Module Name: src Committed By: pooka Date: Tue Nov 2 15:09:52 UTC 2010
Modified Files: src/sys/kern: vfs_bio.c Log Message: Don't sleep forever if hz < 25. from Alessandro Forin To generate a diff of this commit: cvs rdiff -u -r1.223 -r1.224 src/sys/kern/vfs_bio.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/vfs_bio.c diff -u src/sys/kern/vfs_bio.c:1.223 src/sys/kern/vfs_bio.c:1.224 --- src/sys/kern/vfs_bio.c:1.223 Tue Mar 2 14:22:44 2010 +++ src/sys/kern/vfs_bio.c Tue Nov 2 15:09:52 2010 @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_bio.c,v 1.223 2010/03/02 14:22:44 pooka Exp $ */ +/* $NetBSD: vfs_bio.c,v 1.224 2010/11/02 15:09:52 pooka Exp $ */ /*- * Copyright (c) 2007, 2008, 2009 The NetBSD Foundation, Inc. @@ -123,7 +123,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.223 2010/03/02 14:22:44 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vfs_bio.c,v 1.224 2010/11/02 15:09:52 pooka Exp $"); #include "opt_bufcache.h" @@ -1611,7 +1611,7 @@ if (nbusy_prev == 0) nbusy_prev = nbusy; printf("%d ", nbusy); - kpause("bflush", false, (iter == 0) ? 1 : hz / 25 * iter, NULL); + kpause("bflush", false, MAX(1, hz / 25 * iter), NULL); if (nbusy >= nbusy_prev) /* we didn't flush anything */ iter++; else