Rate limit vnode_pager_putpages printfs to once a second.

This commit is contained in:
Paul Saab 2005-11-01 23:00:24 +00:00
parent d394d454b0
commit dd498befc4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=151951

View File

@ -1061,6 +1061,9 @@ vnode_pager_generic_putpages(vp, m, bytecount, flags, rtvals)
struct iovec aiov;
int error;
int ioflags;
int ppscheck = 0;
static struct timeval lastfail;
static int curfail;
object = vp->v_object;
count = bytecount / PAGE_SIZE;
@ -1144,11 +1147,13 @@ vnode_pager_generic_putpages(vp, m, bytecount, flags, rtvals)
cnt.v_vnodepgsout += ncount;
if (error) {
printf("vnode_pager_putpages: I/O error %d\n", error);
if ((ppscheck = ppsratecheck(&lastfail, &curfail, 1)))
printf("vnode_pager_putpages: I/O error %d\n", error);
}
if (auio.uio_resid) {
printf("vnode_pager_putpages: residual I/O %d at %lu\n",
auio.uio_resid, (u_long)m[0]->pindex);
if (ppscheck || ppsratecheck(&lastfail, &curfail, 1))
printf("vnode_pager_putpages: residual I/O %d at %lu\n",
auio.uio_resid, (u_long)m[0]->pindex);
}
for (i = 0; i < ncount; i++) {
rtvals[i] = VM_PAGER_OK;